I'm trying to model the scheduling of maintenance in some machines, and was wondering how I could ensure that, if maintenance is planned to start in period $t$, then it has to be carried out until period $t+k-1$, where $k$ is the duration of maintenance. This maintenance is not a one time thing, multiple maintenance actions are possible.

If $m_t$ is a binary variable saying that maintenance is scheduled in period t, then what I want is similar to:

$$m_t = 1 \implies \sum_{i=-k+1}^{i=k-1} m_{t+i} = k, \forall t>k$$

But this does not model what I want, since the 1's have to be consecutive, but beyond that, I do not wish to use logical constraints and would rather avoid their direct linearizations, if possible. Is there a way to efficiently model this sort of thing? It does not need to be linear.


1 Answer 1


Following @prubin's link in the comments, I reached Erwin Kalvelagen's blog, which seems to answer my question.

A way to model this would be:

$$ \sum_{i=t}^{t+k-1}m_{i} \geq k(m_{t}-m_{t-1}), \forall t $$

$$ \sum_{i=t}^{t+k}m_{i} \leq k,\forall t $$

It is still forbidding two consecutive maintenance actions, but it does not matter much in my model.


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.