Binary variables in AMPL

5,780 views
Skip to first unread message

aaaa

unread,
Aug 28, 2011, 3:11:32 AM8/28/11
to AMPL Modeling Language
Hi everyone,

I need your help re defining binary variables in ampl. I have a mixed
integer programming problem with the objective function in minimizing
the makespan and the constraints include two binary variables as
follows:

Xi,j,q = 1, if the order i is assigned to the qth position
at stage j
0, otherwise

Yj,q,m = 1, if the order in the qth position is assigned to
machine m at stage j
0, otherwise

so, how should i define these in ampl, any idea?
any help regarding this will be appreciated.

Paul

unread,
Aug 28, 2011, 5:51:44 PM8/28/11
to am...@googlegroups.com
set ORDER;
set STAGE;
set POSITION;
set MACHINE;
var X {i in ORDER, j in STAGE, q in POSITION} binary;
var Y {j in STAGE, q in POSITION, m in MACHINE} binary;

If you are asking how to write constraints that make the variables behave as you have indicated, that depends on the rest of your model.

Paul

Reply all
Reply to author
Forward
0 new messages