[gecode-users] Reified Constraints do not propagate

Max Ostrowski ostrowsk at cs.uni-potsdam.de
Tue Apr 10 12:41:48 CEST 2012


Thank you very much for the insight.
Unfortunately this could be a problem,
as i have to change my data structures.

Will this be fixed in future versions?

Best,
Max

On 04/10/2012 12:32 PM, Guido Tack wrote:
> This is a current shortcoming of the minimodel library.  For some
> linear constraints (such as x==5 in this case) the IntConLevel is
> ignored.  To get the full propagation, you have to post the constraint
> directly, like this:
>
> Gecode::rel(*test, test->x_[1], IRT_EQ, 5, test->b_[1], ICL_DOM);
>
> Cheers,
> Guido
>
> On 10 Apr 2012, at 19:20, Max Ostrowski wrote:
>
>> I have a small example where i do not understand why no propagation
>> takes place.
>>
>> test is a pointer to the space instance
>> x_ is an array of 10 IntVars(0,10)
>> b_ is an array of 2 BoolVars(0,1)
>>
>>
>>     LinRel rel1(test->x_[0],IRT_EQ,5);
>>     rel1.post(*test,true,ICL_DEF);
>>
>>     Gecode::distinct(*test,test->x_,ICL_DEF);
>>
>>     LinRel rel2(test->x_[1],IRT_EQ,5);
>>     Gecode::rel(*test, rel2 == test->b_[1],ICL_DEF);
>>
>>     test->status();
>>     if (test->failed())
>>         std::cout << "Failed" << std::endl;
>>     std::cout << test->x_ << std::endl;
>>     std::cout << test->b_ << std::endl;
>>
>>
>> So i post das one of my elements x_[0] is 5, and all elements are
>> distinct.
>> Now i have a reified constraint that x_[1] == 5.
>> The distinct constraint removes 5 from he domain of x_[1],
>>  but the propagator does not fire.
>> The result is:
>> {5, {0..4,6..10}, {0..4,6..10}, {0..4,6..10}, {0..4,6..10},
>> {0..4,6..10}, {0..4,6..10}, {0..4,6..10}, {0..4,6..10}, {0..4,6..10}}
>> {[0..1], [0..1]}
>>
>> Even with ICL_DOM the boolean variable is not touched if values are
>> removed from the domain.
>> Also i think this could be easily done with "Advisors" ?
>> I have no experience with this, so my question:
>> Is this behavior the desired one?
>> Can this be changed if i have reifications like mine where i compare
>> to constants?
>>
>> Thanks a lot,
>>
>> Max
>> _______________________________________________
>> Gecode users mailing list
>> users at gecode.org <mailto:users at gecode.org>
>> https://www.gecode.org/mailman/listinfo/gecode-users
>
> -- 
> Guido Tack,
> http://www.csse.monash.edu/~guidot/
> <http://www.csse.monash.edu/%7Eguidot/>
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20120410/7c6ce2f7/attachment.htm>


More information about the users mailing list