5.244. max_nvalue
DESCRIPTION | LINKS | GRAPH | AUTOMATON |
- Origin
- Constraint
- Arguments
- Restrictions
- Purpose
is the maximum number of times that the same value is taken by the variables of the collection .
- Example
-
In the first example, values are respectively used times. So the maximum number of time that a same value occurs is 3. Consequently the corresponding constraint holds.
- Typical
- Symmetries
Items of are permutable.
All occurrences of two distinct values of can be swapped; all occurrences of a value of can be renamed to any unused value.
- Arg. properties
Functional dependency: determined by .
- Usage
This constraint may be used in order to replace a set of or constraints were one would have to generate explicitly one constraint for each potential value. Also useful for constraining the number of occurrences of the mostly used value without knowing this value in advance and without giving explicitly an upper limit on the number of occurrences of each value as it is done in the constraint.
- Reformulation
Assume that is not empty. Let and respectively denote the smallest and largest possible values that can be assigned to the variables of the collection. Let the variables respectively correspond to the number of occurrences of values within the variables of the collection. The constraint can be expressed as the conjunction of the following two constraints:
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β ,
- Counting
-
Length () 2 3 4 5 6 7 8 Solutions 9 64 625 7776 117649 2097152 43046721 Number of solutions for : domains
Length () 2 3 4 5 6 7 8 Total 9 64 625 7776 117649 2097152 43046721 Parameter value 1 6 24 120 720 5040 40320 362880 2 3 36 420 5400 78750 1305360 24449040 3 - 4 80 1500 29820 646800 15382080 4 - - 5 150 3780 96040 2577960 5 - - - 6 252 8232 258048 6 - - - - 7 392 16128 7 - - - - - 8 576 8 - - - - - - 9 Solution count for : domains
- See also
common keyword: Β (counting constraint), , Β (value constraint,counting constraint), , Β (counting constraint).
- Keywords
-
characteristic of a constraint: maximum, automaton, automaton with array of counters.
constraint arguments: pure functional dependency.
constraint type: value constraint, counting constraint.
final graph structure: equivalence.
modelling: maximum number of occurrences, functional dependency.
- Arc input(s)
- Arc generator
-
- Arc arity
- Arc constraint(s)
- Graph property(ies)
-
- Graph model
Because of the arc constraint, each strongly connected component of the final graph corresponds to a distinct value that is assigned to a subset of variables of the collection. Therefore the number of vertices of the largest strongly connected component is equal to the mostly used value.
PartsΒ (A) andΒ (B) of FigureΒ 5.244.1 respectively show the initial and final graph associated with the first example of the Example slot. Since we use the graph property, we show the largest strongly connected component of the final graph.
Figure 5.244.1. Initial and final graph of the constraint
(a) (b)
- Automaton
FigureΒ 5.244.2 depicts the automaton associated with the constraint. To each item of the collection corresponds a signature variable that is equal to 0.
Figure 5.244.2. Automaton of the constraint