1) 用LP过程求解线性规划
max z=-5*x1+5*x2+13*x3
-x1+x2+3*x3<=20
12*x1+4*x2+10*x3<=90
x1,x2,x3>=0
程序:
data lp1;
input _row_$ x1 x2 x3 _type_$ _rhs_;
cards;
object -5 5 13 max .
proc1 -1 1 3 le 20
proc2 12 4 10 le 90
;
proc lp;
run;
答案:*x1=0 *x2=20 *x3=0
2) 用LP过程求解整数线性规划
max 2*x1+3*x2
5*x1+7*x2<=35
4*x1+9*x2<=36
x1,x2>=0 x1,x2为整数
程序:
data lp1;
input _row_$ x1 x2 _type_$ _rhs_;
cards;
object 2 3 max .
proc1 5 7 le 35
proc2 4 9 le 36
bound 10 10 upperbd .
inbd 1 2 integer .