Juan Carlos wrote: > In order to find the best solution of a problem that I'm working > on, I have to branch over an IntVarArray , so I have created a > custom branch with an heuristic. (like in the black hole or queens > example). And use the BAB engine. > > This branching works fine, but it could be improved if the vars > that should be unassingned after a basic solution is found are > selected in a different way. I mean like a custom backtrack with a > function that selects the best var to be reassigned.
Backtracking in Gecode is based on copying and recomputation, and therefore does not "unassign" any variables. When you backtrack, you restore a previous state in the search tree (for example that of the parent of the current search node), and then commit to another of its remaining alternatives. The only way to determine where search proceeds is therefore in the branching. Maybe, if you explain in a little more detail how you would like the search to behave, we can help you cast that idea into your custom branching. Cheers, Guido _______________________________________________ Gecode users mailing list [EMAIL PROTECTED] https://www.gecode.org/mailman/listinfo/gecode-users