5.375. stretch_circuit
DESCRIPTION | LINKS | GRAPH |
- Origin
- Constraint
- Usual name
- Arguments
- Restrictions
- Purpose
In order to define the meaning of the constraint, we first introduce the notions of stretch and span. Let be the number of variables of the collection and let , be two positions within the collection of variables such that the following conditions apply:
If then all variables take a same value from the set of values of the attribute.
If then all variables take a same value from the set of values of the attribute.
is different from .
is different from .
We call such a set of variables a stretch. The span of the stretch is equal to , while the value of the stretch is . We now define the condition enforced by the constraint.
Each item of the collection enforces the minimum value as well as the maximum value for the span of a stretch of value .
Note that:
Having an item with strictly greater than 0 does not mean that value should be assigned to one of the variables of collection . It rather means that, when value is used, all stretches of value must have a span that belong to interval .
A variable of the collection may be assigned a value that is not defined in the collection.
- Example
-
The constraint holds since the sequence contains three stretches , 3, and respectively verifying the following conditions:
The span of the first stretch is located within interval (i.e.,Β the limit associated with value 6).
The span of the second stretch 3 is located within interval (i.e.,Β the limit associated with value 3).
The span of the third stretch is located within interval (i.e.,Β the limit associated with value 1).
- Typical
- Symmetries
Items of can be shifted.
Items of are permutable.
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.
- Usage
The articleΒ [Pesant01], which originally introduced the constraint, quotes rostering problems as typical examples of use of this constraint.
- Remark
We split the origin constraint into the and the constraints that respectively use the and arc generators. We also reorganise the parameters: the collection describes the attributes of each value that can be assigned to the variables of the constraint. Finally we skipped the pattern constraint that tells what values can follow a given value.
- Algorithm
A first filtering algorithm was described in the original article of G.Β PesantΒ [Pesant01]. An algorithm that also generates explanations is given inΒ [RochartJussien03]. The first filtering algorithm achieving arc-consistency is depicted inΒ [Hellsten04], [HellstenPesantBeek04]. This algorithm is based on dynamic programming and handles the fact that some values can be followed by only a given subset of values.
- Reformulation
The constraint can be reformulated in term of a constraint. Let denote the maximum value taken by the attribute within the items of the collection , let be the number of variables of the collection , and let . The first and second arguments of the constraint are created in the following way:
We pass to the the variables of the collection to which we add the first variables of the collection .
We pass to the the values of the collection with the following modification: to each value for which the corresponding attribute is greater than or equal to we reset its value to .
Even if can achieve arc-consistency this reformulation may not achieve arc-consistency since it duplicates variables.
Using this reformulation, the example
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β
of the Example slot is reformulated as:
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β
In the reformulation was equal to 6, and the collection was left unchanged since no attribute was equal to the number of variables of the collection (i.e.,Β 8).
- See also
common keyword: Β (timetabling constraint),
Β (sliding sequence constraint,timetabling constraint),
Β (sliding sequence constraint), Β (sliding sequence constraint,timetabling constraint).
- Keywords
characteristic of a constraint: cyclic.
constraint type: timetabling constraint, sliding sequence constraint.
filtering: dynamic programming, arc-consistency, duplicated variables.
For all items of :
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
-
- Graph property(ies)
-
- Graph model
PartΒ (A) of FigureΒ 5.375.1 shows the initial graphs associated with values 1, 2, 3 and 6 of the Example slot. PartΒ (B) of FigureΒ 5.375.1 shows the corresponding final graphs associated with values 1, 3 and 6. Since value 2 is not assigned to any variable of the collection the final graph associated with value 2 is empty. The constraint holds since:
For value 1 we have one connected component for which the number of vertices is greater than or equal to 2 and less than or equal to 4,
For value 2 we do not have any connected component,
For value 3 we have one connected component for which the number of vertices is greater than or equal to 1 and less than or equal to 6,
For value 6 we have one connected component for which the number of vertices is greater than or equal to 2 and less than or equal to 4.
Figure 5.375.1. Initial and final graph of the constraint
(a) (b)