MEDICAL STAFF SCHEDULING USING SIMULATED ANNEALING

Purpose: The efficiency of medical staff is a fundamental f eature of healthcare facilities quality. Therefore the better implementa tion of their preferences into the scheduling problem might not only rise the work -life balance of doctors and nurses, but also may result into better patient car e. This paper focuses on optimization of medical staff preferences consideri ng the scheduling problem. Methodology/Approach: We propose a medical staff scheduling algorithm based on simulated annealing, a well-known method f rom statistical thermodynamics. We define hard constraints, which a re linked to legal and working regulations, and minimize the violations of soft constraints, which are related to the quality of work, psychic, and work-l ife balance of staff. Findings: On a sample of 60 physicians and nurses from gynec ology department we generated monthly schedules and optimized their pr ferences in terms of soft constraints. Our results indicate that the final va ue of objective function optimized by proposed algorithm is more than 18-tim es better in violations of soft constraints than initially generated random sc hedule that satisfied hard constraints. Research Limitation/implication: Even though the global optimality of final outcome is not guaranteed, desirable solutionwas ob tained in reasonable time. Originality/Value of paper: We show that designed algorithm is able to successfully generate schedules regarding hard and soft constraints. Moreover, presented method is significantly faster than stand ard schedule generation and is able to effectively reschedule due to the local nei ghborhood search characteristics of simulated annealing.


INTRODUCTION
Medical staff performance represents a significant determinant of public healthcare quality.Regarding the pressures to cost reduction, a small number of employed doctors and nurses negatively influences their work-life balance and often results into a decrease of demanded quality of services, since they often have to take consecutive shifts, or cannot take a day-off.Moreover, due to the challenging economic conditions, not only a growing number of doctors and nurses from public hospitals have migrated abroad, but lot of them are also employed in private healthcare organizations in order to reach higher salaries.This tendency has caused the critical issue in medical staff preferences, when mostly senior doctors have more than one professional obligations and add constraints into the scheduling process.The adequate satisfaction of medical staff is the fundamental part in providing the necessary care for patients (Szabo et al. 2013).Therefore the optimal implementation of their preferences into the scheduling problem not only increases the quality of life and work-life balance of physicians and nurses, but also leads to better patient care, what is a crucial part of public healthcare facility management.
Focusing on the importance of scheduling problem, Wong et al. (2014) developed a spreadsheet-based two-stage heuristic approach for the nurse scheduling problem in a Hong Kong emergency department.Even though they had not guaranteed the optimality, their approach obtained good solutions in reasonable time.On the other hand, Chern et al. (2008) focused on the problem of health examination scheduling.They introduced an efficient heuristic algorithm in order to minimize examinee as well as doctor waiting time.Considering the surgical suite occupation and the number of surgeries scheduled, Marques et al. (2014) proposed a population based heuristic to solve an elective surgery scheduling task applied to real case instances.Their results indicated that developed method improved the quality of the surgical plans in light of the intervention date, operating room and starting time for elective surgeries, and required fewer resources to the construction of the plans.Heuristic techniques to improve surgical schedules were also presented by Fei et al. (2010), Liu et al. (2011), andRiise andBurke (2011).Vijayakumar et al. (2013) addressed a surgical case scheduling problem as an unequal-sized, multi-bin, multidimensional dual bin-packing problem.They developed a mixed integer programming model and a heuristic based algorithm to generate implementable schedules by time-of-day and day-of-week, while considering various resource constraints.They argued that proposed scheduling method provided an efficient tool to trade-off the patient satisfaction related to wait time and the cost effectiveness obtained through pooling.Focusing on patient admission scheduling problem, Range et al. (2014) followed the work of Demeester et al. (2010) and introduced method based on column generation.They incorporated dynamic constraint aggregation into the approach in order to efficiently handle the large master problem of the method.Bruni and Detti (2014) developed a flexible mixed integer linear programming formulation of the physician scheduling problem that allowed easy modifications for representing different situations and scenarios regarding contractual agreements, service requirements, and medical staff preferences.
In this paper, we aim at optimization of medical staff preferences considering the scheduling problem using one of the statistical thermodynamics methodssimulated annealing (SA).The remainder of this work is organized as follows.Section 2 describes principles of simulated annealing and medical staff scheduling, section 3 presents our empirical findings, while section 4 concludes the paper.

