[gecode-users] Defining constraint to extract Element from an array of integer holding repeated values

Jeffrey Mak jmobile3-bigcom at yahoo.com.hk
Fri Jan 9 11:46:05 CET 2009


How to defining constraint to extract Element from an array of integer
holding repeated values?
Gecode provide ElementUnion function to extract elements from IntSet or
VarSet.
How about an integer array in which elements may hold the same values?

Below is a hypothesized problem that needs such capabilities:

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!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20090109/869d073b/attachment.htm>


More information about the gecode-users mailing list