4

How can I create constraints to make sure $x=1$ if $k\geq 0$ and $x=0$ if $k<0$, where $x\in \{0,1\}$ and $k\in \mathbb{R}$?

Here is my attempt: \begin{equation}\label{cons:1} \begin{aligned} k\leq Mx \end{aligned} \end{equation}

Considering $M$ as the big-M, the above constraint makes sure $x=1$ if $k>0$. Surely, it is missing all other components.

Kevin Dalmeijer
  • 6,167
  • 1
  • 17
  • 48
tcokyasar
  • 1,249
  • 5
  • 12

0 Answers0