5.412. used_by
DESCRIPTION | LINKS | GRAPH | AUTOMATON |
- Origin
N.Β Beldiceanu
- Constraint
- Arguments
- Restrictions
- Purpose
All the values of the variables of collection are used by the variables of collection .
- Example
-
The constraint holds since, for each value occurring within the collection , its number of occurrences within is greater than or equal to its number of occurrences within :
Value 1 occurs 3 times within and 2 times within .
Value 2 occurs 1 times within and 1 times within .
Value 5 occurs 1 times within and 1 times within .
- All solutions
FigureΒ 5.412.1 gives all solutions to the following non ground instance of the constraint: , , , , , .
Figure 5.412.1. All solutions corresponding to the non ground example of the constraint of the All solutions slot where identical values are coloured in the same way in both collections
- Typical
- Symmetries
Items of are permutable.
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.
- Arg. properties
Contractible wrt. .
Extensible wrt. .
Aggregate: , .
- Algorithm
As described inΒ [BeldiceanuKatrielThiel04a] we can pad with dummy variables such that its cardinality will be equal to that cardinality of . The domain of a dummy variable contains all of the values. Then, we have a constraint between the two sets. Direct arc-consistency and bound-consistency algorithms based on a flow model are also proposed inΒ [BeldiceanuKatrielThiel04a], [BeldiceanuKatrielThiel05], [Katriel05]. The leftmost part of FigureΒ 3.7.30 illustrates this flow model.
More recentlyΒ [Cymer12], [CymerPhD13] presents a second filtering algorithm also achieving arc-consistency based on a mapping of the solutions to the constraint to var-perfect matchingsA var-perfect matching is a maximum matching covering all vertices corresponding to the variables of . in a bipartite intersection graph derived from the domain of the variables of the constraint in the following way. To each variable of the and collection corresponds a vertex of the intersection graph. There is an edge between a vertex associated with a variable of the collection and a vertex associated with a variable of the collection if and only if the corresponding variables have at least one value in common in their domains.
- Reformulation
The constraint can be expressed in term of a conjunction of reified constraints of the form:
Β Β Β .
- Used in
- See also
generalisation: Β ( replaced by ), Β ( replaced by ), Β ( replaced by ).
implies: .
- Keywords
characteristic of a constraint: sort based reformulation, automaton, automaton with array of counters.
combinatorial object: multiset.
constraint arguments: constraint between two collections of variables.
filtering: flow, bipartite matching, arc-consistency, bound-consistency, DFS-bottleneck.
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
- Graph property(ies)
-
- Graph model
PartsΒ (A) andΒ (B) of FigureΒ 5.412.2 respectively show the initial and final graph associated with the Example slot. Since we use the and graph properties, the source and sink vertices of the final graph are stressed with a double circle. Since there is a constraint on each connected component of the final graph we also show the different connected components. Each of them corresponds to an equivalence class according to the arc constraint. Note that the vertex corresponding to the variable assigned to value 9 was removed from the final graph since there is no arc for which the associated equality constraint holds. The constraint holds since:
For each connected component of the final graph the number of sources is greater than or equal to the number of sinks.
The number of sinks of the final graph is equal to .
Figure 5.412.2. Initial and final graph of the constraint
(a) (b) - Signature
Since the initial graph contains only sources and sinks, and since sources of the initial graph cannot become sinks of the final graph, we have that the maximum number of sinks of the final graph is equal to . Therefore we can rewrite to and simplify to .
- Automaton
FigureΒ 5.412.3 depicts the automaton associated with the constraint. To each item of the collection corresponds a signature variable that is equal to 0. To each item of the collection corresponds a signature variable that is equal to 1.
Figure 5.412.3. Automaton of the constraint