How to get the CPLEX MIP gap?

786 views Asked by At

I'm not sure if this is the best SE for my question, or rather the OR SE?

I'm solving an MIP (MLCLSP) with a Fix&Optimize heuristic in IBM ILOG CPLEX Optimization Studio and exporting my results to a CSV. This works fine for most of the data, e.g. the solution values of my variables, the objective value, solved time, etc. I only have issues with accessing the MIP relative gap.

var mipgap = cplex.getMIPRelativeGap();

This line results in CPLEX Error 1217: No solution exists., however, no indicator in the Engine Log what would cause that error. Also, when commenting that line out, everything else works fine. Unfortunately the relevant entry in the Reference Manual isn't very helpful (for me at least).

Any ideas why this might be and how to fix it?

The Engine log looks like this:

CPXPARAM_DetTimeLimit                            15000 Found incumbent of value 53030,000000 after 0,00 sec. (0,09 ticks) Tried aggregator 2 times. MIP Presolve eliminated 740 rows and 180 columns. Aggregator did 8 substitutions. Reduced MIP has 362 rows, 552 columns, and 1733 nonzeros. Reduced MIP has 0 binaries, 552 generals, 0 SOSs, and 0 indicators. Presolve time = 0,00 sec. (1,07 ticks) Tried aggregator 1 time. Reduced MIP has 362 rows, 552 columns, and 1733 nonzeros. Reduced MIP has 0 binaries, 552 generals, 0 SOSs, and 0 indicators. Presolve time = 0,00 sec. (0,82 ticks) MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic, using up to 4 threads. Root relaxation solution time = 0,00 sec. (0,93 ticks)

        Nodes                                         Cuts/    Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                        53030,0000    43750,0000            17,50%
*     0     0      integral     0    43750,0000    43750,0000       38    0,00% Elapsed time = 0,02 sec. (3,59 ticks, tree = 0,00 MB, solutions
= 2)

Root node processing (before b&c):   Real time             =    0,02 sec. (3,62 ticks) Parallel b&c, 4 threads:   Real time             =   0,00 sec. (0,00 ticks)   Sync time (average)   =    0,00 sec.   Wait time (average)   =    0,00 sec.
                          ------------ Total (root+branch&cut) =    0,02 sec. (3,62 ticks) CPXPARAM_DetTimeLimit                           15000 2 of 2 MIP starts provided solutions. MIP start 'm1' defined initial solution with objective 43750,0000. Tried aggregator 2 times. MIP Presolve eliminated 715 rows and 155 columns. Aggregator did 8 substitutions. Reduced MIP has 387 rows, 577 columns, and 1808 nonzeros. Reduced MIP has 25 binaries, 552 generals, 0 SOSs, and 0 indicators. Presolve time = 0,00 sec. (1,28 ticks) Probing time = 0,00 sec. (0,02 ticks) Tried aggregator 1 time. Reduced MIP has 387 rows, 577 columns, and 1808 nonzeros. Reduced MIP has 25 binaries, 552 generals, 0 SOSs, and 0 indicators. Presolve time = 0,02 sec. (0,91 ticks) Probing time = 0,00 sec. (0,02 ticks) MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic, using up to 4 threads.

Root node processing (before b&c):   Real time             =    0,02 sec. (3,86 ticks) Parallel b&c, 4 threads:   Real time             =   0,00 sec. (0,00 ticks)   Sync time (average)   =    0,00 sec.   Wait time (average)   =    0,00 sec.
                          ------------ Total (root+branch&cut) =    0,02 sec. (3,86 ticks) CPXPARAM_DetTimeLimit                           15000 1 of 3 MIP starts provided solutions. MIP start 'm1' defined initial solution with objective 37500,0000. Tried aggregator 2 times. MIP Presolve eliminated 768 rows and 236 columns. MIP Presolve added 6 rows and 0 columns. Aggregator did 6 substitutions. Reduced MIP has 342 rows, 498 columns, and 1562 nonzeros. Reduced MIP has 25 binaries, 473 generals, 0 SOSs, and 0 indicators. Presolve time = 0,00 sec. (1,41 ticks) Probing fixed 0 vars, tightened 3 bounds. Probing time = 0,00 sec. (0,21 ticks) Tried aggregator 1 time. MIP Presolve eliminated 1 rows and 1 columns. MIP Presolve modified 4 coefficients. Reduced MIP has 341 rows, 497 columns, and 1559 nonzeros. Reduced MIP has 25 binaries, 472 generals, 0 SOSs, and 0 indicators. Presolve time
