Indicator constraints cplex Topic is solved

Problems with syntax of GAMS
Post Reply
Janisch
User
User
Posts: 38
Joined: 3 years ago

Indicator constraints cplex

Post by Janisch »

Hello all,

I am currently failing to convert a BigM formulation into an Indicator Constraint for CPLEX.

Code: Select all

*old one
Constraint1(p,s,m,i,j)$(p_s(p,s) AND f_c_r(s,m,i,j))..
                    x(p,s,m,i,j) =l= y(p,s,m,i,j)*BigM;

*new one
Constraint1(p,s,m,i,j)$(p_s(p,s) AND f_c_r(s,m,i,j))..
                    x(p,s,m,i,j) =l= 0;

$Onecho > cplex.opt
threads=0
indic Constraint1$y(p,s,m,i,j) 0
$Offecho


*=== Model name
MODEL example /all/;
all.optfile = 1
But something is still wrong with the syntax. Can someone give me a hint?

Many greetings
Janisch
Fred
Posts: 373
Joined: 7 years ago

Re: Indicator constraints cplex

Post by Fred »

Hi,

you have to provide the domain for the equation and the variable. I suggest to try

Code: Select all

$Onecho > cplex.opt
threads=0
indic Constraint1(p,s,m,i,j)$y(p,s,m,i,j) 0
$Offecho
I hope this helps!

Fred
Janisch
User
User
Posts: 38
Joined: 3 years ago

Re: Indicator constraints cplex

Post by Janisch »

Awesome! Thank you :)
Post Reply