5.3. all_equal
| DESCRIPTION | LINKS | GRAPH |
- Origin
- Constraint
- Synonym
.
- Argument
- Restrictions
- Purpose
Enforce all variables of the collection to take the same value.
- Example
-
The constraint holds since all its variables are fixed to value 5.
- Typical
- Symmetries
Items of are permutable.
All occurrences of a value of can be renamed to any unused value.
- Systems
atMostNValue in Choco, rel in Gecode.
- See also
generalisation: Β (a variable counting the number of distinct values is introduced).
implies: , , .
Β (decomposition-based violation measure), Β (variable-based violation measure).
specialisation: Β (equality between just two variables).
- Keywords
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
- Graph property(ies)
-
- Graph model
We use the arc generator in order to link consecutive variables of the collection by a binary equality constraint.
PartsΒ (A) andΒ (B) of FigureΒ 5.3.1 respectively show the initial and final graph of the Example slot. Since we use the graph property, the arcs of the final graph are stressed in bold.
Figure 5.3.1. Initial and final graph of the constraint


(a) (b)