[gecode-users] How to construct constraints which count distinct values?

Jeffrey jeffreym9 at yahoo.com.hk
Thu Jan 8 16:28:58 CET 2009


I'm trying to assign n number of students into 3 groups.
each student is teach by a certain instructor.

I'd like to evenly distributed the students into the groups (assume the total no. of student is divisible by the 3 groups.)
Given an array where the 1st element holds the instructor (in enum) of the 1st student and so on...

How should I model the constratint to enforce that:
     for each group, the total no. of distinct instructors are the same.

?? Big Big thanks!



      Yahoo!香港提供網上安全攻略,教你如何防範黑客! 請前往 http://hk.promo.yahoo.com/security/ 了解更多!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20090108/7236bed4/attachment.htm>


More information about the gecode-users mailing list