GCC-Like Restrictions on the Same Constraint

The Same constraint takes two sets of variables X and Z such that |X|=|Z| and assigns values to them such that the multiset of values assigned to the variables in X is equal to the multiset of values assigned to the variables in Z. In this paper we extend the Same constraint in a GCC-like manner by adding cardinality requirements on the values. That is, for each value we have a lower and upper bound on the number of variables that can be assigned this value. We show an algorithm that achieves arc-consistency for this constraint and a faster algorithm that achieves bound-consistency for a restricted case of it.