We're looking for a mathematical model code for our problem, to be written in Python.
Problem Definition
The management of a hospital's aim is to minimize nurses' total idle waiting time during a week planning horizon. To achieve this target; after a nurse works a shift, the same nurse can be assigned to another shift after two shifts at least. However, the company should be careful that the maximum total working time a week for each nurse is not exceeded.
Mathematical Programming Model
Indices:
i nurse index j=1,... TN
j shift index j=1dots,21()
Decision Variable:
x_(ij)={(1; if nurse i works shift j of a week planning horizon ),(0; otherwise ):}
Input Parameters:
WH: maximum total working time a week for a nurse
TN: total number of nurses in a hospital / health service
N_(j(max)) : maximum number of nurses worked shift 1
Model:
Objective Function:
Min[(WH**TN)-(8(sum_i sum_j x_(ij)))]
Subject to:
8(sum_j x_(ij))<=WH
AAi
{[sum_(j=1)^3 x_(ij)<=1],[sum_(j=2)^4 x_(ij)<=1],[vdots],[sum_(j=19)^(21) x_(ij)<=1]}
AAi
N_(j(min))<=sum_i x_(ij)<=N_(j(max)),AAj
x_(ij)in{0,1},AAi,j
Data
Table 1 The minimum number of nurses worked shift j for a week planning
horizon (value of N_(j(min)) )
Table 2 The maximum number of nurses worked shift j for a week planning
horizon (value of N_(j(max)) )
Problem Definition
The management of a hospital's aim is to minimize nurses total idle waiting time during a week planning horizon. To achieve this target; after a nurse works a shift, the same nurse can be assigned to another shift after two shifts at least. However, the company should be careful that the maximum total working time a week for each nurse is not exceeded.
Mathematical Programming Model Indices: i nurse index j shift index j=...1 Decision Variable: IA Table 2 The maximum number of nurses worked shift j for a week planning horizon (value of N(max) Shifts of Shifts ef Shifts of Shifts of Shifhs ef Shits ef Shifts of day-1 day-2 day-3 day-4 day-5 day-6 day-7 j=1,2,3 j=4,5,6 j=7,8,9 j=10,11,12 j=13,I4,15 j=16,17,1$ j=19,20,21 1; if nurse i works shift j of a week planning horizon 0; otherwise N(mia N(max TA Maximum namber of 3 marses for each shift 4 4 2 4 4 2 2 - 1 Input Parameters: WH: maximum total working time a week for a gurse TN: total number of nurses in a hospital / health service N(min: minimum number of nurses worked shift j N((max): maximum number of nurses worked shift j 1 - - 3 2 xy{0.1} T'TA 2 3 Data horizon(value of Njmin Shits of Shifa of Shifs of Shifs of Shifs of Shifs of Shifs of Shifs of danasl dans2 davaS y.3ay j=1,2,3 je4,5,6 j=7,8,9 j=10,11,12j=13,14,15j=16,17,18j19,0,21 Model: Obfective Function Mm(WHTN)-s Minimsm 3 sumber of 2 urses for each thift 1 3 3 t 4 2 1 3 2 1 1 : 1 1 2 1 1 2