[gecode-users] mod constraint branching
Guido Tack
tack at gecode.org
Sun May 15 18:28:04 CEST 2011
On 14 May 2011, at 21:39, Alin wrote:
> Hallo,
>
> I have been trying the mod constraint, but I encountered kind of a problem with
> the branching:
>
> [details about what I did]
> I have resources that can do a job only on a certain day
> so i set the time to be the same as the resource available that day
>
> mod(*this, resources[i], iDays, start_times[i]);
>
> [actual problem]
> my problem is that when doing the branching
> if I do:
>
> branch(*this, resources, INT_VAR_NONE, INT_VAL_RND);
>
> I get correct values for resources, but
>
> branch(*this, resources, INT_VAR_NONE, INT_VAL_MIN);
>
> will return incorrect values,
> for example: resource[i] will be set to 0,
> and start_times[i] will be 2
>
> while iDay is constant (7)
>
> why does this happen ?
> shouldn't branching determine just the order of the elements that are searched ?
> shouldn't the value be correct indifferent of the branching type ?
Yes, the branching just determines the order, and the solution should be correct. I couldn't easily reproduce the problem, but it sounds like a bug in the mod propagator (the VAL_MIN branching just exhibits the bug because it actually tries 0 for resource[i], whereas the random branching might not).
As I said, I can't reproduce this. Can you send me a short version of your code that exhibits this problem?
Cheers,
Guido
--
Guido Tack, http://people.cs.kuleuven.be/~guido.tack/
More information about the users
mailing list