Answers to: How to linearize an indicator equality constraints?http://www.or-exchange.com/questions/15294/how-to-linearize-an-indicator-equality-constraints<p>Let \(x_i\) be binary variables and \(a_i\) given positive integers.</p>
<p>I have an equality constraint like the following
\[x_i\left(\sum_{j=1}^nx_{j}\right)=a_ix_i,\] for all \(i\). </p>
<p>This means that if \(x_i=1\), then there must exists a set \(S\) with cardinality \(|S|=a_i-1\) such that \(x_j=1\) for all \(j\in S\).</p>
<p>How can I linearize these constraints? If the constraints were of type inequality I could use a large (or small) number and write it as:</p>
<p>\[\left(\sum_{j=1}^nx_{j}\right)\leq a_ix_i+M(1-x_i),\] for all \(i\). </p>enThu, 18 Jan 2018 11:21:25 -0500Answer by Rob Pratthttp://www.or-exchange.com/questions/15294/how-to-linearize-an-indicator-equality-constraints/15296<p>Hint: Think of your equality as two inequalities and apply your big-M approach twice.</p>
<p>Also, for numerical reasons be sure to choose \(M\) as small as possible.</p>Rob PrattThu, 18 Jan 2018 11:21:25 -0500http://www.or-exchange.com/questions/15294/how-to-linearize-an-indicator-equality-constraints/15296