5.253. min_dist_between_inflexion
DESCRIPTION | LINKS | AUTOMATON |
- Origin
- Constraint
- Arguments
- Restrictions
- Purpose
Given an integer value and a sequence of variables enforce to be greater than or equal to the smallest distance between two consecutive inflexions in the sequence , or to if no more than one inflexion exists.
An inflexion of a sequence of variables is a set of consecutive variables () such that one of the following conditions holds:
,
.
In this context, the index is the position of the inflexion (i.e., the first instant when the inflexion is discovered when scanning the sequence of variables from left to right. The distance between two consecutive inflexions is the absolute value of the difference of their corresponding positions.
- Example
-
FigureΒ 5.253.1 shows the three inflexions associated with the sequence 2, 2, 3, 3, 2, 2, 1, 4, 4, 3 and their respective positions 5, 8 and 10 in red. The constraint holds since its first argument is greater than or equal to the smallest distance 2 between two consecutive inflexions of the sequence of variables .
Figure 5.253.1. Illustration of the Example slot: a sequence of ten variables , , , , , , , , , respectively fixed to values 2, 2, 3, 3, 2, 2, 1, 4, 4, 3 and its three inflexions, two peaks and one valley; each red point denotes an instant where a new inflexion is discovered while scanning the sequence from left to right; as shown by the rightmost arrow, the minimum distance between two consecutive inflexions is equal to 2.
- Typical
- Symmetries
- Counting
-
Length () 2 3 4 5 6 7 8 Solutions 9 64 1135 25444 574483 13287476 328156407 Number of solutions for : domains
Length () 2 3 4 5 6 7 8 Total 9 64 1135 25444 574483 13287476 328156407 Parameter value 1 - - 170 3598 73794 1543512 35152278 2 9 - 170 4690 91098 1819764 39992562 3 - 64 170 4690 97314 1932012 41360676 4 - - 625 4690 97314 1965012 42025560 5 - - - 7776 97314 1965012 42192870 6 - - - - 117649 1965012 42192870 7 - - - - - 2097152 42192870 8 - - - - - - 43046721 Solution count for : domains
- See also
common keyword: , , , , Β (sequence).
- 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(3).
- Automaton
FigureΒ 5.253.2 depicts the automaton associated with the constraint.
Figure 5.253.2. Automaton of the constraint (state means that we are in stationary mode, state means that we are in increasing mode and that we did not yet found any inflexion, state means that we are in decreasing mode and that we did not yet found any inflexion, state means that we are in increasing mode and that we already found at least one inflexion, state means that we are in decreasing mode and that we already found at least one inflexion, the minimum distance between two consecutive inflexions is updated each time we switch from to mode β or conversely from to mode β and the counter is updated accordingly)
Figure 5.253.3. Hypergraph of the reformulation corresponding to the automaton of the constraint where is a shortcut for (since all states of the automaton are accepting there is no restriction on the last variable )