5.39. atmost
DESCRIPTION | LINKS | GRAPH | AUTOMATON |
- Origin
CHIP
- Constraint
- Synonym
.
- Arguments
- Restrictions
- Purpose
At most variables of the collection are assigned value .
- Example
-
The constraint holds since at most 1 value of the collection is equal to value 2.
- All solutions
FigureΒ 5.39.1 gives all solutions to the following non ground instance of the constraint: , , , , .
Figure 5.39.1. All solutions corresponding to the non ground example of the constraint of the All solutions slot
- Typical
- Symmetries
Items of are permutable.
can be increased.
An occurrence of a value of can be replaced by any other value that is different from .
- Arg. properties
Contractible wrt. .
- Systems
occurenceMax in Choco, count in Gecode, atmost in Gecode, count in JaCoP, at_most in MiniZinc, count in SICStus.
- See also
common keyword: Β (value constraint).
generalisation: Β ( replaced by ).
implied by: Β ( 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
Since each arc constraint involves only one vertex ( is fixed), we employ the arc generator in order to produce a graph with a single loop on each vertex.
PartsΒ (A) andΒ (B) of FigureΒ 5.39.2 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.39.2. Initial and final graph of the constraint
(a) (b)
- Automaton
FigureΒ 5.39.3 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 are assigned value and finally checks that this number is less than or equal to .
Figure 5.39.3. Automaton of the constraint
Figure 5.39.4. 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