Conditional Binary

Problems with modeling
Post Reply
Omi
User
User
Posts: 7
Joined: 4 years ago

Conditional Binary

Post by Omi »

How to code Binary Variable?
Y(I,t) 1 if ∑j T(j,I,t) + Z(I,t) >= 1,
0 Otherwise.

Thank you.
User avatar
dirkse
Moderator
Moderator
Posts: 214
Joined: 7 years ago
Location: Fairfax, VA

Re: Conditional Binary

Post by dirkse »

Omi,

To paraphrase your question, you ask "How can I have a condition iff a binary variable is 1", e.g. for a binary y

expression >= 1 implies y = 1
expression < 1 implies y = 0

This doesn't work well. Strict inequalities are not part of optimization for several reasons, e.g.:

http://yetanothermathprogrammingconsult ... ation.html

Instead, we go the other direction: if y = 1, we turn a constraint on, otherwise it isn't on, i.e. it is relaxed.

expression >= 1 - M * (1-y)

It's important to choose the M large enough so that expression >= 1 - M is satisfied for any feasible point, but no larger than necessary.

-Steve
Post Reply