# Linearize equality constraint with binary variable

 0 I have an equality constraint like z(Ax-y)=0, where z>=0 ,and x is binary variable, and y is bounded variable Lx<=y<=Ux. How can it be linearized? Thanks in advance. asked 07 Jul '15, 16:58 zun 11●1 accept rate: 0%

 1 If $$y_1$$,$$y_2$$ are binary and $$M$$ is enough big then linear constraints are as follows. $\begin{cases} & -M\cdot y_1 & \leq z &\leq M\cdot y_1 \\ & -M\cdot y_2 & \leq A\cdot x - y &\leq M\cdot y_2 \\ & y_1+y_2 & \leq 1 & \end{cases}$ answered 09 Jul '15, 03:08 Slavko 205●1●5 accept rate: 12% That helps a great deal. Thanks for the answer. (13 Jul '15, 16:36) zun 1 You welcome! So please accept my answer :-) . (13 Jul '15, 17:25) Slavko
 0 We create constraints that exlude the possibility that both are non-zero. We have two cases, x=0 or x=1. If z is bounded by M it can be done by adding the constraint z<=M(1-x) If x=0 then we have no requirements on z, and as x=0 imply L0<=y<=U0 i.e. 0<=y<=0 and y=0, so Ax-y=0 and hence z(Ax-y)=0. If x=1 we obtain z<=M(1-1)=0 so z=0 as we had z>=0. This also implies z(Ax-y)=0. So if the constraint is included the equality constraint is satisfied. answered 12 Aug '15, 07:22 RuneR 19●2 accept rate: 0%
 toggle preview community wiki

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Tags:

×65
×37
×6
×6
×4