Originally posted by: GiovanniP
Hello,
I want to share with you some difficulties I am experiencing while using LazyConstraints. Perhaps you can provide me some advice on what to look at.
Background.
I am implementing a Benders Decomposition (L-Shaped Method) for a two-stage stochastic program with integer first stage. Therefore I have a binary master problem and LP subproblems.
Particularly, I am implementing the multi-cut version. This means that my master problem is like that cTx+\sums p(s)*theta(s). Where s are scenarios. The optimality test returns true if theta(s)>=(objective of the second stage subproblem problem s). Otherwise we add an optimality cut. LazyConstraints callback are called at every integer node to check whether cuts should be added or not.
I am using the Java callable libraries. The problem I describe was much more severe with Cplex 12.5.1, and became somewhat milder with Cplex 12.6.2.
My problem.
Everything looks fine, but I am experiencing the following which I am not sure it is a problem, but I find it strange.
At some integer nodes I get the following:
-
Cplex enters the node, calls the lazyconstraints callback add cuts, reoptimize the node
-
Returns to the same integer node (the master problem having the same objective, and with the same identical solution).
The optimality test fails for a difference in the order of 1E-11. What I mean is theta(s) - obj(s) = -1E-11 or -1E-12, where obj(s) is the objective of the subproblem number s. See the picture attached for an idea of the difference.
-
Loops in the same node, as described above, for a certain number of iterations, sometimes in the order of dozens.
-
At some point it leaves the node and the algorithm proceeds regularly.
Eventually the algorithm converges, but it takes a lot of time to exit the loop I described. Now, this does not sound correct to me. Optimality cuts should cut off a solution, so it is not possible that the solver comes back again with the same one. However, the implementation of the optimality cuts is correct. My colleagues and I went through the code countless times and we could not find any flaw in the code.
My doubt is that this is a problem of numerical precision. So I post for you the following questions and I am really open for any advice.
1) Is it possible that the optimality test which fails for a difference of 1E-11 is actually satisfied? In other words, would you advice implementing an optimality test of type theta(s)+1E-11>=obj(s)?
2) Is it possible that the lazy constraints added are dumped for any reason, or are not enforced because of issues related to numerical precision?
I look forward to any suggestions. Thanks.
#CPLEXOptimizers#DecisionOptimization