5.175. highest_peak

DESCRIPTIONLINKSAUTOMATON
Origin

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

Constraint

πš‘πš’πšπš‘πšŽπšœπš_πš™πšŽπšŠπš”(π™·π™΄π™Έπ™Άπ™·πšƒ,πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚)

Arguments
π™·π™΄π™Έπ™Άπ™·πšƒπšπšŸπšŠπš›
πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚πšŒπš˜πš•πš•πšŽπšŒπšπš’πš˜πš—(πšŸπšŠπš›-πšπšŸπšŠπš›)
Restriction
πš›πšŽπššπšžπš’πš›πšŽπš(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚,πšŸπšŠπš›)
Purpose

A variable V k (1<k<m) of the sequence of variables πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚=V 1 ,β‹―,V m is a peak if and only if there exists an i (1<i≀k) such that V i-1 <V i and V i =V i+1 =β‹―=V k and V k >V k+1 . π™·π™΄π™Έπ™Άπ™·πšƒ is the maximum value of the peak variables. If no such variable exists π™·π™΄π™Έπ™Άπ™·πšƒ is equal to π™Όπ™Έπ™½π™Έπ™½πšƒ.

Example
(8,1,1,4,8,6,2,7,1)
(1,0,1,1,0,0,1,0,1)

The first πš‘πš’πšπš‘πšŽπšœπš_πš™πšŽπšŠπš” constraint holds since 8 is the maximum peak of the sequence 1 1 4 8 6 2 7 1.

Figure 5.175.1. Illustration of the first constraint of the Example slot: a sequence of eight variables V 1 , V 2 , V 3 , V 4 , V 5 , V 6 , V 7 , V 8 respectively fixed to values 1, 1, 4, 8, 6, 2, 7, 1 and its corresponding highest peak 8
ctrs/highest_peak-1-tikz
Typical
|πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚|>2
πš›πšŠπš—πšπšŽ(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)>2
πš™πšŽπšŠπš”(πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.πšŸπšŠπš›)>0
Symmetry

Items of πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚ can be reversed.

Arg. properties

Functional dependency: π™·π™΄π™Έπ™Άπ™·πšƒ determined by πš…π™°πšπ™Έπ™°π™±π™»π™΄πš‚.

Counting
Length (n)2345678
Solutions9646257776117649209715243046721

Number of solutions for πš‘πš’πšπš‘πšŽπšœπš_πš™πšŽπšŠπš”: domains 0..n

ctrs/highest_peak-2-tikz

ctrs/highest_peak-3-tikz

Length (n)2345678
Total9646257776117649209715243046721
Parameter
value

-100000095029517921108869498439791
1-11192697503635443
2-444380300022632166208
3-999900758761389484020
4--1761712156801385441195056
5---2900291252832502693425
6----504725405765665896
7-----97622711233250
8------21133632

Solution count for πš‘πš’πšπš‘πšŽπšœπš_πš™πšŽπšŠπš”: domains 0..n

ctrs/highest_peak-4-tikz

ctrs/highest_peak-5-tikz

See also

common keyword: πšπšŽπšŽπš™πšŽπšœπš_πšŸπšŠπš•πš•πšŽπš’, πš™πšŽπšŠπš”Β (sequence).

implies: πš‹πšŽπšπš πšŽπšŽπš—_πš–πš’πš—_πš–πšŠπš‘.

Keywords

characteristic of a constraint: automaton, automaton with counters, automaton with same input symbol.

combinatorial object: sequence.

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

constraint network structure: sliding cyclic(1) constraint network(2).

filtering: glue matrix.

modelling: functional dependency.

Automaton

FigureΒ 5.175.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.175.2. Automaton of the πš‘πš’πšπš‘πšŽπšœπš_πš™πšŽπšŠπš” constraint and its glue matrix (state s means that we are in decreasing or stationary mode, state u means that we are in increasing mode, a new peak is detected each time we switch from increasing to decreasing mode and the counter C is updated accordingly); minint is the smallest integer that can be represented on a machine
ctrs/highest_peak-6-tikz
Figure 5.175.3. Hypergraph of the reformulation corresponding to the automaton of the πš‘πš’πšπš‘πšŽπšœπš_πš™πšŽπšŠπš” constraint (C 0 is set to minint the largest integer that can be represented on a machine)
ctrs/highest_peak-10-tikz