hello, 

how are you?

I want to know how to solve the IP (not normal LP problem,but the problem whose 
result is Integer)?

I have made the model as follow:

 

#problem.mod

#variables
var x1 >= 0;
var x2 >= 0;
#objective
maximize z: 3*x1 + 2*x2;
#constraints
s.t. firstCondition: 2*x1 + 3*x2 <= 14;
s.t. secondCondition: 2*x1 + x2 <= 9;
end;

 

but when I type :glpsol -m problem.mod -o result

 

the final result is 14.75 but not a interger

can you help me?

thank you!





°Ù Íò Íæ ŒÒ ͬ Íæ µÄ ÀÖ Ô°£¬ÈË Æø ±¬ ·¢ µÄ ÃÎ »Ã Î÷ ÓÎ  
hello,
how are you?
I want to know how to solve the IP (not normal LP problem,but the problem whose result is Integer)?
I have made the model as follow:
 
#problem.mod
#variables
var x1 >= 0;
var x2 >= 0;
#objective
maximize z: 3*x1 + 2*x2;
#constraints
s.t. firstCondition: 2*x1 + 3*x2 <= 14;
s.t. secondCondition: 2*x1 + x2 <= 9;
end;
 
but when I type :glpsol -m problem.mod -o result
 
the final result is 14.75 but not a interger
can you help me?
thank you!



°Ù Íò Íæ ¼Ò ͬ Íæ µÄ ÀÖ Ô°£¬ÈË Æø ±¬ ·¢ µÄ ÃÎ »Ã Î÷ ÓÎ
_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to