[gecode-users] Set propagators and modification event delta

Gustavo Gutierrez gustavo.ggutierrez at gmail.com
Wed Aug 20 19:26:16 CEST 2014


Hi Guido,


Thanks for the answer. Did you measured the impact of using modification events in the propagate method versus normal implementations of the propagators?  




What I mean by normal implementations is suppose you implement the pruning rules without taking into account what have changed since the last time. That will of course maintain the correctness but you will end up applying unnecessary operations. Are the two variants significantly different in the case of set variables?




I'm asking this because using modifications events lead to more involved code and is very easy to get it wrong. But on the other hand, is something I will keep doing for performance reasons. 




Regards,

Gustavo
—
Gustavo

On Wed, Aug 20, 2014 at 3:27 AM, Guido Tack <tack at gecode.org> wrote:

> Hi Gustavo,
> modification events are really sets of modifications, e.g. if you have only a lower bound modification the event is ME_SET_GLB, for only upper bound it's ME_SET_LUB, but if both have been modified you get ME_SET_BB.  
> You guessed correctly: The testSetEventLB function returns true if the argument event contains a lower bound modification (so it could be ME_SET_GLB, ME_SET_BB, ME_SET_CGLB or ME_SET_CBB).  The versions with multiple arguments test whether any of them contains a lower bound modification (the implementation computes the union of the events and then does the check).
> Cheers,
> Guido
> On 20 Aug 2014, at 12:33 am, Gustavo Gutierrez <gustavo.ggutierrez at gmail.com> wrote:
>> Dear all,
>> 
>> I am trying to write a propagator and I really would like to take advantage of the modification event information offered by the geocode kernel in the respective argument to the propagate method. To that end, I am looking at set propagators as an example. In concrete I am looking at the code of the intersection propagator in inter.hpp.
>> 
>> That implementation calls testSetEventLB defined in common.hpp. My question is concrete: does this function returns true when the modification event passed as parameter signals a modification of the lower bound?. My intuition from its definition and the internal functions it uses tell me so but I would like to corroborate it with you.
>> 
>> There are other testSetEvent* that take a different number of arguments (all of them being modification events). For example, testSetEventLB with two arguments. Does this one returns true if any of the two events imply modification to the lower bounds?
>> 
>> Best regards, 
>> -- 
>> Gustavo Gutierrez
>> _______________________________________________
>> Gecode users mailing list
>> users at gecode.org
>> https://www.gecode.org/mailman/listinfo/gecode-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20140820/e1020426/attachment.html>


More information about the users mailing list