- Origin
Used for defining .
- Constraint
-
- Synonyms
,
.
- Arguments
| |
| |
- Restrictions
|
|
|
|
|
|
|
- Purpose
Each value
should be taken by at least and at most
variables of the collection.
- Example
-
The constraint holds
since values 3, 5 and 6 are respectively used 2 (),
0 () and 1 () times within the collection
and since no constraint was specified for value 8.
- Typical
|
|
|
|
|
|
|
|
- Symmetries
Items of are permutable.
An occurrence of a value of that does not belong to can be replaced by any other value that also does not belong to .
Items of are permutable.
can be decreased to any value .
can be increased to any value .
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. .
- Remark
Within the context of linear programmingΒ [Hooker07book] provides
relaxations of the constraint.
In MiniZinc
(http://www.minizinc.org/)
there is also a constraint where all variables
must be assigned a value from the attribute.
- Algorithm
A filtering algorithm achieving arc-consistency for
the constraint is given inΒ [Regin96].
This algorithm is based on a flow model of the constraint
where there is a one-to-one correspondence between feasible flows in the flow model
and solutions of the constraint.
The leftmost part of FigureΒ 3.7.29 illustrates this flow model.
The constraint is entailed
if and only if for each value equal to (with )
the following two conditions hold:
The number of variables of the collection assigned value is greater
than or equal to .
The number of variables of the collection that can potentially be assigned
value is less than or equal to .
- Reformulation
A reformulation of the , involving linear constraints,
preserving bound-consistency was introduced
inΒ [BessiereKatsirelosNarodytskaQuimperWalsh09IJCAI]. For each potential interval of consecutive values
this model uses 0-1 variables for modelling
the fact that each variable of the collection is assigned a value within interval
(i.e.,Β ),
as well as one domain variable for counting how many values of are assigned to variables of
(i.e.Β ).
The lower and upper bounds of variable are respectively initially set with respect to the minimum and maximum number of possible
occurrences of the values of interval .
Finally, assuming that is the smallest value that can be assigned to the variables of ,
the constraint is stated for each .
- Systems
globalCardinality in Choco,
global_cardinality_low_up in MiniZinc.
- Used in
.
- See also
common keyword:
Β (assignment,counting constraint).
generalisation:
Β ( replaced by ).
implied by:
Β (a constraint where the are increasing),
.
related:
Β (restrictions are done on nested sets of values, all starting from first value).
shift of concept:
Β (assignment of a to its position is ignored).
soft variant:
Β (a defines the set of variables that are actually considered).
specialisation:
Β (each value should occur at most once).
system of constraints:
Β (one constraint for each sliding sequence of consecutive ).
- Keywords
application area:
assignment.
constraint type:
value constraint,
counting constraint.
filtering:
flow,
arc-consistency,
bound-consistency,
DFS-bottleneck,
entailment.
- Cond. implications
Β Β Β withΒ
Β Β implies .
For all items of :