7

I am looking for the formulation of a constraint that does the following. I want to introduce a new binary variable $\kappa_{it}$ that takes the value 1 if the sum of the other binary variable $\omega_{it}$ is greater than or equal to the number $N_{\max}$ by time $t$. Otherwise, it is to become zero. My suggestion would be:

$$ \sum_{k=1}^{t}\omega_{ik}\le N_{\max} + M \cdot \kappa_{it}\\ N_{\max}+\mu\le\sum_{k=1}^{t}\omega_{ik}+\left( 1-\kappa_{it} \right) \cdot M $$

where $\mu$ is a small value. Is that correct?

nflgreaternba
  • 99
  • 1
  • 8

1 Answers1

7

You want to enforce $$ \sum_{k=1}^t \omega_{ik} \ge N_{max} \iff \kappa_{it}=1 $$ Or equivalently \begin{align} \left( \kappa_{it}=1 \implies \sum_{k=1}^t \omega_{ik} \ge N_{max} \right) \wedge \left( \kappa_{it}=0 \implies \sum_{k=1}^t \omega_{ik} \le N_{max}-1\right) \end{align}

You can enforce this with big-M constraints: $$ N_{max}\kappa_{it} \le \sum_{k=1}^t \omega_{ik} \le N_{max}-1+(t+1-N_{max})\kappa_{it} $$

Kuifje
  • 13,324
  • 1
  • 23
  • 56