3
$\begingroup$

Some modeling languages and solvers support indicator constraints of the form $$y=\hat{y} \implies \sum_j a_j x_j \le b,$$ where $y$ is a binary decision variable and $\hat{y}\in\{0,1\}$ is a constant. How do I enforce a more general logical implication $$\sum_j a_j x_j \le b \implies \sum_j c_j x_j \le d?$$

$\endgroup$

1 Answer 1

7
$\begingroup$

You can accomplish this by introducing a binary decision variable and splitting into two implications: \begin{align} \sum_j a_j x_j \le b &\implies y = 1 \tag1\label1 \\ y = 1 &\implies \sum_j c_j x_j \le d \tag2\label2 \end{align} Constraint \eqref{2} is already an indicator constraint. To rewrite \eqref{1} as an indicator constraint, use its contrapositive $$y = 0 \implies \sum_j a_j x_j > b,$$ which you can model as $$y = 0 \implies \sum_j a_j x_j \ge b + \epsilon$$ for some small constant tolerance $\epsilon > 0$. If $\sum_j a_j x_j$ and $b$ are integer-valued, you can take $\epsilon=1$.

Now either use the indicator constraints directly or linearize via big-M: \begin{align} b + \epsilon - \sum_j a_j x_j &\le M_1 y \\ \sum_j c_j x_j - d &\le M_2 (1-y) \end{align}

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.