Answers to: Inequality Constraint in a Linear Program (with a constant RHS)http://www.or-exchange.com/questions/15604/inequality-constraint-in-a-linear-program-with-a-constant-rhs<p>Is it possible to forbid a LP variable from being a specific constant?</p>
<p>ex X <> 0.5</p>enThu, 26 Apr 2018 15:49:21 -0400Answer by AndyThttp://www.or-exchange.com/questions/15604/inequality-constraint-in-a-linear-program-with-a-constant-rhs/15614<p>Instead of solving one LP, you can solve two:</p>
<ol>
<li>original LP & x <= 0.5 - \epsilon</li>
<li>original LP & x >= 0.5 + \epsilon</li>
</ol>
<p>For a suitable \epsilon value, as per Sune's suggestion. You can then process the solutions accordingly (e.g. compare the two solutions, to see which one is actually optimal based on the two objective function values). As long as you have one or a few such variables, this approach should work.</p>AndyTThu, 26 Apr 2018 15:49:21 -0400http://www.or-exchange.com/questions/15604/inequality-constraint-in-a-linear-program-with-a-constant-rhs/15614Comment by gtg489p on Sune's answerhttp://www.or-exchange.com/questions/15604/inequality-constraint-in-a-linear-program-with-a-constant-rhs#15606<p>That's unfortunate. Adding a binary var would defeat the purpose for me, because formulation is itself an LP relaxation of a MIP.</p>
<p>I guess I could still give it a try; the LP relaxation with those few binary variables may solve much faster than the original IP, maybe even as fast as the pure LP relaxation.</p>gtg489pWed, 25 Apr 2018 13:44:18 -0400http://www.or-exchange.com/questions/15604/inequality-constraint-in-a-linear-program-with-a-constant-rhs#15606Answer by Sunehttp://www.or-exchange.com/questions/15604/inequality-constraint-in-a-linear-program-with-a-constant-rhs/15605<p>No. But you can (at the cost of adding a binary variable) enforce that x is either below \(0.5-\varepsilon\) or above \(0.5+\varepsilon\) where \(\varepsilon>0\) is a small <em>tolerance</em>.</p>SuneWed, 25 Apr 2018 13:28:32 -0400http://www.or-exchange.com/questions/15604/inequality-constraint-in-a-linear-program-with-a-constant-rhs/15605