Hi everyone,
I work in very complex MIP code in GAMS. I have almost 10000000 variable integer and binary. First, I try increase replim number. Now its 40000. I need to see Optimality gap value when GAMS is working. Is it possible ?
Thanks for all support and help.
The solver log shows the gap. Depending on the solver you find this in different places but I don’t know of a MIP solver that doesn’t show the gap. Here is the Cplex log:
Nodes Cuts/
Node Left Objective IInf Best Integer Best Bound ItCnt Gap
* 0+ 0 180825.6000 180157.6059 0.37%
Found incumbent of value 180825.600000 after 0.06 sec. (68.42 ticks)
0 0 180157.6059 5 180825.6000 180157.6059 94 0.37%
0 0 180180.1797 5 180825.6000 Cuts: 2 104 0.36%
0 0 180197.8700 5 180825.6000 Cuts: 2 111 0.35%
0 0 180204.2686 5 180825.6000 ZeroHalf: 1 120 0.34%
0 0 180205.6965 5 180825.6000 Cuts: 2 128 0.34%
0 0 180206.0604 5 180825.6000 MIRcuts: 1 132 0.34%
Detecting symmetries...
0 2 180206.0604 16 180825.6000 180206.0604 132 0.34%
Elapsed time = 0.06 sec. (71.70 ticks, tree = 0.01 MB, solutions = 4)
* 20 11 integral 0 180801.6000 180207.6472 222 0.33%
Found incumbent of value 180801.600000 after 0.06 sec. (72.44 ticks)
* 51 17 integral 0 180765.6000 180276.3000 355 0.27%
The gap is the last column as clear stated by the column header.
It is possible to get programmatic access to the gap (for some solvers). You ask the solver to produce a mip/solve trace (https://www.gams.com/latest/docs/UG_SolverUsage.html#ADVANCED_USAGE_SOLVETRACE) file that contains information about the progress of the solution run and in a different process you read this file (similar to tail -f).
-Michael