= 0,00 sec. (0,85 ticks) Probing time = 0,00 sec. (0,19 ticks) MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic, using up to 4 threads. Root relaxation solution time = 0,00 sec. (0,97 ticks)

        Nodes                                         Cuts/    Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                        37500,0000    31250,0000            16,67%
*     0+    0                        35000,0000    31250,0000            10,71%
      0     0    31314,2064    15    35000,0000    31314,2064       41   10,53%
      0     0    32074,4750    34    35000,0000      Cuts: 54       62    8,36%
      0     0    32584,6404    20    35000,0000      Cuts: 25       91    6,90%
      0     0    32644,0817    30    35000,0000      Cuts: 29      105    6,73%
      0     0    32782,8515    24    35000,0000      Cuts: 14      115    6,33%
      0     0    32833,6352    17    35000,0000      Cuts: 22      120    6,19%
*     0+    0                        34315,0000    32833,6352             4,32%
      0     0    32833,6352    23    34315,0000      Cuts: 10      125    4,32%
      0     0    32834,1709    20    34315,0000       Cuts: 3      130    4,32%
*     0+    0                        34314,0000    32834,1709             4,31%
*     0+    0                        34201,0000    32834,1709             4,00%
*     0+    0                        34032,0000    32834,1709             3,52%
*     0+    0                        33782,0000    32834,1709             2,81%
      0     2    32834,1709    20    33782,0000    32834,6982      130    2,80% Elapsed time = 0,20 sec. (31,17 ticks, tree = 0,02 MB, solutions
= 7)

Implied bound cuts applied:  29 Flow cuts applied:  17 Mixed integer rounding cuts applied:  10 Flow path cuts applied:  11 Zero-half cuts applied:  2 Gomory fractional cuts applied:  10

Root node processing (before b&c):   Real time             =    0,19 sec. (30,99 ticks) Parallel b&c, 4 threads:   Real time             =  0,17 sec. (31,03 ticks)   Sync time (average)   =    0,06 sec.   Wait time (average)   =    0,00 sec.
                          ------------ Total (root+branch&cut) =    0,36 sec. (62,01 ticks) CPXPARAM_DetTimeLimit                          15000 1 of 7 MIP starts provided solutions. MIP start 'm1' defined initial solution with objective 33782,0000. Tried aggregator 2 times. MIP Presolve eliminated 827 rows and 321 columns. MIP Presolve added 4 rows and 0 columns. Aggregator did 9 substitutions. Reduced MIP has 278 rows, 410 columns, and 1282 nonzeros. Reduced MIP has 20 binaries, 390 generals, 0 SOSs, and 0 indicators. Presolve time = 0,00 sec. (1,43 ticks) Probing fixed 0 vars, tightened 2 bounds. Probing time = 0,02 sec. (0,13 ticks) Tried aggregator 1 time. MIP Presolve modified 4 coefficients. Reduced MIP has 278 rows, 410 columns, and 1282 nonzeros. Reduced MIP has 20 binaries, 390 generals, 0 SOSs, and 0 indicators. Presolve time = 0,00 sec. (0,70 ticks) Probing time = 0,00 sec. (0,13 ticks) MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic, using up to 4 threads. Root relaxation solution time = 0,00 sec. (0,72 ticks)

        Nodes                                         Cuts/    Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                        33782,0000    28782,0000            14,80%
      0     0    28870,7089    20    33782,0000    28870,7089       40   14,54%
      0     0    29921,5804    37    33782,0000      Cuts: 73       63   11,43%
      0     0    30297,2961    16    33782,0000      Cuts: 18       84   10,32%
*     0+    0                        31893,0000    30297,2961             5,00%
      0     0    30338,7836    37    31893,0000      Cuts: 17       95    4,87%
      0     0    30436,2248    30    31893,0000      Cuts: 13      107    4,57%
      0     0    30456,4637    13    31893,0000      Cuts: 11      113    4,50%
      0     0    30477,0706    56    31893,0000      Cuts: 13      120    4,44%
      0     0    30498,5940    36    31893,0000      Cuts: 20      125    4,37%
      0     0    30533,7835    37    31893,0000       Cuts: 6      128    4,26%
