Solve MixedIntegerLinearProgram for variables that are limited to the given set

25 views
Skip to first unread message

pegah Ali

unread,
Dec 11, 2014, 9:19:24 AM12/11/14
to sage-s...@googlegroups.com
Hello everybody,

I am new to sage and try to solve the following LP with MixedIntegerLinearProgram:

       
Maximization:
  3.0 x_0 + 2.0 x_1 - 1.0 x_2
Constraints:
  (x_0, x_1, x_2) in {(4.0,5.0,6.0), (1.0,2.0,3.0), (9.0,5.0,2.0)}

How can I define MixedIntegerLinearProgram to solve my problem? 

Thank you for your help
Regards

Dima Pasechnik

unread,
Dec 11, 2014, 10:51:00 AM12/11/14
to sage-s...@googlegroups.com
On 2014-12-11, pegah Ali <pegah.a...@gmail.com> wrote:
> ------=_Part_141_146171712.1418307564716
> Content-Type: multipart/alternative;
> boundary="----=_Part_142_2134155063.1418307564716"
>
> ------=_Part_142_2134155063.1418307564716
> Content-Type: text/plain; charset=UTF-8
First, you need to declare your variables integer; then
you can formulate your constraints on x_0 and x_1 as linear inequalities
(e.g. 4<=x_0<=6), but you'd have to work harder for x_2;
say, you can set x_2==9*x_3+5*x_4+2*x_5, and
further specify that x_3,4,5 are binary and sum up to 1.

HTH.

pegah Ali

unread,
Dec 11, 2014, 1:04:40 PM12/11/14
to sage-s...@googlegroups.com
Hello Dima,

Thank you for your response. It gave me some ideas :)
Reply all
Reply to author
Forward
0 new messages