5.201. inverse_set
DESCRIPTION | LINKS | GRAPH |
- Origin
- Constraint
- Arguments
- Restrictions
- Purpose
The following two statements are equivalent:
Value belongs to the set variable of the item of the collection.
Value belongs to the set variable of the item of the collection.
I.e.,Β .
- Example
-
The constraint holds since:
- Typical
- Symmetries
Arguments are permutable w.r.t. permutation .
Items of are permutable.
Items of are permutable.
- Usage
The constraint can for instance be used in order to model problems where one has to place items on a rectangular board in such a way that a column or a row can have more than one item. We have one set variable for each row of the board; Its values are the column indexes corresponding to the positions where an item is placed. Similarly we have also one set variable for each column of the board; Its values are the row indexes corresponding to the positions where an item is placed. The constraint maintains the link between the rows and the columns variables. FigureΒ 5.201.1 shows the board that can be associated with the example of the Example slot.
Figure 5.201.1. Illustration of the Example slot where we highlight in red the second item of the collection and the fourth item of the collection showing the relation between and , where (with ) and (with ) respectively stands for the set attribute of the item of the collection and of the item of the collection (A)Β Collections and passed to the constraint, (B)Β Corresponding board, (C)Β Conditions linking the items of and the items of .
- Systems
inverseSet in Choco, inverse_set in MiniZinc.
- See also
common keyword: Β (channelling constraint).
specialisation: Β ( replaced by ).
- Keywords
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
- Graph property(ies)
-
- Graph model
PartsΒ (A) andΒ (B) of FigureΒ 5.201.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.201.2. Initial and final graph of the constraint
(a) (b)