Using conditional statements for CPLEX resolver

82 views
Skip to first unread message

Paul

unread,
May 11, 2013, 6:10:18 PM5/11/13
to am...@googlegroups.com
To answer the question, we need to know which symbols are variables and which are parameters.

Paul

unread,
May 12, 2013, 7:38:04 PM5/12/13
to am...@googlegroups.com
Try the following (in which I assume that f is a binary variable):

subject to c1a {k in K, o in O, n in N: n!=t[k,o]}:
(f[n,o]==1) ==>
sum{e in E}
(a[n,e]*x[e,k,o]) -
sum{e in E}
(b[n,e]*x[e,k,o]) =
(if r[n,k]==1
then d[k,o]*(1-f[k,o])
else 0);

subject to c1b {k in K, o in O, n in N: n!=t[k,o]}:
(f[n,o]==0) ==>
sum{e in E}
(a[n,e]*x[e,k,o]) -
sum{e in E}
(b[n,e]*x[e,k,o]) = 0;

The ==> operator is used to create an indicator constraint (if expression-involving-variables is true then constraint holds else constraint need not hold).

Paul

Reply all
Reply to author
Forward
0 new messages