Hi there,
I am solving a MIP using GAMS/CPLEX, and using lazy constraint callbacks.
The instances are solved correctly, and I can verify that the objective function value from “MIP Solution” is correct (in the instance below, 354.333), and the variable levels are correct in the LST file. However, the objective function value in the LST is not correct (it matches “Final Solve” below. I believe this is because as a last step it re-solves the model without the lazy constraints.)
I would like to solve a large set of instances, and keep track of the objective function values shown by “MIP Solution” — is this stored in some way that I can retrieve/export? Thanks for your help!
-andreas
From the process log:
— Fixed MIP status (1): optimal.
— Cplex Time: 0.00sec (det. 0.02 ticks)
Proven optimal solution
MIP Solution: 354.333333 (2 iterations, 1 nodes)
Final Solve: 494.072000 (1 iterations)
Best possible: 354.333333
Absolute gap: -139.738667
Relative gap: -0.282831
I played a little with some small toy example and wasn’t able to reproduce this behaviour. Are you able to share your model with support@gams.com? Anything else special to the model other than the lazy constraints?
Thanks for your reply. I sent an email with the model. In terms of special aspects of the model - The model is an epigraph formulation (max z, subject to z <= Ax) and there are an exponential number of less-than-or-equal-to constraints (z <= A_i x_i) that are generated via lazy constraint callbacks. After CPLEX finds the optimal solution, it seems that CPLEX drops the lazy constraints for the “Final Solve.”
Hi, I had a look at the model and I can confirm your observation (using the latest GAMS). When I checked with a toy model, I used the lazy
dot option while you are using the userLazyConCall
. The latter adds lazy constraints using the CPLEX API call CPXXcallbackrejectcandidate
. In the corresponding documentation I don’t see anything about not adding those to the fixed model, however, they state
There is no guarantee that CPLEX will use the constraints that you specify. CPLEX will try to do so, but for technical reasons, it is not always possible to use the constraints. You can thus not assume that in subsequent callback invocations the candidate solutions satisfy the constraints you specified here.
(https://www.ibm.com/docs/en/icos/22.1.1?topic=c-cpxxcallbackrejectcandidate-cpxcallbackrejectcandidate)
This may give a hint, but I would need to ask IBM for more insights on this. I created a support request with them and will update you when I know more.
Do you actually need the fixed model to be solved? Otherwise you could simply add solvefinal 0
to your option file.