Originally posted by: SystemAdmin
Hi all,
I am trying to solve a problem with a similar procedure as the one you used in BendersATSP.java. In my code, I am using the following commands to define the callback:
...
model.use(new PathLazyConsCallback(cplex, z, u));
...
public static class PathLazyConsCallback extends IloCplex.LazyConstraintCallback {
...
System.out.println(pathConstraint);
add(pathConstraint);
}
I am also using:
cplex.setParam(IloCplex.BooleanParam.PreInd, false);
cplex.setParam(IloCplex.IntParam.Threads, 1);
cplex.setParam(IloCplex.IntParam.MIPSearch, IloCplex.MIPSearch.Traditional);
cplex.setParam(IloCplex.IntParam.Reduce, 0);
Basically, PathLazyConsCallback triggers a sequence of shortest path problems (SPP), it finds several cuts and then, it add those to the model as lazy constraints. So far, I have performed several tests and it seems to be adding the cuts.
I have the following problem, though:
I am solving an instance with an integer optimal solution = 105 (I know this because I also solved it using a different formulation). What is happening is that CLPEX finds an integer solution at the root of the B&B tree with an objective value of 40. I am guessing that it is possible, since at the beginning of the B&B tree the PathLazyConsCallback procedure hasn't been called, so none of the lazy constraints has being included. It is giving me the following output:
Nodes Cuts/
Node Left Objective IInf Best Integer Best Node ItCnt Gap Variable B NodeID Parent Depth
0 0 0.0000 40 40.0000 0.0000 27 100.00%
After this, it triggers the callback, solves the SPP, finds the cuts and it adds the cuts. The output that I get is something like this:
Cut test:
cut found:
1, 19, 3 IloRange : -2.0 <= 1.0*u1,3 - 1.0*z1 - 1.0*z19 - 1.0*z3 <= infinity
cut found:
1, 14, 4 IloRange : -2.0 <= 1.0*u1,4 - 1.0*z1 - 1.0*z14 - 1.0*z4 <= infinity
cut found:
1, 6, 7 IloRange : -2.0 <= 1.0*u1,7 - 1.0*z1 - 1.0*z6 - 1.0*z7 <= infinity
So far so good. The problem is that I think CPLEX is keeping 40.000 as the best integer solution, even though it is infeasible. Therefore, it is cutting all the other branches by bound if the solutions of those have an objective larger that 40 (most of those branches have larger solutions as their feasible sets are smaller due to the lazy constraints), and hence it is returning a final solution that is not feasible.
I would like to know if you have any ideas that could help
Thanks a lot
Cheers
--Jose.
#CPLEXOptimizers#DecisionOptimization