METHODOLOGY
Simulated Annealing represents one of the most flexible and useful metaheuristic techniques for global optimization.It is often applied to solve complex issues without any explicit assumptions on data, or optimized function.It emulates the annealing process in metallurgy, where a substance is heated to very high temperature and subsequently cooled in order to create superior crystals.The characteristics of final form is a matter of various annealing parameters, such as cooling schedule, or primary temperature.In case the initial temperature is too low, the substance might not achieve the ideal crystal state, or thermal equilibrium, i.e. the state with minimal energy as depicted in Figure 1.

Figure 1 -Perfect crystal with minimum energy
Based on statistical mechanics, Metropolis et al. (1953) designed an algorithm that emulates the changes of energy in a substance in order to measure its characteristics.Following the statistical distribution, individual particles of every mass have different amounts of energy.The fundamental (lowest) level of energy represents the state in which all particles occur at temperature 0 K.For higher temperatures holds that the volume of particles in specific level decreases with growing energy.Both Černý (1985) and Kirkpatrick et al. (1983) identified similarity between the behavior of annealing process and various optimization issues.Objective function of an optimization task is in this framework regarded as the energy of the annealed substance.While mass small deformations might be considered as local optimum, global solution constitutes an ideal crystal.Initially was simulated annealing applied primarily to operations research tasks (Heragu and Alfa, 1992;Koulamas et al. 1994;Souilah, 1995;Van Breedam, 1995), but since then it has been intensively used in finance (Crama and Schyns, 2003;Luo et al. 2014;Zarandi et al. 2013), or medicine (Albrecht et al. 2001;Jacob et al. 2008).
Simulated annealing is a stochastic method that is able to conditionally accept worse solution of optimized task.The goal of this approach is to escape from possible sub-optimality and evade the local convergence.The algorithm starts in random initial solution and at each iteration generates subsequent solution from local neighborhood.New solution that improves the objective function E (decreases the energy of the substance) is always accepted.On the other hand, inferior solutions are adopted with probability based on the deterioration of the objective function and current temperature of the system.Fundamentals of the process are presented in Figure 2. E n + is the energy of new solution from local neighborhood and Θ represents the actual temperature of the system.It is obvious that P decreases with temperature.How many new solutions are explored at particular level of temperature is determined by the researcher, but once a stable state is reached (no progress in solutions), the temperature is usually reduced.Both actual and best achieved solutions should be stored.Under the logarithmic cooling schedule 0 , log where k Θ is the actual temperature, 0 Θ the primary temperature and k the control parameter, there had been proven the convergence of simulated annealing algorithms towards global optimum (Aarts et al. 2007).Due to ability to accept the inferior solutions, the main benefit of SA procedure is the feasibility to escape from local optimum.The probability of deteriorating movement is increasing with the level of temperature and decreasing with magnitude of degradation of the objective function E ∆ .The probability of accepting the worse alternative is ( , ) , where E ∆ is the difference in the objective function, Θ the current temperature, k is the Boltzmann constant, and Z is randomly generated number between 0 and 1.In the initial phase, when the temperature of the system is high, deterioration is more probable, while with the temperature decline the algorithm becomes more rigid and allows only small downgrades of solution quality.The cooling schedule manages the behavior of annealing and navigates its convergence by determining the movements of the temperature during iterations.The performance of simulated annealing is strongly dependent on variables included in the cooling schedule such as initial temperature, termination criteria and cooling function.
For instance, if the initial temperature 0 Θ is too high, the algorithm reminds random local search and vice versa, low temperature indicates simple search for local improvements.
In this paper we follow the framework proposed by Wong et al. (2014) where scheduling constraints are categorized into hard and soft sets.While soft constraints define medical staff preferences directly connected to the quality of work, physical severity, psychic, and work-life balance, hard constraints are linked to legal and working regulations.The goal of the optimization process is to create a schedule that satisfies all hard constraints and includes as many soft constraints as possible.In case of any unexpected alternation, the local neighborhood search feature of simulated annealing enables the algorithm to obtain small changes and avoids massive reschedules.Table 1 defines the hard constraints of analyzed scheduling problem.

