[gecode-users] Strange behavior of BAB search with the function CONSTRAIN

Raffaele Cipriano cipriano at dimi.uniud.it
Fri Apr 18 09:08:35 CEST 2008


Dear Gecode developers,
we are using the BAB search with the function "constrain", to implement 
a cutting-plane search algorithm, and we have noticed a strange behavior.

At some point of the search we need to add a constrain on the Space we 
are exploring and we use the function

void constrain( T* t )

The constrain is correctly posted and some solutions are cut off, but 
when the BAB engine backtracks it looses the constrain added and finds 
solutions that should be cut off.

We have isolated this behavior in a small example: the source code 
(MyTest.cc) and the execution output (log.log) are attached. Here it is 
a brief explanation:

In the example there is only an IntVarArray x, of length 3 and domain 0..2.
We perform a branch on x, looking for all the solution.
When the fifth solution has been discovered we post the constrain x[1] = 1.
The constrain is posted, in fact solution {0, 2, 0}, {0, 2, 1}, {0,2, 2} 
are not enumerated.
But when the engine backtracks to the x[0] level, the constraint is lost 
and all the possible remaining solutions are found: according to the 
constrain posted, solution 7 to 9, 13 to 18 and 22 to 24 should be cut-off.

Is this a normal behavior or a bug?

Is there any alternative way to add constraints at run time?

Thank you very much

Best regards

Raffaele Cipriano

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: myTest.cc
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20080418/908d58be/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: log.log
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20080418/908d58be/attachment.asc>


More information about the gecode-users mailing list