最適化問題に対する超高速&安定計算

大規模最適化問題、グラフ探索、機械学習やデジタルツインなどの研究のお話が中心

CPLEX と前処理

2014年09月16日 00時01分46秒 | Weblog
CPLEX 12.6 を用いた前処理について。

1:問題の読み込み
CPLEX> read test.mps
Selected objective sense: MINIMIZE
Selected objective name: OBJROW
Selected RHS name: RHS
Selected range name: RANGE
Selected bound name: BOUND
Problem 'test.mps' read.
Read time = 0.18 sec. (17.45 ticks)

2:そのまま解く
CPLEX> opt
Tried aggregator 1 time.
MIP Presolve eliminated 37998 rows and 19332 columns.
MIP Presolve modified 18862 coefficients.
Reduced MIP has 22399 rows, 37039 columns, and 136502 nonzeros.
Reduced MIP has 35595 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time = 0.27 sec. (156.13 ticks)
Probing fixed 15645 vars, tightened 2 bounds.
Probing changed sense of 3861 constraints.
Probing time = 1.16 sec. (242.84 ticks)
Tried aggregator 1 time.
MIP Presolve eliminated 9884 rows and 20502 columns.
MIP Presolve modified 1912 coefficients.
Reduced MIP has 12515 rows, 16537 columns, and 68075 nonzeros.
Reduced MIP has 15099 binaries, 1 generals, 0 SOSs, and 0 indicators.
Presolve time = 0.12 sec. (72.35 ticks)
Probing fixed 120 vars, tightened 12 bounds.
Probing time = 0.31 sec. (85.87 ticks)
Tried aggregator 1 time.
MIP Presolve eliminated 1540 rows and 1070 columns.
Reduced MIP has 10975 rows, 15467 columns, and 64664 nonzeros.
Reduced MIP has 14041 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time = 0.09 sec. (49.90 ticks)
Probing time = 0.05 sec. (8.69 ticks)
Clique table members: 7656.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: deterministic, using up to 32 threads.
Root relaxation solution time = 0.18 sec. (88.40 ticks)

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

0 0 142.0000 34 142.0000 1263
* 0+ 0 156.0000 142.0000 1263 8.97%
0 0 142.0000 34 156.0000 Cuts: 4 1323 8.97%
0 0 142.0000 22 156.0000 Cuts: 4 1329 8.97%
0 0 142.0000 34 156.0000 Cuts: 6 1338 8.97%
0 2 142.0000 34 156.0000 142.0000 1338 8.97%
Elapsed time = 5.64 sec. (2385.77 ticks, tree = 0.01 MB, solutions = 1)
2 4 142.0000 10 156.0000 142.0000 3052 8.97%
10 6 149.0000 9 156.0000 142.0000 7443 8.97%
12 6 146.6667 11 156.0000 142.0000 10543 8.97%
15 5 146.6667 11 156.0000 142.0000 14124 8.97%
25 3 cutoff 156.0000 142.0000 17415 8.97%
28 6 146.6667 11 156.0000 142.0000 20969 8.97%
38 7 146.6667 11 156.0000 142.0000 23871 8.97%
42 7 146.6667 11 156.0000 142.0000 26442 8.97%
46 7 cutoff 156.0000 142.0000 31093 8.97%
64 9 146.6667 11 156.0000 142.0000 43252 8.97%
Elapsed time = 11.51 sec. (6040.36 ticks, tree = 0.01 MB, solutions = 1)
96 9 cutoff 156.0000 142.0000 56745 8.97%

Implied bound cuts applied: 6
Lift and project cuts applied: 1
Gomory fractional cuts applied: 3

Root node processing (before b&c):
Real time = 5.40 sec. (2363.85 ticks)
Parallel b&c, 32 threads:
Real time = 8.92 sec. (5136.26 ticks)
Sync time (average) = 7.14 sec.
Wait time (average) = 0.00 sec.
------------
Total (root+branch&cut) = 14.32 sec. (7500.12 ticks)

Solution pool: 1 solution saved.

MIP - Integer optimal solution: Objective = 1.5600000000e+02
Solution time = 14.34 sec. Iterations = 60734 Nodes = 113
Deterministic time = 7500.22 ticks (523.10 ticks/sec)

最適目的関数値は 156 となる。

