Dear All: I am trying to develop equivalent linear constraints for the following if then condition: if z=m then x=1, otherwise x=0; where z is an integer variable, x is a binary variables & m is a parameter. Any suggestion is highly appreciated. Thanks. Noor asked 30 Jan '15, 22:46 noorbuet 
Assume that \(L\le z \le U\). Let \(y_1\) and \(y_2\) be new binary variables, and consider the constraints \[z \le (m1)y_{1}+mx+Uy_{2}\] \[z \ge Ly_{1}+mx+(m+1)y_{2}\] \[x+y_{1}+y_{2} = 1.\] I think that does what was requested. answered 31 Jan '15, 17:11 Paul Rubin ♦♦ Dear Professor Rubin: In my case, the lower bound for z is 0, and in that case the above set of constraints are not serving the purpose. Could please give more advise on this. Thanks.
(03 Feb '15, 21:18)
noorbuet
Update: I have made the followoing changes, and seems working now: z+1<=my1+(m+1)x+Uy2 z+1>=y1+(m+1)x+(m+2)y2 x+y1+y2=1
(03 Feb '15, 23:11)
noorbuet
1
Your changes do not allow z to take the value U. If you replace U with (U+1) to fix this, your formulation is equivalent with Paul Rubins answer. I do not see why it would fail if L=0 (or when L < 0).
(04 Feb '15, 08:42)
optimizer

It would be great to know if you are going to minimize or maximize \(x\) and \(z\). In any case, you can construct socalled "BigM" constraints of the form \(\text{M} (1  x) \ge z  m\) \(\text{M} (1  x) \ge m  z\) to force x to be zero if z and m are different (M is a large enough number, derived from the constraints of z). These kinds of constraints are usually bad for Branch&X solving methods because the LP relaxation is poor. 1
It is worth noting that these constraints enforce only one half of the requested implication. Maybe that is all @noorbuet really wanted, but these constraints do allow \(z=m\) with \(x=0\).
(31 Jan '15, 07:46)
Rob Pratt
Yes. I hoped that noorbuet would point out the maximizing/minimizing direction to make it easier to provide sensible constraints.
(31 Jan '15, 13:03)
JF Meier

Thanks all. I need to both maximize and minimize my objective function.