5.172. group
DESCRIPTION | LINKS | GRAPH | AUTOMATON |
- Origin
CHIP
- Constraint
- Arguments
- Restrictions
- Purpose
Let be the number of variables of the collection . Let be consecutive variables of the collection of variables such that all the following conditions simultaneously apply:
All variables take their value in the set of values ,
or does not take a value in ,
or does not take a value in .
We call such a sequence of variables a group. Similarly an anti-group is a maximum sequence of variables that are not assigned any value from . The constraint is true if all the following conditions hold:
There are exactly groups of variables,
is the number of variables of the smallest group,
is the number of variables of the largest group,
is the number of variables of the smallest anti-group,
is the number of variables of the largest anti-group,
is the number of variables that take their value in the set of values .
- Example
-
Given the fact that groups are formed by even values in (i.e.,Β values expressed by the collection), the constraint holds since:
Its first argument, , is set to value 2 since the sequence contains two groups of even values (i.e.,Β group and groupΒ 4).
Its second argument, , is set to value 1 since the smallest group of even values involves only a single value (i.e.,Β valueΒ 4).
Its third argument, , is set to value 2 since the largest group of even values involves two values (i.e.,Β group ).
Its fourth argument, , is set to value 2 since the smallest anti-group involves two values (i.e.,Β anti-group ).
Its fifth argument, , is set to value 4 since the largest anti-group involves four values (i.e.,Β anti-group ).
Its sixth argument, , is set to value 3 since the total number of even values of the sequence is equal to 3 (i.e.,Β values 2, 8 and 4).
- All solutions
FigureΒ 5.172.1 gives all solutions to the following non ground instance of the constraint: , , , , , , , , , , , , , , , ,
Figure 5.172.1. All solutions corresponding to the non ground example of the constraint of the All solutions slot
- Typical
- Symmetries
Items of can be reversed.
Items of are permutable.
An occurrence of a value of that belongs to (resp. does not belong to ) can be replaced by any other value in (resp. not in ).
- Arg. properties
Functional dependency: determined by and .
Functional dependency: determined by and .
Functional dependency: determined by and .
Functional dependency: determined by and .
Functional dependency: determined by and .
Functional dependency: determined by and .
- Usage
A typical use of the constraint in the context of timetabling is as follow: The value of the variable of the collection corresponds to the type of shift (i.e.,Β night, morning, afternoon, rest) performed by a specific person on day . A complete period of work is represented by the variables of the collection. In this context the constraint expresses for a person:
The number of periods of consecutive night-shift during a complete period of work.
The total number of night-shift during a complete period of work.
The maximum number of allowed consecutive night-shift.
The minimum number of days, which do not correspond to a night-shift, between two consecutive sequences of night-shift.
- Remark
For this constraint we use the possibility to express directly more than one constraint on the parameters of the final graph we want to obtain. For more propagation, it is crucial to keep this in a single constraint, since strong relations relate the different parameters of a graph. This constraint is very similar to the constraint introduced in CHIP, except that here, the and constraints apply also for the two borders: we cannot start or end with a group of consecutive variables that take their values outside and such that is less than or is greater than .
- See also
common keyword: , Β (timetabling constraint,sequence), Β (sequence),
Β (timetabling constraint,sequence),
Β (sequence),
, Β (timetabling constraint),
- Keywords
characteristic of a constraint: automaton, automaton with counters, automaton with same input symbol.
combinatorial object: sequence.
constraint arguments: reverse of a constraint, pure functional dependency.
constraint network structure: alpha-acyclic constraint network(2), alpha-acyclic constraint network(3).
constraint type: timetabling constraint.
final graph structure: connected component, vpartition, consecutive loops are connected.
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
-
- Graph property(ies)
-
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
-
- Graph property(ies)
-
- Graph model
We use two graph constraints for modelling the constraint: a first one for specifying the constraints on , , and , and a second one for stating the constraints on and . In order to generate the initial graph related to the first graph constraint we use:
The arc generators and ,
The binary constraint .
On the first graph constraint of the Example slot this produces an initial graph depicted in partΒ (A) of FigureΒ 5.172.2. We use and the binary constraint in order to catch the two following situations:
A binary constraint has to be used in order to get the notion of group: Consecutive variables that take their value in .
If we only use then we would lose the groups that are composed from a single variable since the predecessor and the successor arc would be destroyed; this is why we use also the arc generator.
PartΒ (B) of FigureΒ 5.172.2 shows the final graph associated with the first graph constraint of the Example slot. Since we use the graph property, the vertices of the final graph are stressed in bold. In addition, since we use the and the graph properties, we also show the smallest and largest connected components of the final graph.
Figure 5.172.2. Initial and final graph of the constraint
(a) (b) The constraint of the Example slot holds since:
The final graph of the first graph constraint has two connected components. Therefore the number of groups is equal to two.
The number of vertices of the smallest connected component of the final graph of the first graph constraint is equal to 1. Therefore is equal to 1.
The number of vertices of the largest connected component of the final graph of the first graph constraint is equal to 2. Therefore is equal to 2.
The number of vertices of the smallest connected component of the final graph of the second graph constraint is equal to 2. Therefore is equal to 2.
The number of vertices of the largest connected component of the final graph of the second graph constraint is equal to 4. Therefore is equal to 4.
The number of vertices of the final graph of the first graph constraint is equal to three. Therefore is equal to 3.
- Automaton
FiguresΒ 5.172.3,Β 5.172.5,Β 5.172.8,Β 5.172.10,Β 5.172.12 andΒ 5.172.14 depict the different automata associated with the constraint. For the automata that respectively compute , , , , and we have a 0-1 signature variable for each variable of the collection . The following signature constraint links and : .
Figure 5.172.3. Automaton for the argument of the constraint and its glue matrix
Figure 5.172.4. Hypergraph of the reformulation corresponding to the automaton (with one counter) of the argument of the constraint (since all states of the automaton are accepting there is no restriction on the last variable )
Figure 5.172.5. Automaton for the argument of the constraint and its glue matrix
Figure 5.172.6. Illustrating the use of the state pair of the glue matrix for linking with the counters variables obtained after reading the prefix and corresponding suffix of the sequence ; note that the suffix (in pink) is proceed in reverse order; the left (resp.Β right) table shows the initialisation (for ) and the evolution (for ) of the state of the automaton and its counters and upon reading the prefix (resp.Β the reverse suffix ).
Figure 5.172.7. Hypergraph of the reformulation corresponding to the automaton (with two counters) of the argument of the constraint where stands for (since all states of the automaton are accepting there is no restriction on the last variable )
Figure 5.172.8. Automaton for the argument of the constraint and its glue matrix
Figure 5.172.9. Hypergraph of the reformulation corresponding to the automaton (with two counters) of the argument of the constraint
Figure 5.172.10. Automaton for the argument of the constraint and its glue matrix
Figure 5.172.11. Hypergraph of the reformulation corresponding to the automaton (with two counters) of the argument of the constraint where stands for (since all states of the automaton are accepting there is no restriction on the last variable )
Figure 5.172.12. Automaton for the argument of the constraint and its glue matrix
Figure 5.172.13. Hypergraph of the reformulation corresponding to the automaton (with two counters) of the argument of the constraint
Figure 5.172.14. Automaton for the argument of the constraint and its glue matrix
Figure 5.172.15. Hypergraph of the reformulation corresponding to the automaton (with one counter) of the argument of the constraint