4

I have a problem where I have a continuous decision variable (let's call it $m$) that is bounded between $(0, T]$ where $T>0$ is a predefined parameter. I also have another binary decision variable (let's call it $x$) that I want to use to represent whether $m > Z$ for $Z \in (0, T)$.

So in summary, if $m < Z$, then $x = 0$ and if $m\ge Z$, then $x=1$.

How can I enforce such relation in my program?

SecretAgentMan
  • 1,895
  • 2
  • 13
  • 39
A. H
  • 147
  • 2

1 Answers1

5

$m<Z \Rightarrow x=0$ can be modelled as $m\geq Zx$: if $m<Z$ there is only one feasible value for binary $x$, namely $0$. If $m\geq Z$, $x$ can be both 0 and 1.

$m\geq Z\Rightarrow x=1$ is the same as $x=0\Rightarrow m<Z$. This can be modelled (for a small $\epsilon>0$) as $m\leq T-(T-Z+\epsilon)(1-x)$: If $x=0$ then $m\leq Z-\epsilon$. If $x=1$ we have $m\leq T$ which is always true.

Sune
  • 6,457
  • 2
  • 17
  • 31