MILP code for maximisation
Show older comments
How to maximise the following:
(a*100)+(b*60)+(c*70)+(d*65)+(e*50)+(f*50)+(g*45)+(h*40)+(i*40)+(j*30)
with a constraint:
(a*61)+(b*28)+(c*33)+(d*30)+(e*25)+(f*17)+(g*25)+(h*12)+(i*16)+(j*10) is less than or equal 110.
knowing that a-j are either 0 or 1.
I tried to solve it using this code:
f = [100;60;70;65;50;50;45;40;40;30];
intcon = 10;
A = [61,28,33,30,25,17,25,12,16,10];
b = [110];
x = intlinprog(f,intcon,A,b)
but I got the following error:
>> tod308
Root LP problem is unbounded.
Intlinprog stopped because the root LP problem is unbounded.
x =
[]
Answers (1)
Categories
Find more on Linear Programming and Mixed-Integer Linear Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!