[gecode-users] BAB Observation
hiller at employees.org
Wed Jul 31 15:53:17 CEST 2013
I was having a problem with finding all my solutions while using BAB.
I finally created a very simple model that demonstrated my problem
and using that model, I was able to find a solution to the problem.
I could not find this issue discussed anywhere, so I am going to
describe it here in case any one else runs into it and is looking
for a solution to it.
This is the scenario:
IntVarArray V(2, 0, 2);
rel(V == X);
rel(V == Y);
linear(C, X, V, IRT_EQ, Cost);
If I solve this with DFS, I get 6 solutions.
If I solve this with BAB and in the constrain function say
rel(cost > b.cost);
I only get 4 solutions.
Note: If I run with GIST and expand the nodes in the
correct order, I can cause BAB to display all 6 solutions,
but the normal search order does not find all of them.
To have BAB find all 6 solutions, I removed the above
two branch statements and replaced them with
So, the general rule I would conclude from this test is
that when using linear to create a cost function for
BAB, always branch on the output of the equation rather
than on the terms making up the equation.
I don't know if this holds true for other uses of linear.
More information about the users