5.186. increasing_global_cardinality
DESCRIPTION | LINKS | GRAPH | AUTOMATON |
- Origin
- Constraint
- Synonyms
, , .
- Arguments
- Restrictions
- Purpose
The variables of the collection are increasing. In addition, each value should be taken by at least and at most variables of the collection.
- Example
-
The constraint holds since:
The values of the collection are sorted in increasing order.
Values 3, 5 and 6 are respectively used 2 (), 0 () and 1 () times within the collection and since no constraint was specified for value 8.
- Typical
- Symmetry
Items of are permutable.
- Usage
This constraint can be used in order to break symmetry in the context of the following pattern. We have a matrix of variables with the same constraint on each row and a constraint on each column. Beside lexicographically ordering the rows of with a constraint, one can also state a on the first column of in order to improve propagation on the corresponding variables.
- Reformulation
The constraint can be expressed in term of a conjunction of a and an constraints. Even if we achieve arc-consistency on these two constraints this hinders propagation as shown by the following small example.
We have two variables and , which both take their values in the set . In addition, assume that the minimum number of occurrences of values 0, 1 and 2 are respectively equal to 0, 1 and 1. Similarly assume that, the maximum number of occurrences of values 0, 1 and 2 are respectively equal to 1, 1 and 2. The reformulation does not reduce the domain of variables , in any way, while the automaton described in the Automaton slot fixes to 2 and to 3.
- See also
implies: , .
related: .
- Keywords
-
characteristic of a constraint: automaton, automaton without counters, reified automaton constraint.
constraint network structure: Berge-acyclic constraint network.
For all items of :
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
- Graph property(ies)
-
- Graph model
Since we want to express one unary constraint for each value we use the βFor all items of β iterator. PartΒ (A) of FigureΒ 5.186.1 shows the initial graphs associated with each value 3, 5 and 6 of the collection of the Example slot. PartΒ (B) of FigureΒ 5.186.1 shows the two corresponding final graphs respectively associated with values 3 and 6 that are both assigned to the variables of the collection (since value 5 is not assigned to any variable of the collection the final graph associated with value 5 is empty). Since we use the graph property, the vertices of the final graphs are stressed in bold.
Figure 5.186.1. Initial and final graph of the constraint
(a) (b)
- Automaton
A first systematic approach for creating an automaton that only recognises the solutions to the constraint could be to:
First, create an automaton that recognises the solutions to the constraint.
Second, create an automaton that recognises the solutions to 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 may have a too big size. Therefore we propose an approach where we directly construct in a single step the automaton that only recognises the solutions to the constraint. Note that we do not have any formal proof that the resulting automaton is always minimum.
Without loss of generality, we assume that:
All items of the collection are sorted in increasing value on the attribute .
All the potential values of the variables of the collection are included within the set of values of the collection (i.e.,Β the attribute).If this is not the case, we can include these values within the collection and set their minimum and maximum number of occurrences to 0 and .
All values of the collection for which the attribute is set to 0 cannot be assigned to the variables of the collection.We initially remove such values from all variables of the collection.
Before defining the states of the automaton, we first need to introduce the following notion. A value is constrained by its maximum number of occurrences if and only if .When we cannot reduce the number of states related to value and we therefore consider that we are in the constrained case. Let denote the set of constrained values (i.e.,Β their indexes within the collection ) by their respective maximum number of occurrences.
After determining the set , the attribute of each potential value is normalised in the following way:
For an unconstrained value we reset to .
For a constrained value we reset to 1 if its current value is smaller than 1.
We are now in position to introduce the states of the automaton.
The states of the automaton that only accepts solutions to the constraint are defined in the following way:
For the item of the collection we have:
If , states labelled by .
If , states labelled by .
We have an initial state labelled by .
Terminal states correspond to those states such that, both (1)Β is greater than or equal to , and (2)Β there is no value item such that . Transitions are defined in the following way:
There is an arc, labelled by , from the initial state to every state where is an item for which all values strictly less than verify the condition .
For each value constrained by its maximum number of occurrences (i.e.,Β ), there is an arc, labelled by , from the state to the state for all in .
For each value unconstrained by its maximum number of occurrences (i.e.,Β ), there is an arc, labelled by , from the state to the state for all in . There is also a loop, labelled by , from state to the state for .
For each value constrained by its maximum number of occurrences (i.e.,Β ), there is an arc, labelled by , from state to state for all in and for all such that .
For each value unconstrained by its maximum number of occurrences (i.e.,Β ), there is an arc, labelled by , from state to state for and for all such that .
FigureΒ 5.186.2 depicts the automaton associated with the constraint of the Example slot. For this purpose we assume without loss of generality that we have four decision variables that all take their potential values within interval . Consequently, values 4, 7 and 8 are first added to the items of the collection. Both values 3 and 6 are unconstrained by their respective maximum number of occurrences. Therefore their attributes are respectively reduced to 2 and 1. All other values, namely values 4, 5, 7 and 8, are constrained values. The constraint holds since the corresponding sequence of visited states, , ends up in an accepting state (i.e.,Β accepting states are denoted graphically by a double circle in the figure). Note that non initial states are first indexed by the position of an item within the collection, and not by the value itself (e.g.,Β within the 1 designates value 3). For instance state depicts the fact that the automaton has already recognised a single occurrence of value 3, while corresponds to the fact that the automaton has already seen at least two occurrences of value 3.The at least comes from the loop on state .
Figure 5.186.2. Automaton of the constraint of the Example slot: the path corresponding to the solution is depicted by thick orange arcs