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

same(+Vars1, +Vars2)

Vars1 and Vars2 are constrained to be a permutation of each other in the values taken by the variables.
Vars1
A collection of N different variables or integers
Vars2
A collection of N different variables or integers

Description

This constraint ensures that the values taken by the variables in Vars1 and Vars2 are permutations of each other. Vars1 and Vars must be the same length.

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 also known as same in the global constraint catalog. The implementation is the generalised arc-consistent version described in the catalog.