5.200. inverse_offset
DESCRIPTION | LINKS | GRAPH |
- Origin
Gecode
- Constraint
- Synonym
.
- Arguments
- Restrictions
- Purpose
Enforce each vertex of a digraph to have exactly one predecessor and one successor. In addition the following two statements are equivalent:
The successor of the node minus is equal to .
The predecessor of the node minus is equal to .
I.e.,Β .
- Example
-
The constraint holds since:
,
,
,
,
.
.
.
.
FigureΒ 5.200.1 shows the board that can be associated with this example.
Figure 5.200.1. Example slot where we highlight the fourth item in red showing the relation between and , where and (with ) respectively stands for the successor and predecessor attributes of the item of the collection (A)Β Collection of nodes passed to the constraint, (B)Β Corresponding board, (C)Β Conditions linking the successor and the predecessor attributes via the offsets and .
- Typical
- Symmetry
Items of are permutable.
- Arg. properties
Functional dependency: determined by , , and .
Functional dependency: determined by , , and .
- Remark
The constraint is called in Gecode (http://www.gecode.org/). Having two offsets was motivated by the fact that it is possible to declare arrays at any position in the MiniZinc modelling language.
- Systems
inverseChanneling in Choco, channel in Gecode.
- See also
specialisation: Β (assume that and are both equal to 0).
- Keywords
constraint arguments: pure functional dependency.
constraint type: graph constraint.
modelling: channelling constraint, dual model, functional dependency.
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
-
- Graph property(ies)
-
- Graph model
In order to express the binary constraint that links two vertices one has to make explicit the identifier of the vertices. This is why the constraint considers objects that have three attributes:
One fixed attribute that is the identifier of the vertex,
One variable attribute that is the successor of the vertex,
One variable attribute that is the predecessor of the vertex.
PartsΒ (A) andΒ (B) of FigureΒ 5.200.2 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.200.2. Initial and final graph of the constraint
(a) (b)