5.64. change_partition
DESCRIPTION | LINKS | GRAPH |
- Origin
- Constraint
- Type
- Arguments
- Restrictions
- Purpose
is the number of times that the following constraint holds: and do not belong to the same partition of the collection , where and correspond to consecutive variables of the collection .
- Example
-
In the example we have the following two changes:
One change between values 2 and 1 (since 2 and 1 respectively belong to the third and the first partition),
One change between values 1 and 6 (since 1 and 6 respectively belong to the first and the third partition).
Consequently the constraint holds since its first argument is assigned to 2.
- Typical
- Symmetries
Items of can be reversed.
Items of are permutable.
Items of are permutable.
An occurrence of a value of can be replaced by any other value that also belongs to the same partition of .
- Arg. properties
Functional dependency: determined by and .
- Usage
This constraint is useful for the following problem: Assume you have to produce a set of orders, each order belonging to a given family. In the context of the Example slot we have three families that respectively correspond to values , to value 4 and to values . We would like to sequence the orders in such a way that we minimise the number of times two consecutive orders do not belong to the same family.
- Algorithm
- See also
common keyword: Β (number of changes in a sequence of with respect to a ).
- Keywords
characteristic of a constraint: partition.
constraint arguments: pure functional dependency.
constraint type: timetabling constraint.
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
- Graph property(ies)
-
- Graph class
-
- Graph model
PartsΒ (A) andΒ (B) of FigureΒ 5.64.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.64.1. Initial and final graph of the constraint
(a) (b)