*     0+    0                        31662,0000    30533,7835             3,56%
*     0+    0                        31654,0000    30568,6604             3,43%
*     0+    0                        31382,0000    30568,6604             2,59%
      0     2    30533,7835    37    31382,0000    30568,6604      128    2,59% Elapsed time = 0,16 sec. (30,64 ticks, tree = 0,02 MB, solutions
= 5)

Implied bound cuts applied:  21 Flow cuts applied:  13 Mixed integer rounding cuts applied:  3 Flow path cuts applied:  20 Zero-half cuts applied:  1 Gomory fractional cuts applied:  11

Root node processing (before b&c):   Real time             =    0,14 sec. (30,48 ticks) Parallel b&c, 4 threads:   Real time             =  0,25 sec. (59,67 ticks)   Sync time (average)   =    0,04 sec.   Wait time (average)   =    0,00 sec.
                          ------------ Total (root+branch&cut) =    0,39 sec. (90,15 ticks) CPXPARAM_DetTimeLimit                          15000 1 of 5 MIP starts provided solutions. MIP start 'm1' defined initial solution with objective 31382,0000. Tried aggregator 2 times. MIP Presolve eliminated 845 rows and 360 columns. Aggregator did 13 substitutions. Reduced MIP has 252 rows, 367 columns, and 1144 nonzeros. Reduced MIP has 25 binaries, 342 generals, 0 SOSs, and 0 indicators. Presolve time = 0,00 sec. (1,32 ticks) Probing time = 0,00 sec. (0,14 ticks) Tried aggregator 1 time. Reduced MIP has 252 rows, 367 columns, and 1144 nonzeros. Reduced MIP has 25 binaries, 342 generals, 0 SOSs, and 0 indicators. Presolve time = 0,00 sec. (0,63 ticks) Probing time = 0,00 sec. (0,13 ticks) MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic, using up to 4 threads. Root relaxation solution time = 0,00 sec. (0,64 ticks)

        Nodes                                         Cuts/    Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                        31382,0000    25132,0000            19,92%
      0     0    25244,8113    25    31382,0000    25244,8113       40   19,56%
      0     0    27533,0641    41    31382,0000      Cuts: 84       74   12,26%
*     0+    0                        30999,0000    27533,0641            11,18%
      0     0    27920,4415    20    30999,0000      Cuts: 18       95    9,93%
*     0+    0                        29564,0000    27920,4415             5,56%
      0     0    27953,8964    41    29564,0000      Cuts: 16      106    5,45%
      0     0    28070,3282    42    29564,0000      Cuts: 14      120    5,05%
      0     0    28098,0339    21    29564,0000      Cuts: 13      124    4,96%
      0     0    28114,2658    38    29564,0000       Cuts: 9      130    4,90%
      0     0    28124,0308    52    29564,0000  Flowpaths: 4      137    4,87%
      0     0    28126,2949    38    29564,0000       Cuts: 8      140    4,86%
*     0+    0                        29427,0000    28178,7129             4,24%
*     0+    0                        29343,0000    28178,7129             3,97%
*     0+    0                        29324,0000    28178,7129             3,91%
*     0+    0                        29305,0000    28178,7129             3,84%
      0     2    28126,2949    38    29305,0000    28190,9836      140    3,80% Elapsed time = 0,16 sec. (30,51 ticks, tree = 0,02 MB, solutions
= 7)
*    14    10      integral     0    29272,0000    28190,9836      193    3,69%
*   315    93      integral     0    29212,0000    28421,3841     1104    2,71%
*   453+  121                        29067,0000    28619,5918             1,54%
*   604    56      integral     0    29041,0000    28910,0060     3006    0,45%

Implied bound cuts applied:  24 Flow cuts applied:  10 Mixed integer rounding cuts applied:  3 Flow path cuts applied:  19 Zero-half cuts applied:  1 Gomory fractional cuts applied:  15

