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

Christian Schulte cschulte at kth.se
Thu Jan 8 17:58:09 CET 2009


Dear Jeffrey,

 

That smells too much of homework to warrant an answer.

 

Christian

 

From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf Of Jeffrey
Sent: Thursday, January 08, 2009 4:29 PM
To: gecode at gecode.org
Subject: [gecode-users] How to construct constraints which count distinct values?

 

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/780e0f90/attachment.htm>


More information about the gecode-users mailing list