[gecode-users] Executing code between branchers - the right way to go?

Conrad.Drescher at cs.ox.ac.uk Conrad.Drescher at cs.ox.ac.uk
Tue Feb 12 10:24:52 CET 2013


Hello there,

I'd greatly appreciate feedback on what the Gecode-way of attacking the
following two issues is:

1) My model features set variables. I have a custom brancher that uses a
heuristics to include certain elements in pairs of set variables sets[i]
and sets[i+1]. Before moving on to the next pair of variables I'd like to
fix sets[i] and sets[i+1] to the elements in the glb, e.g. by posting an
additional constraint that the cardinality of sets[i] is
sets[i].cardMin().

>From MPG 7.1.7 "Executing code between branchers" I cannot figure out how
to pass the index i to the more()-function, so some help on that would be
great. Or should I go for an assignment-brancher for set variables? Yet
something else?

2) Once I have assigned sets[i] and sets[i+1] I'd like to store the pair
as a no-good combination not to be tried again for any consecutive pair of
set variables. Actually it's a bit more complicated, as for the nogood I
also need to consider certain values not in sets[i] and sets[i+1]. I only
want to check for no-goods once I have assigned another pair of set
variables. Would you recommend going for a hash of no-goods? And could
this be maintained in a way similar to what is sketched in MPG 7.1.7? 
Alternatively, I could post a constraint that excludes the no-good and use
a custom propagator to ensure this is only checked once the respective
variables are assigned.

Thanks for reading; any input is much appreciated!

Cheers,
Conrad




More information about the users mailing list