[Gecode] bug: bab-copy.cc : BAB search not traversing rightmost root subtree.

Grégoire Dooms dooms at info.ucl.ac.be
Mon Jun 13 18:02:07 CEST 2005


Hi,

I think I found a bug in BAB search: the righmost subtree of the root 
node is never traversed.
I attach a small code demonstrating the bug and a patch.
All the best,
--
Grégoire Dooms



-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_BAB.cc
Type: text/x-c++src
Size: 1274 bytes
Desc: not available
Url : http://www.ps.uni-sb.de/pipermail/gecode-users/attachments/20050613/b0927437/test_BAB-0002.cc
-------------- next part --------------
--- search/bab-copy.cc.old	2004-10-22 11:36:18.000000000 +0200
+++ search/bab-copy.cc	2005-06-13 17:18:51.000000000 +0200
@@ -64,8 +64,9 @@
 	}
 	// Get the next alternative and space from the stack.
 	if (ds.top().rightmost()) {
+	  int alt = ds.top().alt();
 	  cur = ds.pop().space();
-	  cur->commit(ds.top().alt(),NULL,propagate);
+	  cur->commit(alt,NULL,propagate);
 	  commit++;
 	  // Next space needs to be constrained?
 	  if (ds.entries()+1 <= mark) {


More information about the gecode-users mailing list