The Linear Programming Solver |
The following example illustrates how you can use the OPTMODEL procedure to solve linear programs. Suppose you want to solve the following problem:
You can use the following statement to call the OPTMODEL procedure for solving linear programs:
proc optmodel; var x{i in 1..3} >= 0; max f = x[1] + x[2] + x[3] ; con c1: 3*x[1] + 2*x[2] - x[3] <= 1; con c2: -2*x[1] - 3*x[2] + 2*x[3] <= 1; solve with lp / solver = ps presolver = none printfreq = 1; print x; quit;
The optimal solution and the optimal objective value are displayed in Figure 8.1.
The iteration log displaying problem statistics, progress of the solution, and the optimal objective value is shown in Output 8.2.
|
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.