Originally posted by: david.rey
Hello,
I am having some trouble displaying some information while solving a MIP using the CPLEX C++ API. In particular, I would like to display the number of simplex iterations CPLEX has been through and the number of nodes explored during the b&c process. I am also interested in the total running time. I tried setting MIPdisplay to 5, but here is an example of what I obtain in the resulting log:
Tried aggregator 2 times.
MIP Presolve eliminated 2197 rows and 816 columns.
MIP Presolve modified 1276 coefficients.
Aggregator did 1163 substitutions.
Reduced MIP has 3475 rows, 1939 columns, and 11097 nonzeros.
Reduced MIP has 466 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing fixed 0 vars, tightened 523 bounds.
Probing time = 0.00 sec.
Tried aggregator 1 time.
MIP Presolve eliminated 714 rows and 427 columns.
Reduced MIP has 2761 rows, 1512 columns, and 9019 nonzeros.
Reduced MIP has 371 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time = 0.09 sec.
Probing fixed 0 vars, tightened 5 bounds.
Probing time = 0.00 sec.
Clique table members: 19.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: none, using 1 thread.
Tried aggregator 1 time.
LP Presolve eliminated 1 rows and 1 columns.
Reduced LP has 2760 rows, 1511 columns, and 9016 nonzeros.
Presolve time = 0.00 sec.
Iteration log . . .
Iteration: 1 Dual objective = 82631.706289
Perturbation started.
Iteration: 102 Dual objective = 82631.706289
Iteration: 243 Dual objective = 82631.710731
Iteration: 401 Dual objective = 82645.563649
Iteration: 537 Dual objective = 82713.301725
Iteration: 714 Dual objective = 82841.621017
Removing perturbation.
Root relaxation solution time = 0.02 sec.
Nodes Cuts/
Node Left Objective IInf Best Integer Best Node ItCnt Gap
0 0 82929.0916 156 82929.0916 864
-
0+ 0 83783.2741 82929.0916 864 1.02%
0 0 83115.8913 86 83783.2741 Cuts: 211 1147 0.80%
-
0+ 0 83427.8225 83115.8913 1147 0.37%
0 0 83223.7198 81 83427.8225 Cuts: 130 1320 0.24%
0 0 83233.3569 80 83427.8225 Cuts: 54 1363 0.23%
0 0 83243.7001 83 83427.8225 Cuts: 14 1381 0.22%
0 0 83243.8963 83 83427.8225 Flowcuts: 1 1384 0.22%
Repeating presolve.
Tried aggregator 1 time.
MIP Presolve eliminated 777 rows and 486 columns.
Reduced MIP has 1984 rows, 1026 columns, and 6494 nonzeros.
Reduced MIP has 274 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing time = 0.00 sec.
Tried aggregator 1 time.
MIP Presolve eliminated 1487 rows and 777 columns.
Reduced MIP has 497 rows, 249 columns, and 1610 nonzeros.
Reduced MIP has 60 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing time = 0.00 sec.
Tried aggregator 1 time.
MIP Presolve eliminated 368 rows and 184 columns.
Reduced MIP has 129 rows, 65 columns, and 414 nonzeros.
Reduced MIP has 14 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing time = 0.00 sec.
Tried aggregator 1 time.
Represolve time = 0.11 sec.
Probing time = 0.00 sec.
Clique table members: 8.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: none, using 1 thread.
Root relaxation solution time = 0.00 sec.
Nodes Cuts/
Node Left Objective IInf Best Integer Best Node ItCnt Gap
-
0+ 0 83416.7648 83243.8963 1452 0.21%
0 0 83365.3893 8 83416.7648 83365.3893 1452 0.06%
-
0+ 0 83410.8773 83365.3893 1452 0.05%
-
0+ 0 83410.5310 83365.3893 1452 0.05%
-
0+ 0 83409.3437 83365.3893 1452 0.05%
0 2 83365.3893 8 83409.3437 83365.9620 1452 0.05%
Elapsed real time = 0.53 sec. (tree size = 0.00 MB, solutions = 7)
-
15 6 integral 0 83408.4998 83380.5920 1543 0.03%
Cuts: 7
-
31 6 integral 0 83408.3522 83391.5157 1629 0.02%
Cuts: 4
-
45 2 integral 0 83404.6780 83395.6588 1683 0.01%
Impl Bds: 2
Implied bound cuts applied: 17
Flow cuts applied: 13
Gomory fractional cuts applied: 7
Reading the log, I understand that at least 45 nodes have been explored and 714 simplex iterations have been performed, but I know that using CPLEX through AMPL (for example) it is possible to obtain a log that ends with something like:
...
Root node processing (before b&c):
Real time = 0.02
Parallel b&c, 4 threads:
Real time = 0.01
Sync time (average) = 0.00
Wait time (average) = 0.01
Total (root+branch&cut) = 0.03 sec.
#Total 19.8906
CPLEX 12.2.0.0: optimal integer solution; objective 44306501
91 MIP simplex iterations
3 branch-and-bound nodes
1 cover cut
1 GUB-cover cut
1 flow-cover cut
1 Gomory cut
2 mixed-integer rounding cuts
Can you help me display this information using the CPLEX C++ API ?
Thank you very much,
David Rey.
#CPLEXOptimizers#DecisionOptimization