5.219. nclass

DESCRIPTIONLINKSGRAPH
Origin

Derived from nvalue.

Constraint

nclass(NCLASS,VARIABLES,PARTITIONS)

Type(s)
VALUEScollection(valint)
Argument(s)
NCLASSdvar
VARIABLEScollection(vardvar)
PARTITIONScollection(pVALUES)
Restriction(s)
|VALUES|1
required(VALUES,val)
distinct(VALUES,val)
NCLASS0
NCLASSmin(|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,
p1,3,
p4,
p2,6
)

Observe that the values of 3,2,7,2,6 occur within partitions p1,3 and p2,6 but not within p4. Consequently, the nclass constraint holds since its first argument NCLASS is set to value 2.

Algorithm

[Beldiceanu01], [BeldiceanuCarlssonThiel02].

See also

nvalue, nequivalence, ninterval, npair, in_same_partition.

Key words

characteristic of a constraint: partition.

constraint type: counting constraint, value partitioning constraint.

final graph structure: strongly connected component, equivalence.

modelling: number of distinct equivalence classes.


Arc input(s)

VARIABLES

Arc generator
CLIQUEcollection(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

ctrs/nclassActrs/nclassB
(a) (b)