5.405. tree_resource
DESCRIPTION | LINKS | GRAPH |
- Origin
- Constraint
- Arguments
- Restrictions
- Purpose
Cover a digraph in such a way that each vertex belongs to one distinct tree. Each tree is made up from one resource vertex and several task vertices. The resource vertices correspond to the roots of the different trees. For each resource a domain variable indicates how many task-vertices belong to the corresponding tree. For each task a domain variable gives the identifier of the resource that can handle the task.
- Example
-
The constraint holds since the graph associated with the items of the and the collections corresponds to 3 trees (i.e., ): each tree respectively involves the vertices , and . They are depicted by FigureΒ 5.405.1, where resource and task vertices are respectively coloured in blue and pink.
Figure 5.405.1. The three trees corresponding to the Example slot; each resource vertex (in blue) contains the information where is the number of tasks in the tree, while each task vertex (in pink) contains the information where is the index of its father in the tree and is the index of the corresponding root task in the tree.
- Typical
- Symmetries
Items of are permutable.
Items of are permutable.
- Reformulation
The constraint can be expressed in term of a conjunction of one constraint, constraints and one constraint:
The constraint expresses the fact that we have a well formed tree.
The constraint is used for expressing the link between the attribute of an item of the collection and its corresponding attribute.
The constraint is used to link the attribute of the items of the collection with the attribute of the items of the collection.
With respect to the Example slot we get the following conjunction of constraints:
Β Β Β Β Β Β Β Β Β Β Β Β
Β Β Β Β Β Β Β Β Β Β Β Β
Β Β Β Β Β Β Β Β Β Β Β Β
Β Β Β Β Β Β Β Β Β Β Β Β
Β Β Β Β Β Β Β Β Β Β Β Β
Β Β Β Β Β Β Β Β Β Β Β Β
Β Β Β Β Β Β Β Β Β Β Β Β ,
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β .
- See also
-
used in reformulation: , , .
- Keywords
characteristic of a constraint: derived collection.
constraint type: graph constraint, resource constraint, graph partitioning constraint.
- Derived Collection
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
-
- Graph property(ies)
-
For all items of :
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
-
- Graph property(ies)
-
- Graph model
For the second graph constraint, partΒ (A) of FigureΒ 5.405.2 shows the initial graphs associated with resources 1, 2 and 3 of the Example slot. For the second graph constraint, partΒ (B) of FigureΒ 5.405.2 shows the corresponding final graphs associated with resources 1, 2 and 3. Since we use the graph property, the vertices of the final graphs are stressed in bold. To each resource corresponds a tree of respectively 4, 0 and 1 task-vertices.
Figure 5.405.2. Initial and final graph of the constraint
(a) (b) - Signature
Since the initial graph of the first graph constraint contains vertices, the corresponding final graph cannot have more than vertices. Therefore we can rewrite the graph property to and simplify to .