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

sequence(+Low, +High, +K, +Vars, ++Values)

The number of values taken from Values is between Low and High for all sequences of K variables in Vars.
Non-negative integer
Positive integer
Postive integer
A list of variables or integers
A list of (different) integers


This constraint ensures that the number of values taken from the set specified in Values is at least Low and at most High for all sequences of K consecutive variables/values in Vars.

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 among_seq in the global constraint catalog. The algorithm implemented is described in M. Maher et al.'s paper 'Flow-Based Propagators for the SEQUENCE and Related Global Constraints' in CP'2008.

See Also

sequence / 5, fd : element / 3, fd_global : sequence_total / 6, fd_global : sequence_total / 7