5.220. lex_alldifferent
DESCRIPTION | LINKS | GRAPH |
- Origin
J.Β Pearson
- Constraint
- Synonyms
, , , , .
- Type
- Argument
- Restrictions
- Purpose
All the vectors of the collection are distinct. Two vectors and are distinct if and only if there exists such that .
- Example
-
The constraint holds since:
The first vector and the second vector of the collection differ in their third component (i.e.,Β ).
The first vector and the third vector of the collection differ in their second component (i.e.,Β ).
The second vector and the third vector of the collection differ in their second and third components (i.e.,Β and ).
- Typical
- Symmetries
Items of are permutable.
Items of are permutable (same permutation used).
All occurrences of two distinct tuples of values of can be swapped; all occurrences of a tuple of values of can be renamed to any unused tuple of values.
- Arg. properties
Contractible wrt. .
Extensible wrt. (add items at same position).
- Usage
When the vectors have two components, the constraint allows to directly enforce difference constraints between pairs of variables. Such difference constraints occur for instance in block design problems (e.g.,Β Steiner triples, Kirkman schoolgirls problem). However, in all these problems a same variable may occur in more than one pair of variables. Consequently, arc-consistency is not achieved any more by the filtering algorithm described inΒ [QuimperWalsh05].
- Algorithm
A filtering algorithm achieving arc-consistency for the constraint is proposed by C.-G.Β Quimper and T.Β Walsh inΒ [QuimperWalsh05] and a longer version is available inΒ [QuimperWalshReport05] and inΒ [QuimperWalsh06].
- Reformulation
The constraint can be expressed as a clique of constraints. By associating a -dimensional box for which all sizes are equal to 1, one can also express the constraint as a or a constraint. Enforcing all the -dimensional boxes to not overlap is equivalent as enforcing all the vectors to be distinct. In the context of the multidimensional sweep algorithm of the constraintΒ [BeldiceanuCarlssonPoderSadekTruchet07], it makes more sense to make a complete sweep over the domain of each variable in order not to only restrict the minimum and maximum value of each variable.
- See also
generalisation: Β ( replaced by ), Β ( replaced by ).
implied by: , , .
implies: .
part of system of constraints: .
specialisation: Β ( replaced by ).
- Keywords
characteristic of a constraint: vector.
constraint type: system of constraints, decomposition.
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
- Graph property(ies)
-
- Graph model
PartsΒ (A) andΒ (B) of FigureΒ 5.220.1 respectively show the initial and final graph associated with the Example slot. Since we use the graph property, the arcs of the final graph are stressed in bold.
Figure 5.220.1. Initial and final graph of the constraint
(a) (b) - Signature
Since we use the arc generator on the collection the number of arcs of the initial graph is equal to . For this reason we can rewrite to and simplify to .