5.241. max_increasing_slope

DESCRIPTIONLINKSAUTOMATON
Origin

Motivated by time series.

Constraint

πš–πšŠπš‘_πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπš•πš˜πš™πšŽ(π™Όπ™°πš‡,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)

Arguments
π™Όπ™°πš‡πšπšŸπšŠπš›
πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš›-πšπšŸπšŠπš›)
Restrictions
π™Όπ™°πš‡β‰₯0
π™Όπ™°πš‡<πš›πšŠπš—πšπšŽ(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)
πš›πšŽπššπšžπš’πš›πšŽπš(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πšŸπšŠπš›)
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|>0
Purpose

Given a sequence of variables πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚=V 1 ,V 2 ,β‹―,V n , sets π™Όπ™°πš‡ to 0 if βˆ„i∈[1,n-1]|V i <V i+1 , otherwise sets π™Όπ™°πš‡ to max i∈[1,n-1]|V i <V i+1 V i+1 -V i .

Example
(4,1,1,5,8,6,2,2,1,2)
(0,9,8,6,4,1,0)
(8,9,6,6,4,1,9)

The first πš–πšŠπš‘_πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπš•πš˜πš™πšŽ constraint holds since the sequence 1 1 5 8 6 2 2 1 2 contains two increasing subsequences 1 5 8 and 1 2 and the maximum slope is equal to max(5-1,8-5,2-1)=4 as shown on FigureΒ 5.241.1.

Figure 5.241.1. Illustration of the first example of the Example slot: a sequence of nine variables V 1 , V 2 , V 3 , V 4 , V 5 , V 6 , V 7 , V 8 , V 9 respectively fixed to values 1, 1, 5, 8, 6, 2, 2, 1, 2 and the corresponding maximum slope on the strictly increasing subsequences 1 5 8 and 1 2 (π™Όπ™°πš‡=4)
ctrs/max_increasing_slope-1-tikz
Typical
π™Όπ™°πš‡>0
π™Όπ™°πš‡<πš›πšŠπš—πšπšŽ(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)-1
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|>2
πš›πšŠπš—πšπšŽ(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)>2
Symmetry

One and the same constant can be added to the πšŸπšŠπš› attribute of all items of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.

Arg. properties

Functional dependency: π™Όπ™°πš‡ determined by πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.

Usage

Getting the maximum slope over the increasing sequences of time series.

Counting
Length (n)2345678
Solutions9646257776117649209715243046721

Number of solutions for πš–πšŠπš‘_πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπš•πš˜πš™πšŽ: domains 0..n

ctrs/max_increasing_slope-2-tikz

ctrs/max_increasing_slope-3-tikz

Length (n)2345678
Total9646257776117649209715243046721
Parameter
value

062070252924343212870
12201511036682844220284405
21161881952192001833041721425
3-81422106290353801164847301
4--741584282664838408021350
5---846216844576329208124
6----117123530888654931
7-----1915206673834
8------3622481

Solution count for πš–πšŠπš‘_πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπš•πš˜πš™πšŽ: domains 0..n

ctrs/max_increasing_slope-4-tikz

ctrs/max_increasing_slope-5-tikz

Keywords

characteristic of a constraint: automaton, automaton with counters.

combinatorial object: sequence.

constraint arguments: reverse of a constraint, pure functional dependency.

filtering: glue matrix.

modelling: functional dependency.

Cond. implications

β€’ πš–πšŠπš‘_πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπš•πš˜πš™πšŽ(π™Όπ™°πš‡,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)

Β Β Β  withΒ  πš›πšŠπš—πšπšŽ(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)=π™Όπ™°πš‡+1

Β Β implies πš•πš˜πš—πšπšŽπšœπš_πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπšŽπššπšžπšŽπš—πšŒπšŽ(𝙻,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)

Β Β Β  whenΒ  πš›πšŠπš—πšπšŽ(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)=𝙻+1.

β€’ πš–πšŠπš‘_πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπš•πš˜πš™πšŽ(π™Όπ™°πš‡,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)

Β Β Β  withΒ  π™Όπ™°πš‡=1

Β Β implies πš–πš’πš—_πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπš•πš˜πš™πšŽ(𝙼𝙸𝙽,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)

Β Β Β  whenΒ  𝙼𝙸𝙽=1.

Automaton

FigureΒ 5.241.2 depicts the automaton associated with the πš–πšŠπš‘_πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπš•πš˜πš™πšŽ constraint. To each pair of consecutive variables (πš…π™°πš i ,πš…π™°πš i+1 ) of the collection πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ corresponds a signature variable S i . The following signature constraint links πš…π™°πš i , πš…π™°πš i+1 and S i : (πš…π™°πš i β‰₯πš…π™°πš i+1 ⇔S i =0) ∧ (πš…π™°πš i <πš…π™°πš i+1 ⇔S i =1).

Figure 5.241.2. Automaton for the πš–πšŠπš‘_πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπš•πš˜πš™πšŽ constraint and its glue matrix (note that the reverse of πš–πšŠπš‘_πš’πš—πšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπš•πš˜πš™πšŽ is πš–πšŠπš‘_πšπšŽπšŒπš›πšŽπšŠπšœπš’πš—πš_πšœπš•πš˜πš™πšŽ)
ctrs/max_increasing_slope-6-tikz