The OPTLP Procedure
Example 12.2 Using the Interior Point Algorithm
(View the complete code for this example.)
You can also solve the oil refinery problem described in Example 12.1 by using the interior point algorithm. You can create the input data set from an external MPS-format flat file by using the SAS macro %MPS2SASD or SAS DATA step code, both of which are described in Getting Started: OPTLP Procedure. You can use the following SAS code to solve the problem:
proc optlp data=ex1
objsense = max
algorithm = ip
primalout = ex1ipout
dualout = ex1idout
logfreq = 1;
run;
The optimal solution is displayed in Output 12.2.1.
Output 12.2.1: Interior Point Algorithm: Primal Solution Output
| Primal Solution |
| Obs | Objective Function ID | RHS ID | Variable Name | Variable Type | Objective Coefficient | Lower Bound | Upper Bound | Variable Value | Variable Status | Reduced Cost |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | profit | a_l | D | -175 | 0 | 110 | 110.000 | U | 10.2083 | |
| 2 | profit | a_h | D | -165 | 0 | 165 | 0.000 | L | -22.8125 | |
| 3 | profit | br | D | -205 | 0 | 80 | 80.000 | U | 2.8125 | |
| 4 | profit | na_l | N | 0 | 0 | 1.7977E308 | 7.450 | B | 0.0000 | |
| 5 | profit | na_i | N | 0 | 0 | 1.7977E308 | 21.800 | B | 0.0000 | |
| 6 | profit | h_o | N | 0 | 0 | 1.7977E308 | 77.300 | B | 0.0000 | |
| 7 | profit | j_1 | N | 350 | 0 | 1.7977E308 | 72.667 | B | 0.0000 | |
| 8 | profit | j_2 | N | 350 | 0 | 1.7977E308 | 33.042 | B | 0.0000 |
The iteration log is displayed in Output 12.2.2.
Output 12.2.2: Log: Solution Progress
| NOTE: The problem EX1 has 8 variables (0 free, 0 fixed). |
| NOTE: The problem has 6 constraints (3 LE, 3 EQ, 0 GE, 0 range). |
| NOTE: The problem has 19 constraint coefficients. |
| NOTE: The MPS read time is 0.00 seconds. |
| WARNING: The objective sense has been changed to maximization. |
| NOTE: The LP presolver value AUTOMATIC is applied. |
| NOTE: The LP presolver time is 0.00 seconds. |
| NOTE: The LP presolver removed 3 variables and 3 constraints. |
| NOTE: The LP presolver removed 6 constraint coefficients. |
| NOTE: The LP presolver modified 0 constraint coefficients. |
| NOTE: The presolved problem has 5 variables, 3 constraints, and 13 constraint |
| coefficients. |
| NOTE: The LP solver is called. |
| NOTE: The Interior Point algorithm is used. |
| NOTE: The deterministic parallel mode is enabled. |
| NOTE: The Interior Point algorithm is using up to 16 threads. |
| Primal Bound Dual |
| Iter Complement Duality Gap Infeas Infeas Infeas Time |
| 0 3.3251E+01 2.3083E+00 8.6736E+00 1.1031E-01 4.6594E-02 0 |
| 1 1.0375E+01 6.4835E+00 1.9621E+00 2.4953E-02 1.9755E-02 0 |
| 2 9.3435E+00 7.2154E-01 1.8603E+00 2.3659E-02 1.9164E-02 0 |
| 3 1.8905E+00 2.1409E-01 1.8603E-02 2.3659E-04 4.0457E-03 0 |
| 4 7.3674E-01 9.6443E-02 8.9943E-03 1.1439E-04 7.5732E-04 0 |
| 5 1.3869E-02 1.4941E-03 8.9943E-05 1.1439E-06 1.9849E-05 0 |
| 6 1.3879E-04 1.4940E-05 9.0069E-07 1.1455E-08 1.9850E-07 0 |
| 7 3.7555E-04 1.7926E-07 2.6999E-09 1.7419E-10 4.3230E-07 0 |
| 8 0.0000E+00 4.2357E-09 1.3194E-08 2.8639E-13 1.6401E-08 0 |
| NOTE: The Interior Point solve time is 0.00 seconds. |
| NOTE: The CROSSOVER option is enabled. |
| NOTE: The crossover basis contains 0 primal and 0 dual superbasic variables. |
| Objective |
| Phase Iteration Value Time |
| P C 1 0.000000E+00 0 |
| P 2 2 1.347917E+03 0 |
| D 2 3 1.347917E+03 0 |
| P 2 4 1.347917E+03 0 |
| NOTE: The Crossover time is 0.00 seconds. |
| NOTE: Optimal. |
| NOTE: Objective = 1347.9166667. |
| NOTE: The data set WORK.EX1IPOUT has 8 observations and 10 variables. |
| NOTE: The data set WORK.EX1IDOUT has 6 observations and 10 variables. |
Last updated: April 14, 2021