Given a continuous nonnegative decision variable $x\in [0,T]$ bounded by $T$, how can we enforce a relation between $x$ and another binary decision variable $y$ such that when $x$ is equal to its upper bound ($T$), $y$ must be one and otherwise $y$ must zero?
Asked
Active
Viewed 261 times
6
1 Answers
7
Let $\epsilon > 0$ be a small constant tolerance. The following linear constraints enforce $y=0 \implies 0 \le x \le T-\epsilon$ and $y=1 \implies x=T$: $$0(1-y) + Ty \le x \le (T-\epsilon)(1-y) + Ty$$
RobPratt
- 32,006
- 1
- 44
- 84