This example demonstrates how you can use the METHOD=AUTO option in the DECOMP statement to execute the decomposition algorithm in single-machine mode.
Consider a mixed integer linear program that is defined by the MPS data set mpsdata
. In this case, the structure of the model is unknown and only the MPS data set is provided to you.
The following PROC OPTMILP statements solves the problem by using standard methods:
proc optmilp data = mpsdata; run;
The solution summary is shown in Output 14.3.1.
Output 14.3.1: Solution Summary
Solution Summary | |
---|---|
Solver | MILP |
Algorithm | Branch and Cut |
Objective Function | R0001298 |
Solution Status | Optimal |
Objective Value | 120 |
Relative Gap | 0 |
Absolute Gap | 0 |
Primal Infeasibility | 7.283063E-14 |
Bound Infeasibility | 3.641532E-14 |
Integer Infeasibility | 4.440892E-16 |
Best Bound | 120 |
Nodes | 1 |
Iterations | 558 |
Presolve Time | 0.02 |
Solution Time | 4.51 |
The iteration log, which contains the problem statistics and the progress of the solution, is shown in Output 14.3.2.
Output 14.3.2: Log
NOTE: The problem MPSDATA has 388 variables (36 binary, 0 integer, 1 free, 0 fixed). |
NOTE: The problem has 1297 constraints (630 LE, 37 EQ, 630 GE, 0 range). |
NOTE: The problem has 4204 constraint coefficients. |
NOTE: The MILP presolver value AUTOMATIC is applied. |
NOTE: The MILP presolver removed 37 variables and 37 constraints. |
NOTE: The MILP presolver removed 424 constraint coefficients. |
NOTE: The MILP presolver modified 0 constraint coefficients. |
NOTE: The presolved problem has 351 variables, 1260 constraints, and 3780 constraint |
coefficients. |
NOTE: The MILP solver is called. |
NOTE: The problem has a decomposable structure with 4 blocks. The largest block |
covers 25.08% of the constraints in the problem. The DECOMP option with |
METHOD=AUTO is recommended for solving problems with this structure. |
Node Active Sols BestInteger BestBound Gap Time |
0 1 1 231.0000000 0 231.0 0 |
0 1 1 231.0000000 91.4479396 152.60% 0 |
0 1 3 120.0000000 120.0000000 0.00% 4 |
0 0 3 120.0000000 120.0000000 0.00% 4 |
NOTE: The MILP solver added 2 cuts with 11 cut coefficients at the root. |
NOTE: Optimal. |
NOTE: Objective = 120. |
A note in the log suggests that you can use the decomposition algorithm because of the structure of the problem. The following PROC OPTMILP statements use the METHOD=AUTO option in the DECOMP statement in single-machine mode. The PERFORMANCE statement specifies the number of threads to be used.
proc optmilp data = mpsdata; decomp loglevel = 2 method = auto; subprob loglevel = 2; performance nthreads = 4; run;
The performance information and solution summary are displayed in Output 14.3.3.
Output 14.3.3: Performance Information and Solution Summary
Performance Information | |
---|---|
Execution Mode | Single-Machine |
Number of Threads | 4 |
Solution Summary | |
---|---|
Solver | MILP |
Algorithm | Decomposition |
Objective Function | R0001298 |
Solution Status | Optimal |
Objective Value | 120 |
Relative Gap | 0 |
Absolute Gap | 0 |
Primal Infeasibility | 5.684342E-14 |
Bound Infeasibility | 9.103829E-15 |
Integer Infeasibility | 0 |
Best Bound | 120 |
Nodes | 1 |
Iterations | 1 |
Presolve Time | 0.01 |
Solution Time | 1.36 |
The iteration log, which contains the problem statistics and the progress of the solution, is shown in Output 14.3.4. When you specify NTHREADS=4 in the PERFORMANCE statement in single-machine mode, each block is processed simultaneously on each of four threads.
Output 14.3.4: Log
NOTE: The problem MPSDATA has 388 variables (36 binary, 0 integer, 1 free, 0 fixed). |
NOTE: The problem has 1297 constraints (630 LE, 37 EQ, 630 GE, 0 range). |
NOTE: The problem has 4204 constraint coefficients. |
NOTE: The OPTMILP procedure is executing in single-machine mode. |
NOTE: The MILP presolver value AUTOMATIC is applied. |
NOTE: The MILP presolver removed 37 variables and 37 constraints. |
NOTE: The MILP presolver removed 424 constraint coefficients. |
NOTE: The MILP presolver modified 0 constraint coefficients. |
NOTE: The presolved problem has 351 variables, 1260 constraints, and 3780 constraint |
coefficients. |
NOTE: The MILP solver is called. |
NOTE: The Decomposition algorithm is used. |
NOTE: The DECOMP method value AUTO is applied. |
NOTE: The problem has a decomposable structure with 4 blocks. The largest block |
covers 25.08% of the constraints in the problem. |
NOTE: The decomposition subproblems cover 351 (100.00%) variables and 1260 (100.00%) |
constraints. |
NOTE: Block 1 has 88 (25.07%) variables and 316 (25.08%) constraints. |
NOTE: Block 2 has 88 (25.07%) variables and 316 (25.08%) constraints. |
NOTE: Block 3 has 88 (25.07%) variables and 316 (25.08%) constraints. |
NOTE: Block 4 has 87 (24.79%) variables and 312 (24.76%) constraints. |
NOTE: The deterministic parallel mode is enabled. |
NOTE: The Decomposition algorithm is using up to 4 threads. |
NOTE: -------------------------------------------------------------------------------- |
NOTE: Starting to process node 0. |
NOTE: -------------------------------------------------------------------------------- |
NOTE: -------------------------------------------------------------------------------- |
NOTE: The subproblem solver for 4 blocks at iteration 0 is starting. |
NOTE: -------------------------------------------------------------------------------- |
NOTE: The subproblem solver for block 1 at iteration 0 is starting on thread 1. |
NOTE: The MILP presolver value AUTOMATIC is applied. |
NOTE: The MILP presolver removed 0 variables and 0 constraints. |
NOTE: The MILP presolver removed 0 constraint coefficients. |
NOTE: The MILP presolver modified 0 constraint coefficients. |
NOTE: The presolved problem has 88 variables, 316 constraints, and 948 constraint |
coefficients. |
NOTE: The MILP solver is called. |
Node Active Sols BestInteger BestBound Gap Time |
0 1 1 -16 -56 71.43% 0 |
0 1 1 -16 -34.1037735849 53.08% 0 |
0 1 1 -16 -34.1037735849 53.08% 0 |
41 34 2 -22 -32.8571428571 33.04% 0 |
79 50 3 -24 -31.5256410256 23.87% 0 |
100 57 3 -24 -30.8823529412 22.29% 0 |
134 40 4 -27 -30.1875 10.56% 0 |
200 31 4 -27 -28.2173913043 4.31% 0 |
256 0 4 -27 -27 0.00% 0 |
NOTE: Optimal. |
NOTE: Objective = -27. |
NOTE: The subproblem solver for block 1 used 0.77 (cpu: 3.01) seconds. |
NOTE: -------------------------------------------------------------------------------- |
NOTE: -------------------------------------------------------------------------------- |
NOTE: The subproblem solver for block 2 at iteration 0 is starting on thread 2. |
NOTE: The MILP presolver value AUTOMATIC is applied. |
NOTE: The MILP presolver removed 0 variables and 0 constraints. |
NOTE: The MILP presolver removed 0 constraint coefficients. |
NOTE: The MILP presolver modified 0 constraint coefficients. |
NOTE: The presolved problem has 88 variables, 316 constraints, and 948 constraint |
coefficients. |
NOTE: The MILP solver is called. |
Node Active Sols BestInteger BestBound Gap Time |
0 1 1 0 -59 100.00% 0 |
0 1 1 0 -35.3671970624 100.00% 0 |
0 1 2 -12 -35.3671970624 66.07% 0 |
0 1 3 -22 -35.3671970624 37.80% 0 |
0 1 3 -22 -35.3671970624 37.80% 0 |
29 25 4 -25 -34.5755617978 27.69% 0 |
100 68 4 -25 -33.6877637131 25.79% 0 |
176 92 5 -27 -32.5330380214 17.01% 0 |
200 100 5 -27 -32.1264181524 15.96% 0 |
268 30 6 -30 -30.9599198397 3.10% 1 |
300 1 6 -30 -30.0694444444 0.23% 1 |
301 0 6 -30 -30 0.00% 1 |
NOTE: Optimal. |
NOTE: Objective = -30. |
NOTE: The subproblem solver for block 2 used 1.08 (cpu: 3.93) seconds. |
NOTE: -------------------------------------------------------------------------------- |
NOTE: -------------------------------------------------------------------------------- |
NOTE: The subproblem solver for block 4 at iteration 0 is starting on thread 4. |
NOTE: The MILP presolver value AUTOMATIC is applied. |
NOTE: The MILP presolver removed 0 variables and 0 constraints. |
NOTE: The MILP presolver removed 0 constraint coefficients. |
NOTE: The MILP presolver modified 0 constraint coefficients. |
NOTE: The presolved problem has 87 variables, 312 constraints, and 936 constraint |
coefficients. |
NOTE: The MILP solver is called. |
Node Active Sols BestInteger BestBound Gap Time |
0 1 1 -16 -57 71.93% 0 |
0 1 1 -16 -33.8743589744 52.77% 0 |
0 1 1 -16 -33.8133333333 52.68% 0 |
0 1 1 -16 -33.7886665693 52.65% 0 |
0 1 1 -16 -33.7577927973 52.60% 0 |
0 1 1 -16 -33.7083333333 52.53% 0 |
0 1 2 -19 -33.7083333333 43.63% 0 |
0 1 2 -19 -33.7083333333 43.63% 0 |
NOTE: The MILP solver added 3 cuts with 15 cut coefficients at the root. |
6 6 3 -20 -33.5686695279 40.42% 0 |
100 74 3 -20 -32.0723684211 37.64% 0 |
107 76 4 -22 -31.8947368421 31.02% 0 |
120 83 5 -22 -31.6161567878 30.42% 0 |
127 84 6 -23 -31.3428571429 26.62% 0 |
131 66 7 -26 -31.1299435028 16.48% 0 |
200 81 7 -26 -29.4630681818 11.75% 0 |
300 77 7 -26 -27.9 6.81% 0 |
400 8 7 -26 -26.1785714286 0.68% 1 |
408 0 7 -26 -26 0.00% 1 |
NOTE: Optimal. |
NOTE: Objective = -26. |
NOTE: The subproblem solver for block 4 used 1.10 (cpu: 3.96) seconds. |
NOTE: -------------------------------------------------------------------------------- |
NOTE: -------------------------------------------------------------------------------- |
NOTE: The subproblem solver for block 3 at iteration 0 is starting on thread 3. |
NOTE: The MILP presolver value AUTOMATIC is applied. |
NOTE: The MILP presolver removed 0 variables and 0 constraints. |
NOTE: The MILP presolver removed 0 constraint coefficients. |
NOTE: The MILP presolver modified 0 constraint coefficients. |
NOTE: The presolved problem has 88 variables, 316 constraints, and 948 constraint |
coefficients. |
NOTE: The MILP solver is called. |
Node Active Sols BestInteger BestBound Gap Time |
0 1 1 -9 -59 84.75% 0 |
0 1 1 -9 -36.2067307692 75.14% 0 |
0 1 2 -14 -35.8906956361 60.99% 0 |
0 1 2 -14 -35.7582989209 60.85% 0 |
0 1 2 -14 -35.7308331027 60.82% 0 |
0 1 2 -14 -35.7308331027 60.82% 0 |
NOTE: The MILP solver added 3 cuts with 14 cut coefficients at the root. |
53 42 4 -19 -34.6324177369 45.14% 0 |
67 51 6 -20 -34.3787806049 41.82% 0 |
70 53 7 -20 -34.3787806049 41.82% 0 |
76 57 8 -21 -34.3112633181 38.80% 0 |
100 72 8 -21 -34.0784347526 38.38% 0 |
146 85 9 -25 -33.4521643231 25.27% 0 |
162 83 11 -27 -33.1772885284 18.62% 0 |
200 98 11 -27 -32.7098430537 17.46% 0 |
257 93 12 -28 -31.8888888889 12.20% 0 |
300 95 12 -28 -31 9.68% 0 |
400 59 12 -28 -29.375 4.68% 1 |
470 1 12 -28 -28 0.00% 1 |
NOTE: Optimal. |
NOTE: Objective = -28. |
NOTE: The subproblem solver for block 3 used 1.33 (cpu: 4.20) seconds. |
NOTE: -------------------------------------------------------------------------------- |
NOTE: The subproblem solver for 4 blocks used 1.33 (cpu: 4.20) seconds. |
NOTE: -------------------------------------------------------------------------------- |
NOTE: The initial column pool after generating initial variables contains 4 columns. |
NOTE: The number of active nodes is 0. |
NOTE: The objective value of the best integer feasible solution is 120.0000 and the |
best bound is 120.0000. |
NOTE: The Decomposition algorithm used 4 threads. |
NOTE: The Decomposition algorithm time is 1.34 seconds. |
NOTE: Optimal. |
NOTE: Objective = 120. |
In this case, the solver found that, after presolve, the constraint matrix decomposed into block-diagonal form. That is, all the constraints are covered by subproblem blocks, leaving the set of master constraints empty. With no coupling constraints, the problem decomposes into four completely independent problems. If you specify LOGLEVEL=2 in the DECOMP statement, the log displays the size of each block. The blocks in this case are nicely balanced, allowing parallel execution to be efficient.