5.161. increasing_nvalue
| DESCRIPTION | LINKS | GRAPH | AUTOMATON |
- Origin
- Constraint
- Arguments
- Restrictions
- Purpose
The variables of the collection are increasing. In addition, is the number of distinct values taken by the variables of the collection .
- Example
-
The constraint (see FigureΒ 5.161.1 for a graphical representation) holds since:
The values of the collection are sorted in increasing order.
is set to the number of distinct values occurring within the collection .
Figure 5.161.1. The solution associated with the example

- Typical
- Symmetry
One and the same constant can be added to the attribute of all items of .
- Algorithm
A complete filtering algorithm in a linear time complexity over the sum of the domain sizes is described inΒ [BeldiceanuHermenierLorcaPetit10]. A generalisation of this algorithm to other constraints is given inΒ [BeldiceanuLorcaPetit10].
- Reformulation
The constraint can be expressed in term of a conjunction of a and an constraints (i.e.,Β a chain of non strict inequality constraints on adjacent variables of the collection ). But as shown by the following example, , , , (), this hinders propagation (i.e.,Β the unique solution , is not directly obtained after stating all the previous constraints).
- Systems
- See also
implies: Β (remove parameter from ), .
related: .
shift of concept: Β ( replaced by and replaced by ).
- Keywords
constraint type: counting constraint, value partitioning constraint, order constraint.
final graph structure: strongly connected component, equivalence.
modelling: number of distinct equivalence classes, number of distinct values.
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
- Graph property(ies)
-
- Graph class
-
- Graph model
PartsΒ (A) andΒ (B) of FigureΒ 5.161.2 respectively show the initial and final graph associated with the Example slot. Since we use the graph property we show the different strongly connected components of the final graph. Each strongly connected component corresponds to a value that is assigned to some variables of the collection. The 2 following values 6 and 8 are used by the variables of the collection.
Figure 5.161.2. Initial and final graph of the constraint


(a) (b)
- Automaton
A first systematic approach for creating an automaton that only recognises the solutions of the constraint could be to:
First, create an automaton that recognises the solutions of the constraint.
Second, create an automaton that recognises the solutions of the constraint.
Third, make the product of the two previous automata and minimise the resulting automaton.
However this approach is not going to scale well in practice since the automaton associated with the constraint has a too big size. Therefore we propose an approach where we directly construct in one single step the automaton that only recognises the solutions of the constraint. Note that we do not have any formal proof that the resulting automaton is always minimum.
Without loss of generality, assume that the collection of variables contains at least one variable (i.e.,Β ). Let , , , and respectively denote the minimum and maximum possible value of variable , the number of variables of the collection , the smallest value that can be assigned to the variables of , and the largest value that can be assigned to the variables of . Let denote the total number of potential values. Clearly, the maximum number of distinct values that can be assigned to the variables of the collection cannot exceed the quantity . The states of the automaton that only accepts solutions of the constraint can be defined in the following way:
We have an initial state labelled by .
We have states labelled by . The first index of a state corresponds to the number of distinct values already encountered, while the second index denotes the the current value (i.e.,Β more precisely the index of the current value, where the minimum value has index 1).
Terminal states depend on the possible values of variable and correspond to those states such that is a possible value for variable . Note that we assume no further restriction on the domain of (otherwise the set of terminal states needs to be reduced in order to reflect the current set of possible values of ). Three classes of transitions are respectively defined in the following way:
There is a transition, labelled by , from the initial state to the state .
There is a loop, labelled by for every state .
there is a transition labelled by from to .
We respectively have transitions of class 1, transitions of class 2, and transitions of class 3.
Note that all states such that can be discarded since they do not allow to reach the minimum number of distinct values required .
PartΒ (A) of FigureΒ 5.161.3 depicts the automaton associated with the constraint of the Example slot. For this purpose, we assume that variable is fixed to value 2 and that variables of the collection take their values within interval . PartΒ (B) of FigureΒ 5.161.3 represents the simplified automaton where all states that do not allow to reach a terminal state were removed. The constraint holds since the corresponding sequence of visited states, , ends up in a terminal state (i.e.,Β terminal states are depicted by thick circles in the figure).
Figure 5.161.3. Automaton β PartΒ A β and simplified automaton β PartΒ B β of the constraint of the Example slot: the path corresponding to the solution is depicted by thick arcs
