1
$\begingroup$

Good evening, I have the following problem. I want to create a duty roster and model performance losses. For this I have introduced the binary variable $l_{it}$, which takes the value 1 when the shift of a worker changes, e.g. from late to early shift. Now I have introduced the performance variable $p_{it}$, which starts from 1 and should deteriorate with changes of view. The performance should deteriorate by 0.1 from the second shift change, i.e. from the second time $l_{it}=1$. For each further time $l_{it}=1$ again by 0.1. How do I model the whole thing, so that it comes only from the second time to a loss. That would be my suggestion so far:

$$p_{it}=\begin{cases} p_{it_{-1}}-0.1\times l_{it}, & \text{if}~\sum_{t=2}^{t}l_{it}\ge 2~~~~\forall i\in I,\\ p_{it_{-1}}, & \text{else.} \end{cases} $$

In each period, for each worker, the sum of all $l_{it}$, starting from $t=2$ up to the current period, should be calculated. If this sum is $\ge2$, then the 1st case should occur, if not then the second. How do I model this? Or is my formulation correct?

$\endgroup$
2
  • 3
    $\begingroup$ Simul-posted to MO, mathoverflow.net/questions/447240/…. which is much frowned upon. $\endgroup$ Commented May 22, 2023 at 5:05
  • $\begingroup$ Cross-posting is (somewhat) acceptable if explicitly noted. $\endgroup$ Commented May 22, 2023 at 18:52

2 Answers 2

1
$\begingroup$

This is an answer to a modified version of the original problem (based on comments by the author). In the version I will address, a physician's efficient ($p$) starts at 1 and degrades by 0.1 for each shift change (captured by $\ell$) after the first, with two qualifications. The efficiency cannot go below 0, and three consecutive shifts without a change "resets" the efficiency to 1 and cancels the effect of any earlier shift changes (so that it takes two shift changes after the reset to degrade efficiency again). I assume that, from the objective perspective, higher efficiency is better.

I'm going to skip the physician subscript $i$ in what follows, and I'm going to introduce the following variables:

  • $\pi_t\in \lbrace 0,\dots,11\rbrace$ is the number of shift changes used to compute the efficiency penalty at time $t;$
  • $\rho_t$ is a binary variable taking value 1 if a reset occurs at time $t;$
  • $\mu_t$ is a binary variable taking value 1 if $\pi_t = 11,$ i.e., if the physician's efficiency at time $t$ has degraded to 0; and
  • $\sigma_t$ is a binary variable representing the product $\mu_{t-1} \times \ell_t$ (indicating that a shift change just occurred to a physician already at efficiency 0).

We add the following constraints:

  • $p_t \le 1$ (a physician's maximum efficiency is 1);
  • $p_t \le 1.1 - 0.1 \pi_t$ (the physician loses 0.1 efficiency per shift change that counts, with the first one harmless);
  • $\rho_t \le \ell_{t-k}$ for $\forall k \in \lbrace 0, 1, 2 \rbrace$ (a reset can occur only after three periods without a shift change);
  • $11 \mu_t \le \pi_t \le 10 + \mu_t,$ which enforces $\mu_t = 1 \iff \pi_t = 11$;
  • $\sigma_t \le \ell_t;\ \sigma_t \le \mu_{t-1};\ \sigma_t \ge \ell_t + \mu_{t-1} -1$ (which collectively enforce $\sigma_t = \mu_{t-1} \times \ell_t$);
  • $\pi_t \le 11(1 - \rho_t)$ (the shift change count is at most 11 and drops to 0 when a reset occurs);
  • $\pi_t \ge \pi_{t-1} + \ell_t - \sigma_t - 11 \rho_t$ (explained below).

The way to parse the last constraint is as follows. Assume, for the moment, no reset ($\rho_t = 0$). If $\pi_{t-1} < 11$ (implying $\mu_{t-1}=0$ and thus $\sigma_t = 0$), then the cumulative shift count $\pi_t$ will be $\pi_{t-1}$ plus 1 if the shift changed again ($\ell_t = 1$). If $\pi_{t-1} = 11$ ($\mu_{t-1}=1$), then $\sigma_t = \ell_t$ and $\pi_t = \pi_{t-1} = 11$ (the physician stays at full burnout). Note that under no circumstance is $\pi_{t-1} + \ell_t - \sigma_t > 11.$ Finally, if a reset occurs ($\rho_t = 1$), the right side of the last constraint is $\le 0,$ allowing $\pi_t$ to be 0 (which will be optimal) and thus $p_t = 1$ (the reset).

$\endgroup$
0
$\begingroup$

If I understand what you want, and if higher performance values are always more desirable, you can add the following constraints for all $i$ and $t:$ $$p_{i,t} \le 1$$ and $$p_{i,t} \le 1.1 - 0.1\cdot \sum_{\tau=2}^t \ell_{i,t}.$$

If, for some reason, lower performance values would improve the objective function (giving the solver an incentive to underestimate $p$), things get more complicated.

Addendum: This only works if we can be sure that at most 11 shift changes can occur over the planning horizon. Assuming $p_{i,t}$ is defined to be nonnegative, the second constraint will indirectly force $\sum_{\tau=2}^t \ell_{i,t} \le 11$ for all $t.$

$\endgroup$
7
  • $\begingroup$ Thank you very much. That really helped me a lot. Two more questions are still open. 1) How would i need to formulate that anwser that the calculated value will get assigned to every value for t and i? Because of the inequality the calculated value but not assigned to the respective $p_{it}$ or? How would I have to formulate it differently, so that I can use the conditions also for software like Gurobi? $\endgroup$ Commented May 22, 2023 at 15:13
  • $\begingroup$ 2) I also included a constraint that recovers the performance so to speak, whenever the last three periods passed by without a shift change. It looks like this. $ p_{it}=\begin{cases} 1, & \text{if}~\sum_{j=t-3}^{t-1}l_{it}=0~\forall i\in I,\\ p_{it_{-1}}, & \text{else.}\end{cases} $ As I understand it, their suggestion and my second constraint would not work together at the same time? Do you have any other idea how to model the second constraint? Thanks for your help! $\endgroup$ Commented May 22, 2023 at 15:18
  • $\begingroup$ I don't understand your first question. For the second question, are you saying that the performance coefficient reverts to 1 if the shift remains constant for three periods? (That was not part of the original question.) $\endgroup$ Commented May 22, 2023 at 15:41
  • $\begingroup$ I know it wasn't part of the question but I thought if I already have such a competent answerer across the street, I might as well ask it. Regarding question one. I think I mislabeled the whole thing with the constraints. I have an objective function with several constraints. Part of the objective function is the performance $p_{it}$. If this is smaller than 1, then this also flows into the objective function and the further away, the more of course. But for this I need the performance for each physician $i$ at each time $t$. $\endgroup$ Commented May 22, 2023 at 18:10
  • $\begingroup$ Suppose doctor 3 has already had two shift changes in period 4, with the second change having happened from periode 3 to 4. Accordingly, the sum is $\sum_{t=2}^{4}l_{3t}=2$. The performance is therefore $p_{34}=0.9$.If there is another change after period 5, then $p_{35}=0.8$ should be stored. These infos have to be assigned to the variable, so to speak, that I can use them in the objective function. My concern is that the values are assigned or stored, so to speak. I hope you understand the problem. $\endgroup$ Commented May 22, 2023 at 18:10

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.