0

Is it possible to write the following if else condition in Linear Programming with big M method?

"if $x < 1$ then $x = 0$".

"$x$" is a positive variable.

PS: This is part of a bigger optimization problem where "x" should only appear if this is profitable but it should have a value no less than 1. Otherwise if should not exist ($x=0$)

SEMV09
  • 3
  • 1
    Is "a" part of the objective function or is it part of the constraint set? It may be better to state the the problem as Max Z=f(...) where .... – NoChance Nov 08 '18 at 10:30
  • "a" is part of the constraints. If I leave "a" as it is, the program maximizes the revenues but the variable "a" is giving me a number less than 0. However, I need to make it more than 1 if this variable appears in the solution. – SEMV09 Nov 08 '18 at 11:46

2 Answers2

0

How about this? Solve the problem twice, once with the constraint $a \geq 1$ and once with $a = 0$.

  • I was thinking that maybe the big M-method could be applied in this case. But I couldn't find the way of building the statements correctly – SEMV09 Nov 08 '18 at 11:48
  • @SEMV09, maybe you should include this in your original question. – NoChance Nov 08 '18 at 11:54
  • @NoChance, good point. I have just corrected this in the original question. Thanks :) – SEMV09 Nov 08 '18 at 13:43
0

Use $x$ (not $a$) for variables. The constraints are $x \geq My$ and $x \leq -(1+\varepsilon)y$, with $y$ binary variable and $M$ a lower bound on $x$.

LinAlg
  • 19,822
  • Thanks for your answer, I have corrected "x" on the original question. What about ε? – SEMV09 Nov 09 '18 at 09:43
  • @SEMV09 You cannot model $x<-1$ in linear optimization since you cannot use strict inequalities. You have to model it as $x \leq -(1+\varepsilon)$ for some small number $\varepsilon$. – LinAlg Nov 09 '18 at 13:28