Conditional Binary

Problems with modeling
Post Reply
Omi
User
User
Posts: 7
Joined: 2 months ago

Conditional Binary

Post by Omi » 2 months ago

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: 84
Joined: 3 years ago
Location: Fairfax, VA

Re: Conditional Binary

Post by dirkse » 2 months ago

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