Originally posted by: Frops
Dear all,
I am implementing Lazy Constraints with callback ILOLAZYCONSTRAINTCALLBACKn, but I have problems because I obtain optimal solutions that do not fullfil some Lazy constraints.
In the callback definition, I search for a violated lazyconstraint and add it to the model.
I keep track of this cuts that are added. My guess would be that the last time that cplex enters the callback, it would not find any violated cut, so the feasible solution would be the optimal. But that is not happening, the last enter to the callback, I do find a violated cut, and add it, next step optimal solution is found.
I have checked and I think I am sure the cut found is violated fot the solution proposed.
I think to actually debug the code, it would be useful to have a way to extract the lazy constraints that are added to the model (something similar to cplex.exportModel()), which I have read it does not work with added cuts in the callback.
I checked this post: https://www.ibm.com/developerworks/community/forums/html/topic?id=11e0b4c4-0c98-4601-b4fd-4840114bdaab
To discard the thread-safe problem, I set cplex.setParam(IloCplex::Threads,1);, even I think my callback would be thread safe.
Is that enough?
Any other suggestions?
Thanks in advanced,
#CPLEXOptimizers#DecisionOptimization