[gecode-users] counting/sequence constraints failing when IntVarArray too small

Kish Shen kisshen at cisco.com
Tue Jun 30 20:05:43 CEST 2015


Hi,

My earlier post about min and argmin throwing an exception prompted me 
to remember a discussion I had with Joachim Schimpf some time ago about 
the semantics of the sequence constraint:

sequence(home, x, s, q, l, u)

if I remember correctly, he thought the constraint should not fail if 
the number of variables in x is smaller than q, but larger than l, and 
the number of values in x is between l and u. He actually was using the 
constraint on some problem instances that had this property.

I did not initially remember that the discussion was about sequence, so 
I first looked at the count constraint, and found a similar behaviour 
with the IRT_LQ and IRT_LE in

count(home, x, y, IRT_LQ, z)

the constraint fails if the size of x is smaller than than z, even 
though the relationship is actually true - the number of times the 
variables in x is y is less than z.

I had expected the constraint to succeed in this case, and the atmost 
constraint in ic does succeed in such cases (ic restrict z to be an 
integer for atmost). I can see that the count fails here because z is 
constrained to 0..|x|, for all relationships.

Does it make sense for these constraints to succeed in such cases when 
the relationship (number of times the value(s) occur) is satisfied, even 
though the number of variables is smaller than the limit/sequence 
length? I am uncertain for the sequence case, but for count, succeeding 
makes more sense to me.

If not succeeding, should an exception be raised instead of failing? 
This will alert the user to the fact that there are too few variables 
for the constraint, rather than the number of values not satisfying the 
requirements.

Should the behaviour be documented in the MPL? I don't think it is 
mentioned there at the moment.

Cheers,

Kish









More information about the users mailing list