[gecode-users] Capacity constraints

Malcolm Ryan malcolmr at cse.unsw.edu.au
Mon Mar 17 07:35:18 CET 2008


I discovered the answer to my own question: I wasn't using a strong  
enough consistency. The default for distinct() is ICL_VAL. Setting it  
to ICL_BND did the trick.

Malcolm

On 17/03/2008, at 5:31 PM, Malcolm Ryan wrote:

> On a related question, does the distinct() constraint take into  
> account the number of variables?
>
> If I have three IntVars {X1, X2, X3} on a domain of two values {0,1}  
> then to my mind the constraint distinct({X1, X2, X3}) should cause  
> propagation failure immediately. In my present code this does not  
> seem to be the case. Am I missing something?
>
> Malcolm
>
> On 17/03/2008, at 2:57 PM, Christian Schulte wrote:
>
>> Please check cardinality constraints "count" (global cardinality).  
>> A single
>> propagator will do what you want.
>>
>> Cheers
>> Christian
>>
>> --
>> Christian Schulte, www.ict.kth.se/~cschulte/
>>
>>
>> -----Original Message-----
>> From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On  
>> Behalf
>> Of Malcolm Ryan
>> Sent: Monday, March 17, 2008 4:27 AM
>> To: gecode list
>> Subject: [gecode-users] Capacity constraints
>>
>> A simple problem: I have n variables X1, ... Xn which can take on any
>> of m values [1, ..., m]. For each value i there is a fixed capacity
>> Ci, such that no more than Ci of the X's can take value i.
>>
>> What is the best way to express this as a set of constraints?
>>
>> Malcolm
>>
>> _______________________________________________
>> Gecode users mailing list
>> users at gecode.org
>> https://www.gecode.org/mailman/listinfo/gecode-users
>





More information about the gecode-users mailing list