The OPTLP Procedure
Example 5.4 Reoptimizing after Modifying the Objective Function
Using the diet problem described in Example 5.3, this example illustrates how to reoptimize an LP problem after modifying the objective function.
Assume that the optimal solution of the diet problem is found and the optimal solutions are stored in the data sets ex3pout and ex3dout.
Suppose the cost of cheese increases from 8 to 10 per unit and the cost of fish decreases from 11 to 7 per serving unit. The COLUMNS section in the input data table ex3 is updated (and the data table is saved as ex4) as follows:
COLUMNS . . . . .
...
. ch diet 10 calories 106
...
. fi diet 7 calories 130
...
RHS . . . . .
...
ENDATA
;
You can use the following DATA step to create the data table ex4:
data mycas.ex4;
input _id_ field1 $ field2 $ field3 $ field4 field5 $ field6;
datalines;
1 NAME . EX3 . . .
2 ROWS . . . . .
3 N diet . . . .
4 G calories . . . .
5 L protein . . . .
6 G fat . . . .
7 G carbs . . . .
8 COLUMNS . . . . .
9 . br diet 2 calories 90
10 . br protein 4 fat 1
11 . br carbs 15 . .
12 . mi diet 3.5 calories 120
13 . mi protein 8 fat 5
14 . mi carbs 11.7 . .
15 . ch diet 10 calories 106
16 . ch protein 7 fat 9
17 . ch carbs .4 . .
18 . po diet 1.5 calories 97
19 . po protein 1.3 fat .1
20 . po carbs 22.6 . .
21 . fi diet 7 calories 130
22 . fi protein 8 fat 7
23 . fi carbs 0 . .
24 . yo diet 1 calories 180
25 . yo protein 9.2 fat 1
26 . yo carbs 17 . .
27 RHS . . . . .
28 . . calories 300 protein 10
29 . . fat 8 carbs 10
30 BOUNDS . . . . .
31 UP . mi 1 . .
32 LO . fi .5 . .
33 ENDATA . . . . .
;
You can use the BASIS=WARMSTART option (and the ex3pout and ex3dout data tables from Example 5.3) in the following call to PROC OPTLP to solve the modified problem:
proc optlp data=mycas.ex4
presolver = none
basis = warmstart
primalin = mycas.ex3pout
dualin = mycas.ex3dout
algorithm = primal
primalout = mycas.ex4pout
dualout = mycas.ex4dout
logfreq = 1;
run;
The following iteration log indicates that it takes the primal simplex algorithm no extra iterations to solve the modified problem by using BASIS=WARMSTART, since the optimal solution to the LP problem in Example 5.3 remains optimal after the objective function is changed.
Output 5.4.1: Iteration Log
| NOTE: The problem EX3 has 6 variables (0 free, 0 fixed). |
| NOTE: The problem has 4 constraints (1 LE, 0 EQ, 3 GE, 0 range). |
| NOTE: The problem has 23 constraint coefficients. |
| NOTE: The LP presolver value NONE is applied. |
| NOTE: The LP solver is called. |
| NOTE: The Primal Simplex algorithm is used. |
| Objective Entering Leaving |
| Phase Iteration Value Time Variable Variable |
| P 2 1 1.098034E+01 0 |
| NOTE: Optimal. |
| NOTE: Objective = 10.980335514. |
| NOTE: The Primal Simplex solve time is 0.00 seconds. |
| NOTE: The Cloud Analytic Services server processed the request in 0.167147 |
| seconds. |
| NOTE: The data set MYCAS.EX4POUT has 6 observations and 10 variables. |
| NOTE: The data set MYCAS.EX4DOUT has 4 observations and 10 variables. |
Note that the primal simplex algorithm is preferred because the primal solution to the original LP is still feasible for the modified problem in this case.