Define restriction in a variable Topic is solved

Problems with modeling
Post Reply
Eduardo
User
User
Posts: 2
Joined: 6 years ago

Define restriction in a variable

Post by Eduardo »

Hello,
Could i put a restriction in a variable, depending the valor of the same variable?
I try to put:

Code: Select all

Binary Variable: x(i,k)
R(i,k)..    x(i,k)$(x(i,k) eq 1) =g= x(i,k+1);
But this code doesn't work. How can i do something like before?
I want that if x(1,1)=1 =>x(1,2)=1 or 0 but if x(1,1)=0=> x(1,2)=1 or 0. (Because if a put x(i,k)=g=x(i,k+1) always x(1,1) will be 1 and i don't want.)

Please, I'm very grateful of your help.
Best Regards
cladelpino
User
User
Posts: 108
Joined: 7 years ago

Re: Define restriction in a variable

Post by cladelpino »

Hola Eduardo.

What you are trying to accomplish is called disjunctive programming and is non trivial. Besides the theory to write that kind of constraints "on your own", there are some pre built solutions in GAMS. Checkout EMP:https://www.gams.com/latest/docs/usergu ... 1_2_3_0_13 and LogMIP: http://www.logmip.ceride.gov.ar/
Eduardo
User
User
Posts: 2
Joined: 6 years ago

Re: Define restriction in a variable

Post by Eduardo »

Thank you very much Cladelpino.
Your advice was very useful. But I couldn't get a good solution with COUNNEE solvers. I had to use SCIP solver although this only compile 1000 seconds (less than I need).
Post Reply