problem "optimal integer solution within mipgap or absmipgap" between CPLEX and Gurobi

1,263 views
Skip to first unread message

dfor...@gmail.com

unread,
Sep 22, 2017, 5:04:10 PM9/22/17
to AMPL Modeling Language
Hi,

I am just finished building a model with AMPL. However, when I ran a model with CPLEX, the result is as below :

CPLEX 12.7.1.0: optimal integer solution within mipgap or absmipgap; objective -4.672924058
35 MIP simplex iterations
0 branch-and-bound nodes
absmipgap = 9.23332e-05, relmipgap = 1.97592e-05

However, I couldn't remove them  - mipgap or absmipgap - And I also ran a model using Gurobi and it found the optimal solution without mipgap or absmipgap as below.

Gurobi 7.5.0: optimal solution; objective -4.672976411
38 simplex iterations
1 branch-and-cut nodes
plus 65 simplex iterations for intbasis


The optimal solution between two solvers are almost same but it has something like rounding problem with CPLEX. Could you let me know how to remove mipgap or absmipgap when I use CPLEX? Do I have to set something like options in my run file?  My model is mixed integer programming and it is really stressful whnever I got that kind of messages when I use CPLEX.

Please, let me know.
Thanks.

Robert Fourer

unread,
Sep 23, 2017, 8:13:44 PM9/23/17
to am...@googlegroups.com
Both CPLEX and Gurobi have a default "relative mipgap tolerance" of 1e-4 (0.0001). They stop when the "absolute mipgap" -- the difference between the current best bound and best integer solution -- is less than 1e-4 times the best bound. But as you have seen, CPLEX distinguishes the case of stopping with a gap that's positive (though within the tolerance) from the case of stopping with a gap of zero, while Gurobi reports "optimal solution" in both cases so long as the gap is within the tolerance.

Thus in your example, Gurobi may also be returning with a positive absmipgap and relmipgap -- but it's just not reporting them. To see the gap values for Gurobi, set

option gurobi_options 'bestbound=1';

To force the gap to 0 in the results, use the following settings:

option cplex_options 'mipgap 0';
option gurobi_options 'mipgap 0';

Bob Fourer
am...@googlegroups.com

=======

dfor...@gmail.com

unread,
Sep 25, 2017, 5:43:56 PM9/25/17
to AMPL Modeling Language
Thank you for your answer.
I tried to do that adding the statement as you mentioned as below : 

option cplex_options 'mipgap 0'; 
   option gurobi_options 'mipgap 0'; 

The CPLEX still shows the result as below. There are still absmipgap and relmipgap. Is there another way to remove absmipgap and relmipgap and get an optimal solution without absmipgap and relmipgap??


CPLEX 12.7.1.0: mipgap 0
CPLEX 12.7.1.0: optimal integer solution; objective -4.672976411
42 MIP simplex iterations
3 branch-and-bound nodes
absmipgap = 8.88178e-16, relmipgap = 1.90067e-16

Robert Fourer

unread,
Sep 27, 2017, 5:12:52 PM9/27/17
to am...@googlegroups.com
A very small mipgap value like 1.90067e-16 is due to rounding errors in the lowest bits of the objective function value and bound. You should treat this value the same as zero.
Reply all
Reply to author
Forward
0 new messages