0
$\begingroup$

I have this constraint which ensures that there are at least $F$ consecutive days off. F.e. for $F=2$, an 1-0-1 is prevented.

$$1+y_{it}\ge y_{i(t-1)}+y_{ik}~\forall i\in I, t\in\left\{ 2,\ldots,T- {F}+1 \right\}, k\in \left\{ t+1,\ldots,t+{F}-1 \right\}$$

I also have two constraints that ensures a minimum ($W$)/maximum ($A$) number of consecutive work days. Is it possible to change my first constraint to a work on, using a summation as in the second constraints?

$$\sum_{j=t}^{t+A}y_{ij}\le A~\forall i\in I,t\in \{1,\ldots,T - A\}$$ $$\sum_{j=t+1}^{t+W}y_{ij}\ge {W}\cdot(y_{i(t+1)}-y_{it}\forall i\in I, t\in \{1, \ldots, \mid T \mid - {W}\}$$

$x_{ijt}$ and $y_{it}$ are binary variables. $x_{ijt}$ indicates a shift assignment, $y_{it}$ whether a worker works on a day or not. For this $$\sum_{j\in J} x_{ijt}=y_{it}\forall i\in I, t\in T$$ holds. $I$ is the set of worker, $J$ of the shifts and $T$ the days.

$\endgroup$
9
  • $\begingroup$ Did you mean to say that $A$ is the maximum number of consecutive work days? $\endgroup$
    – prubin
    Commented Jun 10 at 15:27
  • $\begingroup$ Your first constraint says that if worker $i$ works on day $t-1$ and also on any day from $t+1$ ot $t+F-1$ then they must also work on day $t.$ How does that ensure any days off? $\endgroup$
    – prubin
    Commented Jun 10 at 15:30
  • $\begingroup$ @prubin Sorry, I misstated the question. I just updated it. $\endgroup$
    – Karl Seidl
    Commented Jun 10 at 16:14
  • $\begingroup$ Your second constraint says that a worker cannot work $A+1$ consecutive days. How does that translate to ensuring a minimum number of consecutive work days? $\endgroup$
    – prubin
    Commented Jun 10 at 17:35
  • $\begingroup$ It does not. I just wanted to provide an example, on how the new constraint should kind of look like. I kind of want to utilize a sum--formulation, rather than using another index with another $\forall$ approach. $\endgroup$
    – Karl Seidl
    Commented Jun 10 at 17:47

1 Answer 1

0
$\begingroup$

Maybe try something like:

$$\sum_{j=t}^{t+F-1}(1-y_{ij})\geq F\cdot (y_{i(t-1)}-y_{it})\quad \forall i\in I, t\in \{2,\ldots,T-F+1\}$$.

$\endgroup$
5
  • $\begingroup$ This does not prevent $y\equiv1$ (working every day). $\endgroup$
    – RobPratt
    Commented Jun 10 at 21:39
  • $\begingroup$ If the OP also has a constraint which places an upper bound on consecutive working days?! $\endgroup$
    – mingabua
    Commented Jun 10 at 21:45
  • $\begingroup$ According to the comments, the OP's second constraint is not part of the problem but is instead is an example of the form of constraint he wants (an aggregation like yours). $\endgroup$
    – RobPratt
    Commented Jun 10 at 21:48
  • $\begingroup$ I indeed have both the second from the OP aswell as an upper limit in my model. Would the proposed answer work in this case? $\endgroup$
    – Karl Seidl
    Commented Jun 10 at 21:54
  • $\begingroup$ @RobPratt I updated the OP. Does mingabua's answer work in this case? $\endgroup$
    – Karl Seidl
    Commented Jun 11 at 7:10

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.