0

How to convert this one to a linear program:

if $x=1$ then $B=1$; otherwise, $B=0$.

If I use the Big M method: \begin{align}x&\ge1-M(1-B)\\x&\le1+M(1-B)\end{align}

A) with $B=1$: \begin{align}x&\ge1\\x&\le1\end{align} That is corresponding to $x=1$

B) with $B=0$: \begin{align}x&\ge1-M\\x&\le1+M\end{align} That is corresponding to any value of $x$ even $x=1$. How do I exclude $x=1$ when $B=0$?

Hussein Sharadga
  • 409
  • 1
  • 10

2 Answers2

0

I think the two constraints put in there, lead to the same thing, just change the sign of one of those and then add the two constraints, it will lead to $M \ge 0$. Assuming $x$ is continuous, then you need:
C1 = $B \ E \ [0,1] \ and \ z \le 0$: B is binary.
Choose U such that it's the upper bound for x
C2 = $Uz \le x$: z is <0 for x=99, z will remain <0 for x=-99 as U is larger than x and when x=1, z=0
C3 = $Uz+L(z-1) \ge (1-x)*(L-U)$: if x=1 z is forced to 0 due to C2, if x=99, z remains <0, if x=-99, z is again <0
C4 = $B \ge z+1$: z <0, B can be 0 but when z=0, B =1
and Choose $M \gt \lvert {x} \rvert+1$, $L$ is lower bound of $x$ and should be <0 and $U$ is upper bound of $x$ and >0

Sutanu Majumdar
  • 3,461
  • 1
  • 2
  • 11
-1

if x and B both are binary then x+B>=2 should work. this contriant is satisfactory only under one condition that is both x and B should be 1. for every other condition the constraint will be voilated.