3:以下のように書くと前処理のみ実行されて、tmp.pre ファイルに書き込まれる。ただし、この場合では目的関数値は 24 減少する。
CPLEX> write tmp.pre
Problem written to file 'tmp.pre' (objective shift = 2.4000000000e+01).

4:tmp.pre を読み込むことによって、前処理後からの開始が可能となる。
CPLEX> read tmp.pre
Problem 'tmp.pre' read.
Read time = 0.03 sec. (1.60 ticks)

5:最適化の開始
CPLEX> opt
Tried aggregator 1 time.
Reduced MIP has 22399 rows, 37039 columns, and 136502 nonzeros.
Reduced MIP has 35595 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time = 0.12 sec. (69.19 ticks)
Probing fixed 15645 vars, tightened 2 bounds.
Probing changed sense of 3861 constraints.
Probing time = 0.88 sec. (242.84 ticks)
Tried aggregator 1 time.
MIP Presolve eliminated 9884 rows and 20502 columns.
MIP Presolve modified 1912 coefficients.
Reduced MIP has 12515 rows, 16537 columns, and 68075 nonzeros.
Reduced MIP has 15099 binaries, 1438 generals, 0 SOSs, and 0 indicators.
Presolve time = 0.12 sec. (72.38 ticks)
Probing fixed 120 vars, tightened 12 bounds.
Probing time = 0.19 sec. (85.85 ticks)
Tried aggregator 1 time.
MIP Presolve eliminated 1540 rows and 1070 columns.
Reduced MIP has 10975 rows, 15467 columns, and 64664 nonzeros.
Reduced MIP has 14041 binaries, 1426 generals, 0 SOSs, and 0 indicators.
Presolve time = 0.09 sec. (49.92 ticks)
Probing time = 0.05 sec. (8.69 ticks)
Clique table members: 7656.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: deterministic, using up to 32 threads.
Root relaxation solution time = 0.18 sec. (88.40 ticks)

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

0 0 118.0000 34 118.0000 1263
* 0+ 0 132.0000 118.0000 1263 10.61%
0 0 118.0000 34 132.0000 Cuts: 4 1323 10.61%
0 0 118.0000 22 132.0000 Cuts: 4 1329 10.61%
0 0 118.0000 34 132.0000 Cuts: 5 1338 10.61%
0 2 118.0000 34 132.0000 118.0000 1338 10.61%
Elapsed time = 5.46 sec. (2448.31 ticks, tree = 0.01 MB, solutions = 1)
2 4 118.0000 10 132.0000 118.0000 3052 10.61%
8 4 cutoff 132.0000 118.0000 8413 10.61%
12 6 122.6667 13 132.0000 118.0000 14739 10.61%
19 3 cutoff 132.0000 118.0000 16883 10.61%
23 7 125.0000 9 132.0000 118.0000 20696 10.61%
34 6 122.6667 13 132.0000 118.0000 23743 10.61%
39 6 cutoff 132.0000 118.0000 29891 10.61%
40 5 cutoff 132.0000 118.0000 34402 10.61%
47 6 122.6667 13 132.0000 118.0000 42797 10.61%
68 6 118.0000 10 132.0000 118.0000 52373 10.61%
Elapsed time = 12.14 sec. (6499.56 ticks, tree = 0.02 MB, solutions = 1)
84 9 125.0000 9 132.0000 118.0000 62129 10.61%

Implied bound cuts applied: 6
Lift and project cuts applied: 1
Gomory fractional cuts applied: 3

Root node processing (before b&c):
Real time = 5.26 sec. (2426.41 ticks)
Parallel b&c, 32 threads:
Real time = 9.64 sec. (5701.12 ticks)
Sync time (average) = 8.14 sec.
Wait time (average) = 0.00 sec.
------------
Total (root+branch&cut) = 14.90 sec. (8127.53 ticks)

Solution pool: 1 solution saved.

MIP - Integer optimal solution: Objective = 1.3200000000e+02
Solution time = 14.91 sec. Iterations = 68200 Nodes = 100
Deterministic time = 8127.64 ticks (545.00 ticks/sec)

最適目的関数値は 132 となって、前回の値 156 からは 24 減少している。
コメント    この記事についてブログを書く
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする
« 都市 OS 内のグラフ解析&最... | トップ | 感染症数理モデルの実用化と... »
最新の画像もっと見る

コメントを投稿

ブログ作成者から承認されるまでコメントは反映されません。

Weblog」カテゴリの最新記事