5.5. 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.
- All solutions
FigureΒ 5.5.1 gives all solutions to the following non ground instance of the constraint: , , , , .
Figure 5.5.1. All solutions corresponding to the non ground example of the constraint of the All solutions slot
- Typical
- Symmetries
Items of are permutable.
All occurrences of a value of can be renamed to any unused value.
- Arg. properties
Contractible wrt. .
- Counting
-
Length () 2 3 4 5 6 7 8 Solutions 3 4 5 6 7 8 9 Number of solutions for : domains
- Systems
atMostNValue in Choco, rel in Gecode, all_equal in MiniZinc.
- 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
- Cond. implications
- 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.5.2 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.5.2. Initial and final graph of the constraint
(a) (b)