Root node processing (before b&c):   Real time             =    0,16 sec. (30,40 ticks) Parallel b&c, 4 threads:   Real time             =  0,22 sec. (40,83 ticks)   Sync time (average)   =    0,10 sec.   Wait time (average)   =    0,00 sec.
                          ------------ Total (root+branch&cut) =    0,38 sec. (71,23 ticks) CPXPARAM_DetTimeLimit                          15000 1 of 12 MIP starts provided solutions. MIP start 'm1' defined initial solution with objective 29041,0000. Tried aggregator 2 times. MIP Presolve eliminated 900 rows and 440 columns. Aggregator did 13 substitutions. Reduced MIP has 197 rows, 287 columns, and 884 nonzeros. Reduced MIP has 25 binaries, 262 generals, 0 SOSs, and 0 indicators. Presolve time = 0,00 sec. (1,21 ticks) Probing time = 0,00 sec. (0,11 ticks) Tried aggregator 1 time. Reduced MIP has 197 rows, 287 columns, and 884 nonzeros. Reduced MIP has 25 binaries, 262 generals, 0 SOSs, and 0 indicators. Presolve time = 0,02 sec. (0,49 ticks) Probing time = 0,00 sec. (0,10 ticks) MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic, using up to 4 threads. Root relaxation solution time = 0,00 sec. (0,50 ticks)

        Nodes                                         Cuts/    Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                        29041,0000    22791,0000            21,52%
      0     0    22903,2112    25    29041,0000    22903,2112       34   21,13%
      0     0    25185,8934    41    29041,0000      Cuts: 85       68   13,27%
      0     0    25572,1352    35    29041,0000      Cuts: 18       90   11,94%
*     0+    0                        27162,0000    25572,1352             5,85%
      0     0    25617,2128    26    27162,0000      Cuts: 14       98    5,69%
      0     0    25669,8899    14    27162,0000      Cuts: 19      108    5,49%
      0     0    25712,5560    38    27162,0000       Cuts: 9      115    5,34%
      0     0    25743,1148    54    27162,0000       Cuts: 7      125    5,22%
      0     0    25814,7675    52    27162,0000      Cuts: 20      137    4,96%
      0     0    25819,4636    38    27162,0000      Cuts: 21      141    4,94%
      0     0    25819,5024    38    27162,0000       Cuts: 9      143    4,94%
      0     0    25819,8040    39    27162,0000   Flowcuts: 1      144    4,94%
*     0+    0                        27070,0000    25819,8040             4,62%
*     0+    0                        26991,0000    25819,8040             4,34%
*     0+    0                        26960,0000    25819,8040             4,23%
*     0+    0                        26847,0000    25819,8040             3,83%
      0     2    25819,8040    39    26847,0000    25819,8040      144    3,83% Elapsed time = 0,17 sec. (31,64 ticks, tree = 0,02 MB, solutions
= 6)
*   112    27      integral     0    26828,0000    25881,4576      374    3,53%
*   138    37      integral     0    26687,0000    25890,1618      467    2,99%

Implied bound cuts applied:  18 Flow cuts applied:  9 Mixed integer rounding cuts applied:  8 Flow path cuts applied:  21 Gomory fractional cuts applied:  14

Root node processing (before b&c):   Real time             =    0,17 sec. (31,54 ticks) Parallel b&c, 4 threads:   Real time             =  0,11 sec. (21,68 ticks)   Sync time (average)   =    0,04 sec.   Wait time (average)   =    0,00 sec.
                          ------------ Total (root+branch&cut) =    0,28 sec. (53,22 ticks) CPXPARAM_DetTimeLimit                          15000 1 of 8 MIP starts provided solutions. MIP start 'm1' defined initial solution with objective 26687,0000. Tried aggregator 2 times. MIP Presolve eliminated 955 rows and 520 columns. Aggregator did 13 substitutions. Reduced MIP has 142 rows, 207 columns, and 624 nonzeros. Reduced MIP has 25 binaries, 182 generals, 0 SOSs, and 0 indicators. Presolve time = 0,02 sec. (1,10 ticks) Probing time = 0,00 sec. (0,08 ticks) Tried aggregator 1 time. Reduced MIP has 142 rows, 207 columns, and 624 nonzeros. Reduced MIP has 25 binaries, 182 generals, 0 SOSs, and 0 indicators. Presolve time = 0,00 sec. (0,36 ticks) Probing time = 0,00 sec. (0,07 ticks) MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic, using up to 4 threads. Root relaxation solution time = 0,00 sec. (0,38 ticks)

        Nodes                                         Cuts/    Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                        26687,0000    20437,0000            23,42%
      0     0    20546,7110    25    26687,0000    20546,7110       29   23,01%
      0     0    22823,4321    41    26687,0000      Cuts: 84       63   14,48%
      0     0    23203,9052    20    26687,0000      Cuts: 18       84   13,05%
