5.15. alldifferent_cst
DESCRIPTION | LINKS | GRAPH |
- Origin
CHIP
- Constraint
- Synonyms
, .
- Argument
- Restriction
- Purpose
For all pairs of items of the collection enforce .
- Example
-
The constraint holds since all the expressions , , and correspond to distinct values.
- All solutions
FigureΒ 5.15.1 gives all solutions to the following non ground instance of the constraint: , , , , .
Figure 5.15.1. All solutions corresponding to the non ground example of the constraint of the All solutions slot
- Typical
- Symmetries
Items of are permutable.
Attributes of are permutable w.r.t. permutation (permutation not necessarily applied to all items).
One and the same constant can be added to the attribute of all items of .
One and the same constant can be added to the attribute of all items of .
- Arg. properties
Contractible wrt. .
- Usage
The constraint was originally introduced in CHIP in order to express the -queen problem with 3 global constraints (see the Usage slot of the constraint).
- Algorithm
- Systems
- See also
implies (items to collection): .
specialisation: Β ( replaced by ).
- Keywords
characteristic of a constraint: all different, disequality, sort based reformulation.
constraint type: value constraint.
filtering: bipartite matching, bipartite matching in convex bipartite graphs, convex bipartite graph, arc-consistency.
final graph structure: one_succ.
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
- Graph property(ies)
-
- Graph class
-
- Graph model
We generate a clique with an equality constraint between each pair of vertices (including a vertex and itself) and state that the size of the largest strongly connected component should not exceed one.
PartsΒ (A) andΒ (B) of FigureΒ 5.15.2 respectively show the initial and final graph associated with the Example slot. Since we use the graph property we show one of the largest strongly connected components of the final graph. The holds since all the strongly connected components have at most one vertex: a value is used at most once.
Figure 5.15.2. Initial and final graph of the constraint
(a) (b)