2

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.

SecretAgentMan
  • 1,895
  • 2
  • 13
  • 39
J. Dionisio
  • 534
  • 2
  • 14
  • 1
    Answers to this question would apply to your case: https://or.stackexchange.com/questions/7403/how-to-construct-my-mixed-integer-programming-problem-with-constraint-of-minimum. – prubin Feb 15 '22 at 19:34
  • @prubin, thank you very much, I hadn't found that question! A lot more troublesome than I thought! – J. Dionisio Feb 15 '22 at 20:07
  • 1
    @Dionisio I answered to a very similar question yesterday here: https://or.stackexchange.com/questions/7845/minimum-up-time-for-a-machine-in-a-linear-program – PeterD Feb 16 '22 at 10:10

1 Answers1

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.

SecretAgentMan
  • 1,895
  • 2
  • 13
  • 39
J. Dionisio
  • 534
  • 2
  • 14