Suppose $0\le x \le 1$ is a decision variable and $\gamma(x)$ is defined as follows: $$ \gamma(x)= \begin{cases} \theta & x>0\\ 0 & x=0 \end{cases} $$ where $0\le \theta\le 1$.

In my model, I have both $\gamma(x)$ and $x \gamma(x)$ and I want to convert them to linear programs. I used the following constraints: \begin{align} \Gamma&\ge \theta x - (1- y ) \\ \Gamma&\le y \\ \gamma&=\theta y \\ y &\ge x \end{align}

Here, the problem is that $x$ can take value 0 and then, $\gamma = \theta$ at the same time. I can add the constraint $y \le 10000 x$, but it is will exclude some parts of the solution space.


You need a tolerance $\epsilon>0$, and you can strengthen your first two inequality constraints: \begin{align} \Gamma &= \theta x \\ \gamma &= \theta y \\ \epsilon y \le x &\le y \end{align}

  • $\begingroup$ Thanks. I tried it but there is a problem. My model tends to maximize $\gamma$. So, it set $x=\epsilon$ to make $y=1$. However, based on logics, it should not do this. $\endgroup$
    – Katatonia
    Aug 20 '21 at 1:11
  • 3
    $\begingroup$ Maybe your $\epsilon$ is not big enough to be considered "really" positive. $\endgroup$
    – RobPratt
    Aug 20 '21 at 1:33

There is no perfect fix for this, since strict inequalities are not supported in MILP models. So you will have to either live with the ambiguity when $x=0$ or exclude a portion of the solution space.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.