## Mixed integer Linear Programing

Hello

I am getting optimal feasible solution as 31250 with decision variable values 0, 7.5 and 20.

proc optmodel;
var x{1..3}>=0;
max z=900*x+1500*x+1000*x;
con c1: 50000*x+12000*x+8000*x<=250000;
con c2: 1*x+0*x+0*x<=4;
con c3: 0*x+1*x+0*x<=15;
con c4: 0*x+0*x+1*x<=20;
solve with milp/presolver=none;
print x x x;
quit;

x1,x3>=0 or integer

x2>=0.

But in excel it is given as 42,250 optimal feasible solution with decision variable values 4, 4.16,0. Please help if I am going wrong.

1 ACCEPTED SOLUTION

Accepted Solutions

## Re: Mixed integer Linear Programing

You have not specified any integer variables.  Use the INTEGER option in the VAR statement and then the .RELAX suffix to relax x.  Also, you need not enter the zero coefficients explicitly.  In fact, you can avoid those last three constraints by instead using the .UB variable suffix:

``````proc optmodel;
var x{1..3}>=0 integer;
x.relax = 1;
max z=900*x+1500*x+1000*x;
con c1: 50000*x+12000*x+8000*x<=250000;
x.ub = 4;
x.ub = 15;
x.ub = 20;
solve with milp/presolver=none;
print x;
quit;``````

If you change the objective coefficient for x from 900 to 9000, you do get an optimal objective value of 42,250.

## Re: Mixed integer Linear Programing

You have not specified any integer variables.  Use the INTEGER option in the VAR statement and then the .RELAX suffix to relax x.  Also, you need not enter the zero coefficients explicitly.  In fact, you can avoid those last three constraints by instead using the .UB variable suffix:

``````proc optmodel;
var x{1..3}>=0 integer;
x.relax = 1;
max z=900*x+1500*x+1000*x;
con c1: 50000*x+12000*x+8000*x<=250000;
x.ub = 4;
x.ub = 15;
x.ub = 20;
solve with milp/presolver=none;
print x;
quit;``````

If you change the objective coefficient for x from 900 to 9000, you do get an optimal objective value of 42,250.

Discussion stats