5.17. alldifferent_interval
DESCRIPTION | LINKS | GRAPH | AUTOMATON |
- Origin
- Constraint
- Synonyms
, .
- Arguments
- Restrictions
- Purpose
Enforce all variables of the collection to belong to distinct intervals. The intervals are defined by where is an integer.
- Example
-
In the example, the second argument defines the following family of intervals , where is an integer. Since the three variables of the collection take values that are respectively located within the three following distinct intervals , and , the constraint holds.
- All solutions
FigureΒ 5.17.1 gives all solutions to the following non ground instance of the constraint: , , , , .
Figure 5.17.1. All solutions corresponding to the non ground example of the constraint of the All solutions slot
- Typical
- Symmetries
Items of are permutable.
A value of that belongs to the -th interval, of size , can be renamed to any unused value of the same interval.
Two distinct values of that belong to two distinct intervals, of size , can be swapped.
- Arg. properties
Contractible wrt. .
- Counting
-
Length () 2 3 4 5 6 7 8 Solutions 10 24 120 720 5040 40320 362880 Number of solutions for : domains
Length () 2 3 4 5 6 7 8 Total 10 24 120 720 5040 40320 362880 Parameter value 1 6 24 120 720 5040 40320 362880 2 4 - - - - - - Solution count for : domains
- See also
-
specialisation: Β ( replaced by ).
- Keywords
characteristic of a constraint: all different, sort based reformulation, automaton, automaton with array of counters.
constraint type: value constraint.
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
- Graph property(ies)
-
- Graph class
-
- Graph model
Similar to the constraint, but we replace the binary equality constraint of the constraint by the fact that two variables are respectively assigned to two values that belong to the same interval. We generate a clique with a belong to the same interval 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 1.
PartsΒ (A) andΒ (B) of FigureΒ 5.17.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 component of the final graph.
Figure 5.17.2. Initial and final graph of the constraint
(a) (b)
- Automaton
FigureΒ 5.17.3 depicts the automaton associated with the constraint. To each item of the collection corresponds a signature variable that is equal to 1. For each interval of values the automaton counts the number of occurrences of its values and finally imposes that the values of an interval are taken at most once.
Figure 5.17.3. Automaton of the constraint