5.219. nclass
| DESCRIPTION | LINKS | GRAPH |
- Origin
Derived from nvalue.
- Constraint
nclass(NCLASS,VARIABLES,PARTITIONS)
- Type(s)
-
VALUES collection(val−int) - Argument(s)
-
NCLASS dvar VARIABLES collection(var−dvar) PARTITIONS collection(p−VALUES) - Restriction(s)
-
|VALUES|≥1 required(VALUES,val) distinct(VALUES,val) NCLASS≥0 NCLASS≤min(|VARIABLES|,|PARTITIONS|) required(VARIABLES,var) required(PARTITIONS,p) |PARTITIONS|≥2 - Purpose
Number of partitions of the collection PARTITIONS such that at least one value is assigned to at least one variable of the collection VARIABLES.
- Example
-
(
)2,〈3,2,7,2,6〉, 〈
〉p−〈1,3〉, p−〈4〉, p−〈2,6〉 Observe that the values of 〈3,2,7,2,6〉 occur within partitions p−〈1,3〉 and p−〈2,6〉 but not within p−〈4〉. Consequently, the nclass constraint holds since its first argument NCLASS is set to value 2.
- Algorithm
- See also
- Key words
characteristic of a constraint: partition.
constraint type: counting constraint, value partitioning constraint.
final graph structure: strongly connected component, equivalence.
- Arc input(s)
VARIABLES
- Arc generator
-
CLIQUE↦collection(variables1,variables2) - Arc arity
-
2 - Arc constraint(s)
-
in_same_partition(variables1.var,variables2.var,PARTITIONS) - Graph property(ies)
-
NSCC=NCLASS
- Graph model
Parts (A) and (B) of Figure 5.219.1 respectively show the initial and final graph associated with the Example slot. Since we use the NSCC graph property we show the different strongly connected components of the final graph. Each strongly connected component corresponds to a class of values that was assigned to some variables of the VARIABLES collection. We effectively use two classes of values that respectively correspond to values {3} and {2,6}. Note that we do not consider value 7 since it does not belong to the different classes of values we gave: all corresponding arc constraints do not hold.
Figure 5.219.1. Initial and final graph of the nclass constraint


(a) (b)