5.17. among_diff_0
| DESCRIPTION | LINKS | GRAPH | AUTOMATON |
- Origin
- Constraint
- Arguments
- Restrictions
- Purpose
is the number of variables of the collection that take a value different from 0.
- Example
-
The constraint holds since exactly 3 values of the collection of values are different from 0.
- Typical
- Symmetries
Items of are permutable.
An occurrence of a value of that is different from 0 can be replaced by any other value that is also different from 0.
- See also
common keyword: Β (counting constraint).
generalisation: Β ( replaced by ).
- Keywords
characteristic of a constraint: joker value, 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
Since this is a unary constraint we employ the arc generator in order to produce an initial graph with a single loop on each vertex.
PartsΒ (A) andΒ (B) of FigureΒ 5.17.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.17.1. Initial and final graph of the constraint


(a) (b)
- Automaton
FigureΒ 5.17.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 : . The automaton counts the number of variables of the collection that take a value different from 0 and finally assigns this number to .
Figure 5.17.2. Automaton of the constraint

Figure 5.17.3. Hypergraph of the reformulation corresponding to the automaton of the constraint
