5.6. all_equal_peak
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.
- Example
-
The constraint holds since the two peaks, in bold, of the sequence are located at the same altitude 5. FigureΒ 5.6.1 depicts the solution associated with the example.
Figure 5.6.1. Illustration of the Example slot: a sequence of eight variables , , , , , , , respectively fixed to values 1, 5, 5, 4, 3, 5, 2, 7 and its corresponding two peaks, in red, both located at altitude 5
Note that the constraint does not enforce that the maximum value of the sequence corresponds to the altitude of its peaks since, as shown by the example, the sequence can ends up with an increasing subsequence that go beyond the altitude of its peaks. It also does not enforce that the sequence contains at least one peak.
- All solutions
FigureΒ 5.6.2 gives all solutions to the following non ground instance of the constraint: , , , , , .
Figure 5.6.2. All solutions corresponding to the non ground example of the constraint of the All solutions slot where each peak is coloured in orange
- Typical
- Symmetries
- Arg. properties
Prefix-contractible wrt. .
Suffix-contractible wrt. .
- Counting
-
Length () 2 3 4 5 6 7 8 9 Solutions 9 64 625 7330 93947 1267790 17908059 266201992 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.6.3 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.6.3. 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)
Figure 5.6.4. 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 )