Binding an integer variable to a real variable through a linear constraint

49 Views Asked by At

Suppose we have a problem where there is a variable $v\in R$ such that $v\ge 0$ and a variable $y\in Z$ such that $y\in \{0,1\}$.

I want to set up a linear restriction such that $y=1$ iff $v>0$.

How can I do that?


Half hearted attempt:

If we have an additional constraint that $v < M$ for some constant $M$, then we can set up the two following constraints:

  1. $\frac{v}{M} - y \le 0$
  2. $y - v < 1$

These constraints are not exactly what I am looking for because a) $v$ is not upper bounded in my problem and b) I cannot use integer programming techniques when there are strict equalities involved.

Hopefully this illustrates what I am after though.