[gecode-users] propagator PropCond

Guido Tack tack at ps.uni-sb.de
Mon May 15 22:29:52 CEST 2006


> But I m a bit confused. My internal propagation functions
> "removeNonNeighbors" returns the ModEvents
>
> - ME_GEN_FAILED (caught by the macro Gecode_ME_CHECK)
> - ME_GEN_ASSIGNED (if both variables are assigned and fullfill my
> constraint)
> - ME_GEN_NONE (if nothing changed via propagation
> - ME_GEN_DOM (if on of the domain is changed)
>
> in the case of ME_GEN_ASSIGNED the propagator is done and dont have to
> be recalled in this branch... ES_SUBSUMED should be the right return
> choice isnt it? or is ES_FIX my choice and a solution corresponds with a
> fixpoint at that point?

You have to return ES_SUBSUMED at the latest when all your variables are
assigned - otherwise the propagator will not be destroyed, resulting in a
space leak. You can return it earlier, when you detect that your
propagator doesn't have to be called again. For instance, in a propagator
for x<y, you can return ES_SUBSUMED once the maximum of x is smaller than
the minimum of y, even if neither is yet assigned.

> in the two remaining cases something else should be thrown but I m not
> sure what! ES_OK? ES_NOFIX???

>From propagate, you should only return ES_FAILED, ES_SUBSUMED, ES_FIX, or
ES_NOFIX (and special versions of the latter two for staged propagation,
which you can ignore for now). Whether to return FIX or NOFIX depends on
whether you know that your propagator has reached a fixpoint. If unsure,
return NOFIX. This may result in your propagator being called too often
(which may be less efficient but correct). Returning FIX although you're
not at a fixpoint can result in the propagator being called not often
enough, and you might miss a failure: dangerous!

Cheers,
   Guido

-- 
Guido Tack
http://www.ps.uni-sb.de/~tack






More information about the gecode-users mailing list