[gecode-users] Adding constraints to model in <RBS>: is there any example code?

Dirk Obermann dirk.obermann67 at gmail.com
Tue Apr 11 13:34:00 CEST 2017


Hello -


I am trying to do program up a search engine that performs sequential
refinement by adding more and more constraints to a model. In the first
run, I am happy with a solution at all, but then I want to add increasingly
complex constraints until there is no more solution (or the search engine
times out).


Now, I first run a model with a single constraint. If DFS can find a
solution, then I run a completely new model with two constraints and from
scratch. If this model is feasible, then I run the model with three
constraints, etc.


In principle, this solution works, but it is a very inefficient: a lot of
time is spent generating the first feasible solution when restarting the
search (especially as the problem becomes more constrained).


It seems to me that this should be doable with RBS or a variation of the
LDS engine, as described in the MPG. But there are very few examples to
follow (the closest I found was this question posted on stack overflow
http://stackoverflow.com/questions/34182681/how-to-change-the-variable-value-ordering-in-gecodes-restart-based-search
but unfortunately it does not contain any answer). I simply cannot
understand how to do it right. In particular, where do I post additional
constraint on the model (in the master space, the slave space or
elsewhere)?


Any leads on how to do it, or links to code that adds constraints or
changes branching order in RBS would be appreciated!


Cheers,


Dirk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20170411/20ea486d/attachment.html>


More information about the users mailing list