6

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?

Kuifje
  • 13,324
  • 1
  • 23
  • 56
A. H
  • 147
  • 2

1 Answers1

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