5.51. big_peak

DESCRIPTIONLINKSAUTOMATON
Origin

Derived from πš™πšŽπšŠπš”.

Constraint

πš‹πš’πš_πš™πšŽπšŠπš”(𝙽,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πšƒπ™Ύπ™»π™΄πšπ™°π™½π™²π™΄)

Arguments
π™½πšπšŸπšŠπš›
πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš›-πšπšŸπšŠπš›)
πšƒπ™Ύπ™»π™΄πšπ™°π™½π™²π™΄πš’πš—πš
Restrictions
𝙽β‰₯0
2*π™½β‰€πš–πšŠπš‘(|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|-1,0)
πš›πšŽπššπšžπš’πš›πšŽπš(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πšŸπšŠπš›)
πšƒπ™Ύπ™»π™΄πšπ™°π™½π™²π™΄β‰₯0
Purpose

A variable V p (1<p<m) of the sequence of variables πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚=V 1 ,β‹―,V m is a peak if and only if there exists an i (1<i≀p) such that V i-1 <V i and V i =V i+1 =β‹―=V p and V p >V p+1 . Similarly a variable V v (1<k<m) is a valley if and only if there exists an i (1<i≀v) such that V i-1 >V i and V i =V i+1 =β‹―=V v and V v <V v+1 . A peak variable V p (1<p<m) is a potential big peak wrt a non-negative integer πšƒπ™Ύπ™»π™΄πšπ™°π™½π™²π™΄ if and only if:

  1. V p is a peak,

  2. βˆƒi,j∈[1,m] | i<p<j, V i is a valley (or i=1 if there is no valley before position p), V j is a valley (or i=m if there is no valley after position p), V p -V i >πšƒπ™Ύπ™»π™΄πšπ™°π™½π™²π™΄, and V p -V j >πšƒπ™Ύπ™»π™΄πšπ™°π™½π™²π™΄.

Let i p and j p be the largest i and the smallest j satisfying conditionΒ 2. Now a potential big peak V p (1<p<m) is a big peak if and only if the interval [i,j] does not contain any potential big peak that is strictly higher than V p . The constraint πš‹πš’πš_πš™πšŽπšŠπš” holds if and only if 𝙽 is the total number of big peaks of the sequence of variables πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.

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

As shown part PartΒ (A) of FigureΒ 5.51.1, the first πš‹πš’πš_πš™πšŽπšŠπš” constraint holds since the sequence 4 2 2 4 3 8 6 7 7 9 5 6 3 12 12 6 6 8 4 5 1 contains seven big peaks wrt a tolerance of 0 (i.e., we consider standard peaks).

As shown part PartΒ (B) of FigureΒ 5.51.1, the second πš‹πš’πš_πš™πšŽπšŠπš” constraint holds since the same sequence 4 2 2 4 3 8 6 7 7 9 5 6 3 12 12 6 6 8 4 5 1 contains only four big peaks wrt a tolerance of 1.

Figure 5.51.1. Illustration of the Example slot: PartΒ (A) a sequence of 21 variables V 1 , V 2 , ..., V 21 respectively fixed to values 4, 2, 2, 4, 3, 8, 6, 7, 7, 9, 5, 6, 3, 12, 12, 6, 6, 8, 4, 5, 1 and its corresponding 7 peaks (πšƒπ™Ύπ™»π™΄πšπ™°π™½π™²π™΄=0 corresponds to standard peaks) with their respective heights h 1 0 =1, h 2 0 =2, h 3 0 =3, h 4 0 =1, h 5 0 =6, h 6 0 =2, h 7 0 =1 (the left and right hand sides of each peak are coloured in light orange and light red) PartΒ (B) the same sequence of variables and its 4 big peaks when πšƒπ™Ύπ™»π™΄πšπ™°π™½π™²π™΄=1 with their respective heights h 1 1 =2, h 2 1 =3, h 3 1 =6, h 4 1 =2
ctrs/big_peak-1-tikz
Typical
𝙽β‰₯1
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|>6
πš›πšŠπš—πšπšŽ(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)>1
πšƒπ™Ύπ™»π™΄πšπ™°π™½π™²π™΄>1
Symmetries
  • Items of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ can be reversed.

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

Arg. properties
  • Functional dependency: 𝙽 determined by πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ and πšƒπ™Ύπ™»π™΄πšπ™°π™½π™²π™΄.

  • Contractible wrt. πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ when 𝙽=0 and πšƒπ™Ύπ™»π™΄πšπ™°π™½π™²π™΄=0.

Usage

Useful for constraining the number of big peaks of a sequence of domain variables, by ignoring too small valleys that artificially create small peaks wrt πšƒπ™Ύπ™»π™΄πšπ™°π™½π™²π™΄.

See also

specialisation: πš™πšŽπšŠπš”Β (the tolerance is set to 0 and removed).

Keywords

characteristic of a constraint: automaton, automaton with counters.

combinatorial object: sequence.

constraint arguments: pure functional dependency.

modelling: functional dependency.

Automaton

FigureΒ 5.51.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) ∧ (πš…π™°πš i >πš…π™°πš i+1 ⇔S i =2).

Figure 5.51.2. Automaton for the πš‹πš’πš_πš™πšŽπšŠπš” constraint where C, S, P, π‘šπ‘–π‘› and Ξ” respectively stand for the number of big peaks already encountered, the altitude at the start of the current potential big peak, the altitude of the current potential big peak, the smallest value that can be assigned to a variable of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚, the πšƒπ™Ύπ™»π™΄πšπ™°π™½π™²π™΄ parameter
ctrs/big_peak-2-tikz