[gecode-users] How to stop a branching?
Martin Mann
mmann at informatik.uni-freiburg.de
Fri May 29 14:04:24 CEST 2009
Hi,
I would like to know, if it is possible to stop a branching (when
multiple ones are present). Thus, to ignore all remaining branches for
this specific one.
Maybe an example to make my question clear.
I have two sets of variables X_1, X_2 linked via several constraints.
Within my Space I post two brachning B_1(X_1) and B_2(X_2) such that
first all variables of X_1 are assigned before B_2 is considered.
My final goal is to enumerate solutions with different X_1 assignments!
My current solution (was implemented for Gecode 1.3.* and I am going to
reimplement in 3.*) is to formulate a COP instead of a CSP and to
implement the *constrain* function and to post a constraint that ensures
that the next solution is at least in one X_1 assignment different from
the current solution.
Thus, I get a new constraint per solution ... and I dont like that! ;)
But when looking at the problem, it would be sufficient to stop the
branching on X_2! I dont need to post new constraints but to cancel the
remaining branching of B_2 on X_2. This will lead to a backtracking in
B_1 and therefore ensures that the next solution differs in the X_1
assignment in at least one solution...
This seems to be much more efficient to me. Btw. I would end up with a
CSP instead of this strange COP hack.
So my question: Is it possible to stop the remaining branching on B_2
out of the (Gecode 3.*) box? Or do I have to implement/subclass my own
branching?
Thanks for your help,
Martin
--
Martin Mann, Dipl. Bioinf.
Bioinformatics - Inst. of Computer Science
Albert-Ludwigs-University Freiburg
Tel: ++49-761-203-8259
Fax: ++49-761-203-7462
http://www.bioinf.uni-freiburg.de/~mmann/
More information about the gecode-users
mailing list