5.7. all_equal_peak_max
DESCRIPTION | LINKS | AUTOMATON |
- Origin
- Constraint
- Argument
- Restrictions
- Purpose
A variable of the sequence of variables is a peak if and only if there exists an such that and and .
Enforce all the peaks of the sequence to be assigned the same value, i.e.Β to be located at the same altitude corresponding to the maximum value of the sequence .
- Example
-
The constraint holds since the two peaks, in bold, of the sequence are located at the same altitude 5 that is also the maximum value of the sequence . FigureΒ 5.7.1 depicts the solution associated with the example.
Figure 5.7.1. Illustration of the Example slot: a sequence of eight variables , , , , , , , respectively fixed to values 1, 5, 5, 4, 3, 5, 2, 5 and its corresponding two peaks, in red, both located at altitude 5 that also corresponds to the maximum value of the sequence
Note that the constraint does not enforce that the sequence contains at least one peak.
- Typical
- Symmetries
- Arg. properties
Prefix-contractible wrt. .
Suffix-contractible wrt. .
- Counting
-
Length () 2 3 4 5 6 7 8 Solutions 9 64 605 6707 81648 1065542 14829903 Number of solutions for : domains
- See also
-
implies: .
related: , .
- Keywords
characteristic of a constraint: automaton, automaton with counters, automaton with same input symbol.
combinatorial object: sequence.
constraint network structure: sliding cyclic(1) constraint network(2).
- Cond. implications
- Automaton
FigureΒ 5.7.2 depicts the automaton associated with the constraint. To each pair of consecutive variables of the collection corresponds a signature variable . The following signature constraint links , and : .
Figure 5.7.2. Automaton for the constraint; note the conditional transition from state to state testing that the counter is equal to for enforcing that all peaks are located at the same altitude; the conditional transitions from to and from to and the final check enforce the maximum value of the sequence to not exceed the altitude of the eventual peaks.
Figure 5.7.3. Hypergraph of the reformulation corresponding to the automaton of the constraint where stands for the value of the counter (since all states of the automaton are accepting there is no restriction on the last variable )