5.91. count
DESCRIPTION | LINKS | GRAPH | AUTOMATON |
- Origin
- Constraint
- Synonyms
, , .
- Arguments
- Restrictions
- Purpose
Let be the number of variables of the collection assigned to value ; Enforce condition to hold.
- Example
-
The constraint holds since value occurs 3 times within the items of the collection , which is greater than or equal to ( is set to ) .
- Typical
- Symmetries
Items of are permutable.
An occurrence of a value of that is different from can be replaced by any other value that is also different from .
- Arg. properties
Contractible wrt. when .
Extensible wrt. when .
Aggregate: , , , when .
- Remark
Similar to the constraint. Both, in JaCoP (http://www.jacop.eu/) and in MiniZinc (http://www.minizinc.org/) is implicitly set to .
- Reformulation
The constraint can be expressed in term of the conjunction .
- Systems
occurence in Choco, count in Gecode, count in JaCoP, count in MiniZinc, count in SICStus.
- See also
assignment dimension added: Β (= replaced by and assignment dimension introduced).
common keyword: Β (value constraint,counting constraint), Β (value constraint), Β (counting constraint), , , Β (value constraint,counting constraint), Β (counting constraint).
generalisation: Β (= replaced by ).
related: .
- Keywords
characteristic of a constraint: automaton, automaton with counters.
constraint network structure: alpha-acyclic constraint network(2).
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
- Graph property(ies)
-
- Graph model
PartsΒ (A) andΒ (B) of FigureΒ 5.91.1 respectively show the initial and final graph associated with the Example slot. Since we use the graph property, the loops of the final graph are stressed in bold.
Figure 5.91.1. Initial and final graph of the constraint
(a) (b)
- Automaton
FigureΒ 5.91.2 depicts the automaton associated with the constraint. To each variable of the collection corresponds a 0-1 signature variable . The following signature constraint links and : .
Figure 5.91.2. Automaton of the constraint
Figure 5.91.3. Hypergraph of the reformulation corresponding to the automaton (with one counter) of the constraint: since all states variables are fixed to the unique state of the automaton, the transitions constraints share only the counter variable and the constraint network is Berge-acyclic