Page 1 of 1

How to use non-binary variable in a conditional statement MILP

Posted: Wed Jan 09, 2019 2:08 pm
by charlesuko
I have a conditional statement I want to implement in a MILP. A is a non-binary variable that has known upper and lower bounds. B is a known parameter. And C is a binary variable. How do I formulate the condition?

If A < B then C is 1 otherwise C is 0 or 1.

Is this possible? I am new to optimization using GAMS and i'm still figuring out how this works

Re: How to use non-binary variable in a conditional statement MILP

Posted: Wed Jan 09, 2019 3:37 pm
by bussieck
Similar questions have been asked before. Search for "logic constraints" or "williams" (that's a name of an author for a book that teaches that). So here only a short answer: A<B => C=1 is equivalent to C=0 => A>B. This we can do with a linear constraint (and binary variable C): A > B - (B-A.lo)*C. If C=0 then A>B, if C=1 then A>A.lo which is a redundant constraint.

-Michael