# Ensure that scheduled repeating maintenance has to be completed

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.

– prubin
Feb 15, 2022 at 19:34
• @prubin, thank you very much, I hadn't found that question! A lot more troublesome than I thought! Feb 15, 2022 at 20:07
• @Dionisio I answered to a very similar question yesterday here: or.stackexchange.com/questions/7845/… Feb 16, 2022 at 10:10

$$\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$$