[gecode-users] How to stop a branching?

Christian Schulte cschulte at kth.se
Fri May 29 14:11:39 CEST 2009


Right now, you can't stop branching. While just having an operation to do
that is easy, but I do not see yet how one would get that to work with
recomputation.

Did you see that you can actually post branching incrementally, maybe that
could help. Check "Executing code between branching" in MwG. You could
control whether a branching is posted or not by an additional variable. Just
an idea, don't know whether that would help.

Christian
	

-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Martin Mann
Sent: Friday, May 29, 2009 2:04 PM
To: gecode user list
Subject: [gecode-users] How to stop a branching?

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/


_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users





More information about the gecode-users mailing list