5.123. disjoint
DESCRIPTION | LINKS | GRAPH | AUTOMATON |
- Origin
- Constraint
- Arguments
- Restrictions
- Purpose
Each variable of the collection should take a value that is distinct from all the values assigned to the variables of the collection .
- Example
-
In this example, values are used by the variables of and values by the variables of . Since there is no intersection between the two previous sets of values the constraint holds.
- All solutions
FigureΒ 5.123.1 gives all solutions to the following non ground instance of the constraint: , , , , , .
Figure 5.123.1. All solutions corresponding to the non ground example of the constraint of the All solutions slot
- Typical
- Symmetries
Arguments are permutable w.r.t. permutation .
Items of are permutable.
Items of are permutable.
An occurrence of a value of can be replaced by any value of .
An occurrence of a value of can be replaced by any value of .
All occurrences of two distinct values in or can be swapped; all occurrences of a value in or can be renamed to any unused value.
- Arg. properties
Contractible wrt. .
Contractible wrt. .
- Remark
Despite the fact that this is not an uncommon constraint, it can not be modelled in a compact way neither with a disequality constraint (i.e.,Β two given variables have to take distinct values) nor with the constraint. The constraint can bee seen as a special case of the constraint where and are both set to 0.
MiniZinc (http://www.minizinc.org/) has a constraint between two set variables rather than between two collections of variables.
- Algorithm
Let us note:
the minimum number of distinct values taken by the variables of the collection .
the minimum number of distinct values taken by the variables of the collection .
the maximum number of distinct values taken by the union of the variables of and .
One invariant to maintain for the constraint is . A lower bound of and can be obtained by using the algorithms provided in [Beldiceanu01], [BeldiceanuCarlssonThiel02]. An exact upper bound of can be computed by using a bipartite matching algorithm.
- Used in
- See also
generalisation: Β ( replaced by ).
implies: , .
- Keywords
characteristic of a constraint: disequality, automaton, automaton with array of counters.
constraint type: value constraint.
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
- Graph property(ies)
-
- Graph model
is used in order to generate the arcs of the graph between all variables of and all variables of . Since we use the graph property 0 the final graph will be empty. FigureΒ 5.123.2 shows the initial graph associated with the Example slot. Since we use the 0 graph property the final graph is empty.
Figure 5.123.2. Initial graph of the constraint (the final graph is empty)
- Signature
Since 0 is the smallest number of arcs of the final graph we can rewrite 0 to 0. This leads to simplify to .
- Automaton
FigureΒ 5.123.3 depicts the automaton associated with the constraint. To each variable of the collection corresponds a signature variable that is equal to 0. To each variable of the collection corresponds a signature variable that is equal to 1.
Figure 5.123.3. Automaton of the constraint, where state handles variables of the collection and state handles variables of the collection