[gecode-users] Constrain the number of unique elements

Changbin Liu changbin.liu at gmail.com
Wed Jan 13 17:59:07 CET 2010


Hi, Folks:

   I am wondering whether there is a way to post a constraint on the number
of unique elements in a array, e.g

   I have an IntVarArray, and it may has some identical elements, say it
could be [1, 1, 2, 3, 4, 4], and the number of unique elements is 4, since
there are 2 "1"s and 2 "4" which are both redundant. If I want to constrain
that for a given IntVarArray, it number of unique element can not exceed
some value, how can I do that?   I checked "modelling with gecode", seems
there is "count" for constraining the number of appearance of elements.

Thanks

-- 
--------------------------------------------
Changbin Liu
Computer & Information Science Department
University of Pennsylvania
Philadelphia, PA
U.S.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20100113/c3b80729/attachment.htm>


More information about the users mailing list