Table 1 -Hard constraints of scheduling problem
1. Standard day-offs have to be determined before scheduling 2. Each employee can only work one shift a day 3.Each employee must take one day-off after the shift 4. Each employee takes no more than 3 shifts during the week 5.During the shifts there must be 3 doctors and 8 nurses 6.
During the shifts there must be 2 doctors at senior level and 1 doctor on novice or intermediate level These constraints have to be realized in order to satisfy legal and workplace regulations.On the other hand, Table 2 introduces the proposed soft regulations which might have significant impact on life quality of medical staff.The objective function of the simulated annealing algorithm is a weighted sum of violations of soft constraints: 1 .
where i V denotes the number of violations of soft constraints in the generated schedule, i w is the general importance of constraint i and N is the total number of examined soft constraints.The complete medical staff scheduling algorithm based on simulated annealing is presented in Figure 3.
At first, the necessary hard constraints are defined, based on legal and working regulations.Subsequently, the initial monthly working schedule is generated and evaluated regarding the violations of staff preferences and their importance.In the next step a new schedule from local neighborhood is generated, evaluated and compared with current best solution.If the proposed novel schedule is better in terms of objective function, new solution replaces the current best solution.In case the new schedule is worse than actual solution, it replaces the actual solutions with above defined probability ( , )   .
The algorithm continues until the termination temperature is reached.
The study in this paper aims at medical staff in gynecology department containing 60 doctors and nurses.Applying proposed simulated annealing scheduling algorithm we focused on monthly shifts schedules regarding the preferences of employees in terms of soft constraints.Every constraint has been evaluated according to its impact on the quality of life of medical staff.

CONCLUSION
Lot of effort has been put in to the scheduling problem in recent years.This paper focuses on monthly shift schedules of medical staff in gynecology department containing 60 physicians and nurses.We proposed a scheduling algorithms based on simulated annealing that generates schedules considering hard and soft constraints following model of Wong et al. (2014).Hard constraints are connected to legal and working regulations, such as that there must be two doctors at senior level and one doctor at novice or intermediate level during the shift, or that each member of staff must take on day-off after the shift.On the other hand, soft constraints determine medical staff preferences directly linked to the quality of work, physical severity, and work-life balance.
Presented algorithm optimized randomly generated monthly schedule in 492 seconds and reached significantly better value of objective function than initial solution.Even though the global optimality of final solution is not guaranteed, very good schedule was obtained in reasonable time.Moreover, compared to standard approach, when shift schedule is usually created more than few hours by senior doctor, algorithm generated better schedule in little more than 8 minutes.Another advantage of proposed algorithm is its ability to reschedule, where local neighborhood search feature of simulated annealing enables this method to implement frequent changes without massive alternations in monthly schedule.We hope that presented technique could not only lead to the increase of the satisfaction, quality of life and work-life balance of medical staff, but consequently might also improve the patient care.

Figure 2 -
Figure 2 -Trajectory of simulated annealing algorithm Figure 3 -Medical staff scheduling algorithm

Figure 4 -
Figure 4 -Objective function best values throughout the optimization

Table 2 -
Soft constraints of scheduling problem

Table 4 -
Development of objective function best values