[ library(fd_global_gac) | Reference Manual | Alphabetic Index ]

# gcc(++Bounds, +Vars)

Constrain the cardinality of each Value specified in Bounds gcc(Low,High,Value) to be between Low and High in Vars

Bounds
  A list of elements of the form gcc(Low,High,Value), where Low, High and Value are integers, and High and Low are non-negative (High >= Low), and Value must be different from other Values
Vars
  A collection of different variables or integers

## Description

This constraint ensures that the cardinality (the number of occurrences) of values in Vars conforms to the specifications in Bounds. Bounds is a list of triples in the form gcc(Low,High,Value) where Value is an integer, a value that Vars is to be assigned to, and must occur only once as a Value in Bounds, and whose cardinality |Value| is specified by Low =< |Value| =< High, where Low and High are non-negative integers. Note that all values that Vars can take must be specified in Bounds.

This is currently a prototype -- the constraint has not been tested very extensively and little effort has been spent to optimise performance. We welcome any feedback on using this constraint.

This constraint is known as global_cardinality_low_up in the global constraint catalog. The algorithm implemented is described in J.-C. Regin's paper 'Generalized Arc Consistency for Global Cardinality Constraint', published in AAAI-1996.