*     0+    0                        24798,0000    23203,9052             6,43%
      0     0    23233,0297    41    24798,0000      Cuts: 15       92    6,31%
      0     0    23370,5859    47    24798,0000      Cuts: 17      107    5,76%
      0     0    23380,8335    66    24798,0000       Cuts: 7      118    5,71%
      0     0    23396,3490    38    24798,0000      Cuts: 18      134    5,65%
      0     0    23401,6885    48    24798,0000      Cuts: 11      144    5,63%
      0     0    23406,5270    39    24798,0000       Cuts: 9      151    5,61%
*     0+    0                        24543,0000    23406,5270             4,63%
*     0+    0                        24293,0000    23536,4099             3,11%
      0     2    23406,5270    39    24293,0000    23555,5098      151    3,04% Elapsed time = 0,14 sec. (18,87 ticks, tree = 0,02 MB, solutions
= 4)

Implied bound cuts applied:  26 Flow cuts applied:  15 Mixed integer rounding cuts applied:  9 Flow path cuts applied:  18 Gomory fractional cuts applied:  14

Root node processing (before b&c):   Real time             =    0,16 sec. (18,79 ticks) Parallel b&c, 4 threads:   Real time             =  0,09 sec. (22,60 ticks)   Sync time (average)   =    0,02 sec.   Wait time (average)   =    0,00 sec.
                          ------------ Total (root+branch&cut) =    0,25 sec. (41,39 ticks) CPXPARAM_DetTimeLimit                          15000 1 of 4 MIP starts provided solutions. MIP start 'm1' defined initial solution with objective 24293,0000. Tried aggregator 2 times. MIP Presolve eliminated 1015 rows and 605 columns. MIP Presolve added 5 rows and 5 columns. Aggregator did 13 substitutions. Reduced MIP has 87 rows, 127 columns, and 364 nonzeros. Reduced MIP has 25 binaries, 102 generals, 0 SOSs, and 0 indicators. Presolve time = 0,00 sec. (1,04 ticks) Probing time = 0,00 sec. (0,04 ticks) Tried aggregator 1 time. Reduced MIP has 87 rows, 127 columns, and 364 nonzeros. Reduced MIP has 25 binaries, 102 generals, 0 SOSs, and 0 indicators. Presolve time = 0,00 sec. (0,22 ticks) Probing time = 0,00 sec. (0,04 ticks) MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic, using up to 4 threads. Root relaxation solution time = 0,00 sec. (0,22 ticks)

        Nodes                                         Cuts/    Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                        24293,0000    18043,0000            25,73%
      0     0    18153,5111    25    24293,0000    18153,5111       25   25,27%
      0     0    20418,7107    41    24293,0000      Cuts: 89       59   15,95%
*     0+    0                        23893,0000    20418,7107            14,54%
      0     0    20865,3751    41    23893,0000      Cuts: 30       82   12,67%
*     0+    0                        23841,0000    20865,3751            12,48%
      0     0    21002,1722    36    23841,0000      Cuts: 17       95   11,91%
      0     0    21051,8993    38    23841,0000      Cuts: 10      102   11,70%
      0     0    21075,6472    36    23841,0000      Cuts: 10      104   11,60%
      0     0    21083,0413    38    23841,0000       Cuts: 7      109   11,57%
*     0+    0                        22452,0000    21083,0413             6,10%
*     0+    0                        21902,0000    21083,0413             3,74%
      0     2    21083,0413    38    21902,0000    21156,8012      109    3,40% Elapsed time = 0,09 sec. (10,49 ticks, tree = 0,02 MB, solutions
= 5)

Implied bound cuts applied:  19 Flow cuts applied:  11 Mixed integer rounding cuts applied:  9 Flow path cuts applied:  15 Zero-half cuts applied:  1 Gomory fractional cuts applied:  15

Root node processing (before b&c):   Real time             =    0,08 sec. (10,44 ticks) Parallel b&c, 4 threads:   Real time             =  0,13 sec. (18,70 ticks)   Sync time (average)   =    0,04 sec.   Wait time (average)   =    0,00 sec.
                          ------------ Total (root+branch&cut) =    0,20 sec. (29,14 ticks)

Here, the F&O algorithm solves blockwise in 8 iterations and I can extract and display several cplex parameters in the scripting log. Only this MIP gap produces an error...

0

There are 0 answers