J Ind Eng Int

DOI 10.1007/s40092-015-0111-0

ORIGINAL RESEARCH

Jjjjj^ CrossMark

Maximizing the nurses' preferences in nurse scheduling problem: mathematical modeling and a meta-heuristic algorithm

Hamed Jafari1 • Nasser Salmasi1

Received: 21 January 2015/Accepted: 8 April 2015

© The Author(s) 2015. This article is published with open access at Springerlink.com

Abstract The nurse scheduling problem (NSP) has received a great amount of attention in recent years. In the NSP, the goal is to assign shifts to the nurses in order to satisfy the hospital's demand during the planning horizon by considering different objective functions. In this research, we focus on maximizing the nurses' preferences for working shifts and weekends off by considering several important factors such as hospital's policies, labor laws, governmental regulations, and the status of nurses at the end of the previous planning horizon in one of the largest hospitals in Iran i.e., Milad Hospital. Due to the shortage of available nurses, at first, the minimum total number of required nurses is determined. Then, a mathematical programming model is proposed to solve the problem optimally. Since the proposed research problem is NP-hard, a meta-heuristic algorithm based on simulated annealing (SA) is applied to heuristically solve the problem in a reasonable time. An initial feasible solution generator and several novel neighborhood structures are applied to enhance performance of the SA algorithm. Inspired from our observations in Milad hospital, random test problems are generated to evaluate the performance of the SA algorithm. The results of computational experiments indicate that the applied SA algorithm provides solutions with average percentage gap of 5.49 % compared to the upper bounds obtained from the mathematical model. Moreover, the applied SA algorithm provides significantly better solutions

& Nasser Salmasi

nsalmasi@sharif.edu

Hamed Jafari hamed.jafari@in.iut.ac.ir

1 Department of Industrial Engineering, Sharif University of Technology, Tehran, Iran

in a reasonable time than the schedules provided by the head nurses.

Keywords Health systems • Nurse scheduling problem • Preference scheduling • Mathematical programming • Neighborhood structure • Meta-heuristic algorithms

Introduction

Healthcare services consume a considerable share of the budget in each country. Hospitals are the largest organizations in providing health care services. Nurses, as one of the major portion of hospitals' human resources, account for a considerable part of a hospital's annual budget. Thus, the hospitals' policy makers have to efficiently arrange the available nurses. This problem is worsened by the shortage of available nurses in many countries. For instance, it is expected a shortage of 400,000 registered nurses in the United States of America by 2020 (Janiszewski 2003). The major reasons for nursing shortage are changing work climate in hospitals, low salary paid to nurses, decline in enrollment at nursing schools, and reduction of nurses' job satisfaction (Murray 2002).

Lu et al. (2002) study the relationships among professional commitment and job satisfaction for registered nurses. They distribute a structured self-administered questionnaire, including the professional commitment scale, job satisfaction, and demographic data to 2197 registered female nurses with an average age of 28.56 years that 72 % of them had an associate's degree. They found a positive correlation between job satisfaction and professional commitment to leave the profession. The discriminate analysis indicated low job satisfaction is the major reason of 30.5 % of nurses who leave their

Published online: 24 April 2015

a Springer

profession. Thus, factors that increase nurses' job satisfaction are very important for policy makers. An effective way to increase the job satisfaction rate is assigning the desirable working shifts to nurses.

The assignment of nurses to the shifts is called nurse scheduling problem (NSP) (De Causmaecker and Vanden Berghe 2011). In the NSP, the goal is to assign shifts to the nurses in order to satisfy the hospital's demand during the planning horizon. The NSP has been studied with several objective functions and different assumption sets. Several mathematical models, heuristic and meta-heuristic algorithms, and hybrid methods are proposed to solve the problem so far which are discussed in the following paragraphs.

There are several proposed mathematical models to solve the NSP. Miller et al. (1976) develop a two-stage mathematical model to balance the trade-off between staffing coverage and schedule preferences of individual nurses. A feasible solution is generated in the first stage, and then the generated solution is improved at the second stage. Arthur and Ravindran (1981) propose a two-stage multi-objective mathematical model to solve the research problem optimally. In their approach, working days of each nurse are specified using the goal programming method at the first stage, and working shifts are assigned to nurses at the second stage. Azaiez and Al-Sharif (2005) propose a binary goal programming model to solve a multi-objective NSP. The proposed model is used for problems with at most 22 nurses. Al-Yakoob and Sherali (2007) propose a mixed integer programming model to achieve fairness in the generated employee schedules by minimizing the total sum of absolute differences between employee preference indices and central preference values. Valouxis et al.

(2012) apply a two-stage mathematical programming model where at the first stage, the workload for each nurse is determined, while at the second stage, the daily shifts are assigned to the nurses. They consider only two constraints in their model: the schedule should provide a specific number of personnel for each scheduling period and a nurse can start only one shift per day. Wright and Mahar

(2013) propose a centralized model for the NSP by considering minimization of costs and overtime, simultaneously. M'Hallah and Alkhabbaz (2013) apply a simple Operations Research tools to a common and sensitive problem. They investigate the problem of designing timetables for the nurses working in Kuwaiti health care units. In details the constraints of the problem, they propose a mixed integer linear programming model and solve the mathematical model for the case of a specific health care unit using an off-the-shelf optimizer. Moreover, Guo et al. (2014) study assigning a set of nurses to surgeries scheduled on each workday in an operating room suite. Due to significant uncertainty in surgery durations,

designing schedules that obtain high nurse efficiency is complicated by the competing objective of ensuring on-time start of surgeries. For trading off between the two performance objectives, they formulate the problem as a mixed integer programming model with explicit probability modeling of uncertainty.

Bard and Purnomo (2007) propose a Lagrangian-based algorithm for the cyclic NSP. The objective is to strike a balance between satisfying individual preferences and minimizing personnel costs. Belien and Demeulemeester (2008) use branch-and-price algorithm to solve the NSP problem. They present a model that integrates the scheduling process of nurses and operating rooms, simultaneously. For ease of exposition, they consider all nurses with similiar skills. Furthermore, collective agreement requirements are acceptable schedules for individual nurses in terms of total workload, weekends off, and working shift (e.g., a morning shift after a night shift is not allowed). Maenhout and Vanhoucke (2010) propose a branch-and-price algorithm by incorporating multiple objectives of the unit efficiency (cost) and personal job satisfaction (nurses' preferences).

There are several proposed meta-heuristic algorithms for solving the NSP. Burke et al. (1999) propose a tabu search algorithm to generate nurse rosters in over forty Belgian hospitals with different shift types, work regulations, and skill categories. Gutjahr and Rauner (2007) apply the ant colony optimization algorithm for the dynamic regional NSP to minimize nurses' and hospitals' preferences, as well as costs. They consider that depending on qualifications, nurses can replace with the other nurses from another skill category. Majumdar and Bhunia (2007) develop a genetic algorithm to solve the NSP by introducing two new crossover and mutation schemes. Hadwan et al. (2013) propose a harmony search algorithm for the nurse rostering problem. They apply the proposed algorithm on two different benchmark datasets (real world and the widely used in the literature). The results show that the proposed algorithm is able to obtain very good solutions in both benchmark datasets. Wong et al. (2014) propose a spreadsheet-based two-stage heuristic approach in a local emergency department. As the first step, an initial solution satisfying all hard constraints is generated by the simple shift assignment heuristic. Then, a sequential local search algorithm is applied to improve the initial schedules by taking soft constraints (nurses' preferences) into account. Legrain et al. (2015) study the scheduling process for two types of nursing teams: regular teams from care units and the float team that covers for shortages. When managers address this problem, they either use a manual approach or have to invest in expensive commercial tools. They propose a heuristic approach to be implemented on spreadsheets and requiring almost no investment. Recently,

Issaoui et al. (2015) develop a three-phase meta-heuristic based on variable neighborhood search algorithm. In the first stage, they resolve the assignment problem using a scheduling algorithm which is the Longest Processing Time algorithm. In the second stage, they resolve the routing problem for each nurse in order to improve the traveled distances using the variable neighborhood search algorithm. The third stage is devoted to refine the second phase in terms of maximizing patients' satisfaction.

Hybrid methods are proposed by a combination of the favorable characteristics of various methods. Bard and Purnomo (2005) solve the NSP to balance contractual agreements and management prerogatives using the outside nurses (primarily floaters and agency nurses). They use a column generation approach that combines integer programming and heuristics. They formulate the problem as a set covering problem. Each column corresponds to an alternative schedule that a nurse can work during the planning horizon. Also, a heuristic is proposed to generate the columns. Dowsland and Thompson (2000) develop a hybrid algorithm based on tabu search and network programming to establish a non-cyclical scheduling system. Hertz and Kobler (2000) combine the local search algorithm with the genetic algorithm to heuristically solve the NSP. There are four different shift types in their problem: day, early, late, and night shift, and they assume the larger wards require more nurses on duty during each scheduling period. He and Qu (2012) propose a hybrid constraint programming-based column generation approach to the NSP. The constraint programming approach is integrated to solve the highly constrained NSPs. The complex problems have been modeled in a column generation scheme, where the master problem is formulated as an integer program and the pricing sub-problem is modeled as a weighted constraint optimization problem. Li et al. (2012) present a hybrid approach of goal programming and meta-heuristic search to find compromise solutions for the NSP with several constraints. They consider four types of the shifts (i.e., early, day, late, and night) within a planning horizon of 1 month to 16 nurses of different working contracts in a ward in a Dutch hospital.

In this research, inspired from a real case in practice (the largest hospital in Iran i.e., Milad), the NSP is approached by maximizing the nurses' preferences for working shifts and weekends off as the objective. The problem is approached by considering several important factors such as hospital's policies, labor laws, and governmental regulations. In most of the available research in the NSP area, the authors ignore the status of nurses at the end of the previous planning horizon. This affects the schedule of the nurses at least for the beginning of the planning horizon. For instance, assume that a nurse was working a night shift on the last day of the previous planning horizon. In this

case, based on rules, he/she should be off during the first day of the current planning horizon. In this research, the status of nurses at the end of the previous planning horizon is considered.

Due to the shortage of available nurses, at first, the minimum total number of required nurses is determined to meet the demands during the planning horizon. Then, a mathematical programming model and a meta-heuristic algorithm are proposed to find a schedule to maximize the nurses' preferences to work in their favorite shifts.

The rest of the paper is organized as follows: in ''Problem description,'' the details of the research problem are explained. The minimum total number of required nurses is specified in ''Specification of the minimum total number of required nurses''. A mathematical programming model is proposed in ''Mathematical programming model.'' A simulated annealing (SA) approach is presented in ''Simulated annealing algorithm'' to solve the problem, heuristically. In ''Test problem specifications,'' the test problems are generated. The experimental results are presented in ''The results.'' Moreover, conclusions and directions for future research are provided in ''Conclusions and future researches''.

Problem description

In the NSP, the number of nurses required for each period of time on each day during the planning horizon is given and the goal is to assign shifts to the nurses in order to satisfy the demands. Several factors such as hospital managers' policies, labor laws, governmental regulation, and the status of nurses at the end of the previous planning horizon are considered in assigning the shifts to the nurses. The terms used in this research are as follows:

• Scheduling period Each day is divided into separate time slots called scheduling periods and the number of required nurses is specified for each of them.

• Shift A shift is characterized by a fixed starting and ending time on each day that the nurses can work on them.

• Off day A nurse is off on a specific day if no shift is assigned to the nurse for that day.

• Annual leave An annual leave for a specific nurse is a day that the nurse requests for being off on that day.

In Milad Hospital, the head nurses perform the process of assigning shifts to the nurses manually. The manual process is very time consuming and is limited to find only a feasible solution without focusing on optimality. The assumptions considered to solve the NSP in Milad Hospital are as follows:

1. The planning horizon is considered for 4-week, i.e., 28 days. In other words, at the beginning of each 28-day period of scheduling, the new schedule is generated to assign shifts to the nurses.

2. Monday is considered as the first day of each week.

3. Each day has three scheduling periods that the number of required nurses is specified for each of them: morning period from 7:00 AM to 1:30 PM (6.5 h), evening period from 1:00 PM to 7:30 PM (6.5 h), and night period from 7:00 PM to 7:30 AM (12.5 h).

4. Each day has four shifts that the nurses can work on them: morning shift (M) from 7:00 AM to 1:30 PM (i.e., 6.5 h), evening shift (E) from 1:00 PM to 7:30 PM (i.e., 6.5 h), night shift (N) from 7:00 PM to 7:30 AM (i.e., 12.5 h), and long shift (L) from 7:00 AM to 7:30 PM (i.e., 12.5 h).

5. Nurses' preferences for working shifts during the planning horizon are considered. Each nurse assigns a number to each shift in each week based on his/her interest to work on that shift during that week. Also, nurses' preferences for weekends off are considered. Each nurse assigns a number to each weekend (i.e., Sundays) based on the nurse' interest to be off during that weekend. In other words, at the beginning of each 28-day period of scheduling, each nurse determines his/her preferences to work on each shift in each week and to be off in each weekend. Note that the preferences of nurses may change for different periods. Numbers 7, 3, and 1 correspond to the high, medium, and low preference, respectively. If a nurse prefers to work on a specific shift, she assigns number 7 to that shift. If she has no preference, she assigns number 3 to that shift, and finally, if she does not want to work in a specific shift, she assigns number 1 to that shift. The same approach is used for choosing the weekends by the nurses as well.

The constraints considered in this research are as follows that must be met.

1. Each nurse should be off at least 2 weekends (i.e., Sunday) during the planning horizon to fairly assign off weekends to the nurses.

2. Each nurse can work at most in one shift on each day.

3. If a nurse works a night shift (shift N) on a specific day, he/she should be off on the next day. This constraint should be considered in assigning shifts to the nurses on the first day of the planning horizon by considering the schedule of nurses on the last day of the previous planning horizon.

4. Each nurse can work at most two consecutive long shifts (shift L). This constraint should be considered in

assigning shifts to the nurses on the first 2 days of the planning horizon by considering the schedule of nurses on the last 2 days of the previous planning horizon.

5. Each nurse can work at most four consecutive days. This constraint should be considered in assigning shifts to the nurses on the first 4 days of the planning horizon by considering the schedule of nurses on the last 4 days of the previous planning horizon.

6. Each nurse should work between 162 and 182 h during the planning horizon.

7. The number of nurses required for each scheduling period on each day during the planning horizon is the same and is given. These demands should be covered.

8. The annual leave days requested by the nurses should be assigned to them.

Constraints 3 and 6 are considered based on labor laws and other constraints are based on managers' policies.

The goal is assigning the shifts to the nurses by maximizing the sum of nurses' preferences for weekends off and working shifts. In order to provide a better understanding about the proposed research problem, an example is provided in the following example:

Example 1 An illustrative instance obtained from one of the wards with 12 nurses in Milad Hospital is shown in Table 1. The symbols M, E, N, L, H, and - are used as morning, evening, night, long shifts, annual leave days, and off days, respectively. The number of required nurses for morning, evening, and night scheduling periods are 5, 2, and 1, respectively. The status of nurses at the end of the previous planning horizon, including the night shift on the last day, the number of consecutive long shifts, and the number of consecutive working days are provided in this table. For instance, nurse 8 works a night shift on the last day of the previous planning horizon. The number of consecutive working days assigned to nurse 9 at the end of the previous planning horizon is 4. Thus, regarding constraints 3 and 5, they should be off on the first day of the current planning horizon. The nurses' preferences for working shifts and weekends off are provided. Regarding these preferences, the preferences of nurse 7 to be off in weekends 1 through 4 are low, high, high, and medium, respectively. Therefore, he/she prefers to be off during weekends 2 and 3. Moreover, the preferences of nurse 8 to work on shifts M, E, N, and L during week 3 are high, medium, low, and low, respectively. Therefore, he/she prefers to work on shift M in this week, mostly. Also, regarding annual leave days requested by nurses, nurse 4 has requested annual leave on days 9 and 10 (Tuesday and Wednesday in the second week). Thus, he/she should be off on these days.

Table 1 An example obtained from one of the wards with 12 nurses in Milad Hospital

Demand of scheduling periods

Morning 5

Evening 2

Night 1

Nurses who worked a night- shift on the last day of previous planning horizon: Nurses who worked at long shift on the last day of previous planning horizon: Nurses who worked at long shift on the last 2 days of previous planning horizon: Nurses who worked on the last day of previous planning horizon: Nurses who worked on the last 2 days of previous planning horizon: Nurses who worked on the last 3 days of previous planning horizon: Nurses who worked on the last 4 days of previous planning horizon:

8 and 10

3, 4, 6, and 12

9 and 11

3, 6, 8, and 10 2, 4, and 12 1 and 7 9 and 11

Nurse Preferences of weekends off Weekend

Preferences of working shifts

First week

Second week

Third week

Fourth week

1 2 3 4 M E N L M E N L M E N L M E N L

1 3 7 1 7 1 3 1 7 3 1 1 7 1 3 1 7 1 7 3 1

2 3 1 7 7 3 1 7 1 3 1 1 7 3 7 1 1 3 1 7 1

3 1 7 3 7 1 1 3 7 1 1 7 3 3 1 7 1 1 3 7 1

4 7 1 3 7 3 1 1 7 3 1 7 1 1 3 7 1 1 3 7 1

5 7 7 1 3 3 1 7 1 1 3 1 7 3 1 1 7 7 3 1 1

6 1 7 7 3 3 1 1 7 1 3 1 7 7 3 1 1 1 1 3 7

7 1 7 7 3 1 3 1 7 3 1 7 1 1 7 3 1 7 3 1 1

8 7 3 1 7 1 3 1 7 1 1 7 3 7 3 1 1 1 3 1 7

9 1 3 7 7 1 1 3 7 3 1 1 7 1 3 7 1 1 3 1 7

10 7 3 7 1 7 3 1 1 3 1 1 7 1 3 1 7 1 3 1 7

11 7 1 7 3 1 3 7 1 1 3 1 7 7 1 1 3 7 3 1 1

12 7 3 7 1 3 1 1 7 7 3 1 1 1 3 1 7 1 1 3 7

Annual leave days

10 11 12

26 (Friday at fourth week)

9 and 10 (Tuesday and Wednesday at second week)

13 (Saturday at second week)

23 (Tuesday at fourth week) 11 (Thursday at second week)

5 and 6 (Friday and Saturday at first week)

A feasible solution for Example 1 is provided in Table 2 by the head nurse, manually. In this schedule, all considered constraints are met. The number of nurses assigned to morning, evening, and night scheduling periods on each day is greater than or equal to 5, 2, and 1, respectively. The number of assigned nurses to each scheduling period is given in the Period row. If a nurse works a night shift on a specific day, he/she is off on the next day. Each nurse

works at most two consecutive long shifts and he/she works at most four consecutive days. Each nurse is off at least 2 weekends. Each nurse works between 162 and 182 h during the planning horizon. The total working time related to each nurse is shown in the Working Time column. Furthermore, the annual leave days requested by the nurses are assigned to them. Regarding the nurses' preferences given in Table 1, nurse 7 prefers to be off in two weekends

Table 2 A feasible solution obtained manually by the head nurse for solving Example 1

Demand for morning scheduling period 5 Number of the required nurses: 12

Demand for evening scheduling period 2

Demand for night scheduling period 1

Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun Mon

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

1 L - - L L - - L L M N - L M L

2 N - - L - - N - L L M - L L -

3 L M N - L L M N - N - L L N -

4 L M L - L L - N H H L - - M N

5 M N - L - M M - L - - L - - L

6 - L L M L - M - L - N - L - -

7 L - L L - L - - M M - L H L -

8 - N - L - N - - N - L - N - M

9 - - L L N - L L M - L N - L -

10 - E M - M - - L - L H M L -L

11 - L - N - L L L - M L - - --

12 - L L - H H - M - L M L - -L

Period

Morning 5 5 6 7 5 5 5 5 6 6 6 5 5 55

Evening 4 4 5 6 4 4 2 4 4 3 4 4 5 34

Night 1 2 1 1 1 1 1 2 1 1 2 1 1 11

Days Working time

Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun

16 17 18 19 20 21 22 23 24 25 26 27 28

1 L - L - M L - N - - H M - 176.0

2 N - E E N - - M M N - N - 170.0

3 M - - M N - L - - M - M - 176.5

4 - M - L - L - N - M L - - 163.5

5 - L N - L N M - M E M E - 164.5

6 M N - M M - M L N - L - L 176.5

7 L - M - E - L M M L - M M 164.5

8 E M L - L M - L - M N - L 170.0

9 N - - M N - - H - - L L - 163.0

10 - L - L - L L - M M - L L 164.0

11 L M M - M - - M L L M - N 164.0

12 N - L N - L N - L - - L M 169.5

Period

Morning 5 5 5 5 5 5 5 5 6 6 5 6 5

Evening 4 2 4 3 3 4 3 2 2 3 3 4 3

Night 3 1 1 1 3 1 1 2 1 1 1 1 1

2 and 3, and nurse 8 prefers to work on shift M in week 3, weekend. Moreover, the preference of nurse 8 has not been

mostly. In the provided schedule, nurse 7 is off during the satisfied and he/she is not working on shift M during the

3rd weekend, but he/she should work during the 2nd first week, mostly.

Specification of the minimum total number of required nurses

Due to the shortage of available nurses, hospitals' managers prefer to satisfy the demand of all days during the planning horizon using the minimum total number of required nurses. In the real world, usually hospitals' managers assign the shifts to the available nurses without being aware of the minimum total number of required nurses to satisfy the demands. If this number is provided for them, it can be used to reduce the hospital costs. Thus, in this research at first, the minimum total number of required nurses is determined.

The minimum number of required nurses (n) can be calculated based on the NSP constraints discussed in the previous section that are related to the number of nurses i.e., constraints 1, 6, and 7. In other words, these three constraints are the ones should be considered to determine the minimum total number of required nurses.

Assume that parameters d1, d2, and d3 are the number of nurses required for morning, evening, and night scheduling periods on each day, respectively. Based on assumptions 3 and 4 discussed in ''Problem description,'' a long shift covers the demands of both morning and evening scheduling periods on each day, simultaneously. Thus, if the maximum possible number of nurses is assigned to this shift on each day, the number of required nurses during each day is minimized. It is clear that the maximum number of required nurses to work in long shift is equivalent to the minimum number of required nurses to work in the morning or evening shifts. For instance, assume that d1 = 7, d2 = 4, and d3 = 3. In this case, the minimum number of nurses required for a day is equal to 10 nurses (3, 3, and 4 nurses for morning, night, and long shift, respectively). Thus, the minimum number of nurses required for each day can be calculated by max{d1, d2} + d3.

It is clear that the minimum number of required nurses to cover the demands of a weekend is max{d1, d2} + d3. There exist 4 weekends in the planning horizon, and each nurse can work at most 2 weekends (constraint 1). Thus, the inequality (1) should be satisfied to cover the number of required nurses during weekends:

2 x(total number of nurses)> 4 x (max{d1, d2} + d3)

! (total number of nurses)> 2 x (max{d1, d2} + d3)

Therefore, the minimum number of required nurses to cover all demands during weekends can be calculated by Eq. (3):

n = 2 x (max{d1, d2} + d3) (3)

We show that using n as the number of nurses from the Eq. (3), satisfies constraints 1, 6, and 7. Regarding the

process of calculating n, constraint 1 is satisfied. Regarding the length of time slot in each scheduling period explained in assumption 3, the amount of required working hours to cover the demands of each day is equal to 6.5 d1 + 6.5 d2 + 12.5 d3 h. Thus, the total required working hours during the planning horizon is 28 x(6.5 d1 + 6.5 d2+ 12.5 d3). Each nurse can work at most 182 h during the planning horizon based on constraint 6. Thus, the inequality (4) should be satisfied to cover the total required working hours during the planning horizon:

182 x(total number of nurses)> 28

x (6.5 d1 + 6.5 d2 + 12.5 d3) (4)

! (total number of nurses)> d1 + d2 + 1.92 d3 (5)

We show that the value of n calculated from Eq. (3) satisfies inequality (5). Assume that d1 is not less than d2. Therefore, n is obtained based on the following equation:

n = 2 x (max{d1, d2} + d3)d^!2 n = 2d1 + 2d3 (6)

Since d1 is not less than d2, it is clear that the value of n calculated from Eq. (6) satisfies inequality (5). If d1 is less than d2, n satisfies inequality (5), similarly. Therefore, constraint 6 is satisfied, as well.

It is clear that the minimum number of required nurses to cover the demands in the whole planning horizon is equal to 28 x(max{d1, d2} + d3). According to constraint 5, each nurse should be off on at least 1 day in every 5 days. Based on this constraint, each nurse is off on at least 5 days during the planning horizon, and thus, each nurse works at most for 23 days during the planning horizon. In order to support this constraint, inequality (7) should be satisfied in order to cover the demands of all days in the planning horizon:

23 x(total number of nurses)> 28 x (max{d1, d2} + d3)

! (total number of nurses)> — x (max{d1, d2} + d3)

23 (8)

It is clear that the value of n calculated from Eq. (3) satisfies inequality (8). Thus, constraint 7 has been satisfied as well.

Regarding the above explanations, the value of n obtained from Eq. (3) is the minimum number of required nurses to satisfy the considered constraints in ''Problem description.''

Mathematical programming model

In this section, a mathematical programming model is proposed to solve the research problem optimally. The number of required nurses is assumed to be equal to the

number of required nurses calculated in the previous section. The indices, parameters, decision variables, and mathematical model are as follows:

Indices and parameters:

n The total number of nurses k Index of days {1, 2, ..., 28} i Index of nurses {1, 2, ..., n} t Index of weeks {1, 2, 3, 4}

j Index of shifts {1, 2, 3, 4} that the indices 1, 2, 3, and 4 refer to the shifts M, E, N, and L, respectively a The weight of the first part of objective function related to maximizing the sum of nurses' preferences for weekends off d1 Number of required nurses for morning scheduling

period on each day d2 Number of nurses required for evening scheduling

period on each day d3 Number of required nurses for night scheduling

period on each day gi 1 if nurse i (i = 1, 2, ..., n) has worked a shift N on the last day of previous planning horizon, 0 otherwise

ui Number of consecutive shifts L assigned to nurse i at

the end of previous planning horizon ci Number of consecutive working days assigned to

nurse i at the end of previous planning horizon Hik 1 if nurse i has requested to annual leave on day k, 0 otherwise

fi,t 7, 3, and 1, if the preference of nurse i is high,

medium, or low to be off in weekend t, respectively Pijt 7, 3, and 1, if preference of nurse i is high, medium, or low to work at shift j in week t, respectively.

Decision variables:

sik 1 if nurse i is off on day k, 0 otherwise Xijk 1 if nurse i is assigned to shift j on day k, 0 otherwise.

The model:

4 n 4 7t n 4

Max Y fi;tsi;7t + (1 - a) Y Y Y Ypij'txij;k

t=1 i=1 t=1 k=7t—6 i=1 j=1

Subject to:

Ysi.7t > 2 i = 1 ,2 ,... , n

Xi ,1 ,k + Xi, 2 , k + Xi, 3 ,k + Xi ,4 ,k + Si ,k = 1

k = 1 ,2 ,... , 28 , i = 1,2 ,... , n

si,1 >gi i = 1 ,2 ,... ,n

Xi, 3, k - Si,k+1 < 0 k = 1 ,2,... , 27, i = 1 ,2,... , n (13)

(11) (12)

3—Ui

,4 ,k <(2 — Ui) i = 1 ,2 ,... , n

Xi 4 k + Xi 4 k+1 + Xi 4 k+2 < 2

k = 1 2 ... 26 i = 1 2 ... n

5—ct

Ysi,k > 1 i = 1,2 ,... , n

Ysi,k+1 > 1 k = 1,2 ,... , 24 , i = 1 ,2 ,... , n l=0

Yj(6-5Xi,1 ,k + 6.5x,-, 2,k + 12.5Xi,3,k + 12.5Xi,4^) > 162 k1

(16) (17)

i = 1 2 ... n

Y^(6.5Xi,1 ,k + 6.5Xi, 2,k + 12.5Xi,3,k + 12.5Xi,4^) < 182

i = 1 2 ... n

y(Xi,!,k + Xi,4 ,k)> d1 k = 1,2 ,... , 28

y^(Xj, 2,k + Xi,4,k)> d2 k = 1,2 ,... , 28

y^Xi ,3 ,k > d3 k = 1,2 ,... , 28

(22) (23)

Si,k > Hi,k k = 1,2 ,... , 28 , i = 1,2 ,... , n Si,k e{0, 1} k = 1,2 ,... , 28 , i = 1,2 ,... , n

Xi j ,k 2 {01} j = 1 2 ... 4 k = 1 2 ... 28 i = 1 2 ... n

The objective function, as presented by Eq. (9), focuses on maximizing the sum of nurses' preferences for weekends off (the first part) and working shifts during the planning horizon (the second part), respectively. If nurse i is off in weekend t (i.e., st 7t = 1), then fi;tSi; 7t indicates the preference of the nurse i to be off in weekend t. Furthermore, if nurse i works at shift j in week t (i.e., xij;t = 1), then pi j; txi jt indicates the preference of the nurse i to work at shift j in week t.

Based on constraint 1 discussed in ''Problem description'', each nurse should be off at least 2 weekends. As it is discussed, since Monday is considered as the first day of each week, the weekends i.e., Sundays, are considered as the last day (the 7th day) of each week. Thus, incorporating constraint set (10) ensures that each nurse is off at least

2 weekends during the planning horizon (Satisfying constraint 1). Constraint set (11) is incorporated into the model to ensure that each nurse can work at most in one shift during each day (Satisfying constraint 2). Considering the last day in the previous planning horizon, if a nurse works a shift N, he/she should be off during the next day. Constraint sets (12) and (13) are incorporated into the model to meet this constraint (Satisfying constraint 3). Considering the last 2 days in the previous planning horizon, each nurse can work at most two consecutive shifts L. Constraint sets (14) and (15) are incorporated into the model for this reason (Satisfying constraint 4). Furthermore, considering the consecutive working days at the end of the previous planning horizon, each nurse can work at most four consecutive days. Constraint sets (16) and (17) are incorporated into the model to ensure this (Satisfying constraint 5). The total allowable working time for each nurse is evaluated by constraint sets (18) and (19) (Satisfying constraint 6). Constraint sets (20), (21), and (22) ensure that the number of required nurses for morning, evening, and night scheduling periods are covered, respectively (Satisfying constraint 7). Also, the annual leave days requested by the nurses are assigned to them by incorporating constraint set (23) to the model (Satisfying constraint 8).

Estimating the weights of objective function

In this research, the analytic hierarchy process (AHP) method, proposed by Saati (1977), is used to estimate the weight of each part of the objective function (a). At first, the rate of importance for each part of objective function was asked from 30 nurses randomly selected in Milad hospital. Then, the pairwise comparison matrix was generated for each nurse. The value of a was estimated using the AHP method for each nurse. Then, the consistency rate (C.R.) was calculated for each of them. Finally, to estimate the value of a, the average of weights obtained from the nurses who decided logically (i.e., the value of C.R. for them is less than 0.1) was calculated. The value of parameter a based on this approach is considered as 0.333 for this research.

The value of considered parameters such as g,-, m,-, and c,-related to Example 1 is presented in Table 3. Furthermore, the optimum solution obtained from the proposed mathematical model for this example is presented in Table 4. In the provided solution, all constraints considered in ''Problem description'' are met. Nurses' preferences for weekends off and working shifts have been considered. For instance, regarding the parameters fy and generated in Table 3, the preferences of nurse 7 to be off in weekends 1, 2, 3, and 4 are 1, 7, 7, and 3, respectively. Therefore, he/she prefers to be off during the second and the third weekends,

and he/she is off in these weekends in the solution presented in Table 4. Moreover, the preferences of nurse 8 to work on shifts M, E, N, and L at week 3 are 7, 3, 1, and 1, respectively. Therefore, he/she prefers to work at shift M in this week mostly, and in the solution presented in Table 4 he/she works on shift M during week 3.

Simulated annealing algorithm

The NSP by maximizing the nurses' preferences as the objective function is proven to be NP-hard by Osogami and Imai (2000). They show that the NSP with a subset of real world constraints such as restrictions with consecutive assignments and total working times can be considered as a Timetabling problem, which is NP-hard. Thus, meta-heuristic algorithms should be used to solve large size problems, heuristically.

Due to the different types of constraints considered in the proposed research problem, generating an initial feasible solution is not an easy task. Thus, meta-heuristic algorithms such as genetic algorithm or particle swarm optimization that need a population of initial solutions, may not be suggested for the proposed research problem since finding even one initial feasible solution is not easy. Based on Glover and Kochenberger (2003), SA is a popular meta-heuristic algorithm that needs only one initial feasible solution. Bertsimas and Tsitsiklis (1993) prove the ability of the SA algorithm in escaping from local optimum and converging to the global optimum. This is our major motivation to apply the SA algorithm in this research.

In SA algorithm, an initial feasible solution is generated first and sets as the current solution. Then, a neighbor solution is generated by implementing the neighborhood search structure on current solution. The objective function values for two solutions (the current solution and a neighbor solution) are compared at each iteration. If the neighbor solution has a better objective function value, it is accepted as the new solution, while a fraction of non-improving solutions are accepted in the hope of escaping local optima in search of global optima. The probability of accepting non-improving solutions depends on a temperature parameter, which is typically non-increasing during the algorithm. An outline of pseudo-code for the SA algorithm is presented in ''Appendix 1''. The characteristics of the applied SA algorithm in this research are as follows:

The initial feasible solution

Generating an initial feasible solution for the research problem is very complicated due to the different types of considered constraints. In this research, a five step

Table 3 The value of parameters related to Example 1

Demand d1 d2 d3

Nurse Ci Ui gi

1 3 0 0

2 2 0 0

3 1 1 0

4 2 1 0

5 0 0 0

6 1 1 0

7 3 0 0

8 1 0 1

9 4 2 0

10 1 0 1

11 4 2 0

12 2 1 0

Nurse fi,t Weekenc Pi j ,1 Shift Pi j 2 Shift Pi j 3 Shift Pi j 4 Shift

1 2 3 4 M E N L M E N L M E N L M E N L

1 3 7 1 7 1 3 1 7 3 1 1 7 1 3 1 7 1 7 3 1

2 3 1 7 7 3 1 7 1 3 1 1 7 3 7 1 1 3 1 7 1

3 1 7 3 7 1 1 3 7 1 1 7 3 3 1 7 1 1 3 7 1

4 7 1 3 7 3 1 1 7 3 1 7 1 1 3 7 1 1 3 7 1

5 7 7 1 3 3 1 7 1 1 3 1 7 3 1 1 7 7 3 1 1

6 1 7 7 3 3 1 1 7 1 3 1 7 7 3 1 1 1 1 3 7

7 1 7 7 3 1 3 1 7 3 1 7 1 1 7 3 1 7 3 1 1

8 7 3 1 7 1 3 1 7 1 1 7 3 7 3 1 1 1 3 1 7

9 1 3 7 7 1 1 3 7 3 1 1 7 1 3 7 1 1 3 1 7

10 7 3 7 1 7 3 1 1 3 1 1 7 1 3 1 7 1 3 1 7

11 7 1 7 3 1 3 7 1 1 3 1 7 7 1 1 3 7 3 1 1

12 7 3 7 1 3 1 1 7 7 3 1 1 1 3 1 7 1 1 3 7

Nurse Hi,k

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0

2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

4 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

7 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0

10 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

12 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Table 4 The solution obtained optimally from the proposed mathematical model for Example 1

Demand for morning scheduling period Demand for evening scheduling period Demand for night scheduling period

Number of required nurses: 12

Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun Mon

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Nurses

1 L - L L - L L - L L M - L - L

2 N - N - - - - L M L L - L L -

3 L M N - L L N - N - N - N - N

4 - L - L L - L N H H - N - N -

5 M N - N - N - - - L - L - - L

6 - L - L L M L - - - - L - - M

7 L - L L - L L N - N - - H - E

8 - L L - L L - N - - N - - L M

9 - L L - L - L L - L L M L - N

10 - - - - - - - L L M H L L M -

11 - N - - N - - L L - L L - L M

12 L - L L H H - M M M M - M M -

Period

Morning 5 5 5 5 5 5 5 5 5 6 5 5 5 5 5

Evening 4 4 5 5 5 4 5 4 3 4 3 4 4 3 3

Night 1 2 2 1 1 1 1 3 1 1 2 1 1 1 2

Days Working time

Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun

16 17 18 19 20 21 22 23 24 25 26 27 28

Nurses

1 L - L L - L - - - - H - - 169.0

2 E E E - E - N - N - N - M 164.0

3 - - - M - N - N - N - - - 163.0

4 N - N - N - N - N - N - - 162.5

5 M L L - L L M M - M M M M 164.5

6 - M M - M M L L - L L N - 169.0

7 E N - E E - M M - M M M M 165.0

8 M - M M M M - L L - - L - 163.0

9 - - E N - - - H L - - - L 163.0

10 L L - L - - L - L L - L L 163.0

11 L M - M M M M - M M M M - 165.0

12 - L L - L - - L L - L - N 169.0

Period

Morning 5 5 5 5 5 5 5 5 5 5 5 5 5

Evening 5 4 5 3 4 2 2 3 4 2 2 2 2

Night 1 1 1 1 1 1 2 1 2 1 2 1 1

algorithm is proposed to generate an initial feasible solution as follows:

Step 1 Assign the requested annual leave days to each nurse.

Step 2 Cover the number of nurses required for weekends' scheduling periods by considering all constraints considered in ''Problem description''. Step 3 Assign the shifts to nurses during the first 4 days of the planning horizon by considering the values of parameters gi, ui, and ci.

Step 4 Cover the demand of nurses required for the rest of the planning horizon.

Step 5 After covering the number of nurses required for all days, if the total working hours of some nurses are less than 162 h, assign a number of shifts to them in order to satisfy constraint 6.

In all steps of generating the initial feasible solution, an algorithm is used to specify the shifts assigned to nurses.

The shift specification algorithm for assigning the shifts to the nurses during generating the initial feasible solution

The variables in the shift specification algorithm are defined as follows:

r A random number r 2 {1,2 , 3}

sh The selected shift to be assigned to a nurse

dm The number of uncovered demands for morning

scheduling period on each day de The number of uncovered demands for evening

scheduling period on each day dn The number of uncovered demands for night scheduling period on each day.

At the beginning of each day, the value of variables dm, de, and dn are set equal to the value of parameters d1, d2, and d3, respectively. An outline of the shift specification algorithm is as follows:

Stepl: Generate a random number r 6 {1,2,3). Step2\ IF r * 1, go to step 3.

Else {IF dm = 0, go to step 1.

Else {IF de > 0, set sh = L, dm <- dm — 1, and de <- de — 1.

Else, set sh = M and dm <- dm — 1.

Siep3: IF r * 2, go to step 4.

Else {IF de = 0, go to step 1.

Else {IF dm > 0, set sh = L, dm «- dm — 1, and de «- de — 1.

Else, set sh = E and de <- de — 1.

Step4: IF dn = 0, go to step 1.

Else, set sh = N and dn*- dn — 1. StepS: Choose the specified shift (sh) to be assigned to a nurse.

In fact, at first a shift is selected by using the shift specification algorithm. Then, the selected shift is assigned

to one of the available nurses. An available nurse for the selected shift is a nurse that assigning the shift to his/her violates no constraints considered in ''Problem description'' . For instance, let the selected shift based on the shift specification algorithm be night shift. According to constraint 3, the nurses who worked a night shift during the previous day are off on this day and they are not considered as available nurses for that night shift.

The neighborhood search structure

The structures of generating neighbor solutions are very important in finding good-quality solutions. The more the applied structures are able to surf the feasible solutions area of the problem, the more the probability of obtaining good-quality solutions based on the meta-heuristic algorithm. Due to the different types of considered constraints and complexity of the proposed research problem, generating a neighbor solution is very complicated. In this research, eight neighborhood structures are used simultaneously in order to provide more chance for the algorithm to search in the set of feasible solutions. The structures of the applied neighborhoods are described as follows:

Neighborhood search structure 1

Select day k in week t, randomly. Select two nurses ¿1 and i2 randomly that work at shifts M and E on day k, respectively. If phA,t >(piu1 ,t + Pi2,2,t) and the generated neighbor solution is a feasible solution, assign shift L to nurse i1 and set nurse i2 off on day k. If pi2 ,4,t >(pi1,1 ,t + Pi2 2 t) and the generated neighbor solution is a feasible solution, assign shift L to nurse i2 and set nurse i1 off on day k. In other words, if phA,t >(piu1 ,t + Pi2 ,2,t) , the preference of nurse i1 to work at shift L on day k (that belongs to week t) is greater than the sum of the preference of nurse

11 and nurse i2 to work at shifts M and E on day k, respectively. Therefore, if we assign shift L to nurse i1 and set nurse i2 off on day k and the generated neighbor solution is a feasible solution, the value of the objective function is improved. These explanations are similar for relation pi2 ,41 >(pi!,1 ,t + Pi2,2,t). The structure of this neighborhood search is shown in Fig. 1a.

Neighborhood search structure 2

Select day k in week t, randomly. Select two nurses i1 and

12 randomly that nurse i1 works at shift L and nurse i2 is off on day k. If piu4,t <(pi!,1 ,t + pi2 ,21) and the generated neighbor solution is a feasible one, assign shifts M and E to nurses i1 and i2 on day k, respectively. If piu4,t <(pi1, 2, t + pi2,1 ,t) and the generated neighbor solution is a feasible one,

Fig. 1 The structure of applied neighborhood structures. a Neighborhood structure 1: merging two shifts M and E to shift L. b Neighborhood structure 2: breaking shift L to shifts M and E. c Neighborhood structure 3: exchanging the assigned shifts on 2 days for two nurses. d Neighborhood structure 4: exchanging the shifts assigned to two nurses with together on each of 2 days. e Neighborhood structure 5: exchanging the shift assigned to a nurse on a day with the shift assigned to another nurse on another day. f Neighborhood structure 6: exchanging the shifts assigned to two nurses on 2 days cyclically. g Neighborhood structure 7: exchanging the shift assigned to a nurse on a day with another shift. h Neighborhood structure 8: exchanging the shifts assigned to three nurses on a day

Days Days

Nurses

M L

—►

E -

Days Days

Nurses

L M

—►

- E

Nurses

Nurses

i J

Nurses

Nurses

assign shifts M and E to nurses i2 and i1 on day k, respectively. The structure of this neighborhood search is shown in Fig. 1b.

Neighborhood search structure 3

Select 2 days and two nurses, randomly. If the generated neighbor solution is a feasible one, for each nurse, exchange the shifts assigned on these 2 days. The structure of this neighborhood search is shown in Fig. 1c.

Neighborhood search structure 4

Select 2 days and two nurses, randomly. If the generated neighbor solution is a feasible one, exchange the shifts assigned to the nurses with each other on each day. The structure of this neighborhood search is shown in Fig. 1d.

Neighborhood search structure 5

Select 2 days k1 and k2 and two nurses i1 and i2 randomly. If the generated neighbor solution is a feasible one, exchange the shift assigned to nurse i1 on day k1 with the shift assigned to nurse i2 on day k2. The structure of this neighborhood search is shown in Fig. 1e.

Neighborhood search structure 6

Select 2 days k1 and k2 and two nurses i1 andi2 randomly. Assume nurse i1 works at shifts sh1 and sh2 on days k1 and k2 respectively. Also, assume nurse i2 works at shifts sh3 and sh4 on days k1 and k2 respectively. If the generated neighbor solution is a feasible one, assign shift sh1 to nurse i1 on dayk2, shift sh2 to nurse i2 on day k2, shift sh4 to nurse i2 on day k1, and shift sh3 to nurse i1 on

day k1. The structure of this neighborhood search is shown in Fig. 1f.

Neighborhood search structure 7

Select 1 day k, one nurse i, and one shift j, randomly. If the generated neighbor solution is a feasible one, assign shift j to the nurse i on day k. The structure of this neighborhood search is shown in Fig. 1g.

Neighborhood search structure 8

Select 1 day k and three nurses i1, i2, and i3, randomly. If the generated neighbor solution is a feasible one, exchange the shifts assigned to these three nurses with together on day k. In other words, assume the shifts assigned to nurses i1, i2, and i3 on day k are j1, j2, and j3, respectively. If the generated neighbor solution is a feasible one, assign shifts j3, j1, and j2 to nurses i1, i2, and i3 on day k, respectively. The structure of this neighborhood search is shown in Fig. 1h.

Neighborhood search structures 1 and 2 generate neighbor solutions with the goal of improving the objective function value by merging shifts M and E and breaking shift L, respectively. Other neighborhood search structures generate neighbor solutions randomly that are useful to prevent from being trapped in local optimums. During all iterations in each temperature, all neighborhood search structures are performed after each other from the first one to the last one to generate new solutions. In fact, all eight neighborhood search structures are implemented in the current available solution to generate a new solution. If the generated solution has a better objective function value than the current solution, it is accepted. Otherwise, it is

accepted by the probability of Exp^D/t) that D is the

difference between the objective function value of the old and the new solutions generated from the neighborhood structure, and T is the algorithm temperature. Since in this research, the objective function is maximizing nurses' preferences, therefore, non-improving solutions are accepted by the probability of Exp^D/t^ rather than

Exp^—D/t^ which is used in problems with minimization as the objective function.

Setting parameters

In SA algorithm, appropriate estimation of parameters such as the rate of cooling, initial temperature, and number of iterations in each temperature has a significant effect on the quality of the obtained solutions. In this research, the SA parameters are set based on experimental design techniques with extensive experiments. The Full Factorial test is used at significance level of 5 % to set the parameters. The experimental design is coded with Statistical Analysis System (SAS), version 9.1. The values of set parameters based on the number of required nurses are summarized in Table 5.

Stopping criterion

Since the SA algorithm converges to a steady state at lower temperatures, the stopping criterion is considered reaching to the temperature of 0.1.

Test problem specifications

The number of required nurses for each shift on each day and the status of nurses at the end of the previous planning horizon are important factors for generating the test problems. Random test problems, with different parameter values are generated based on our observations in Milad's Hospital wards to evaluate the performance of the applied SA algorithm. Test problems based on the total number of required nurses are classified to small-, medium-, and large-sized problems as follows :

• C1 : Small-sized problems with the number of required nurses between 1 and 10 nurses. This is the situation observed in several wards in Milad Hospital.

• C2: Medium-sized problems with the number of required nurses between 11 and 30 nurses. There are many wards that have this many nurses available to cover the shifts.

• C3: Large-sized problems with the number of required nurses between 31 and 60 nurses. There are a few wards that have this many nurses available to cover the shifts.

Table 5 The value of set parameters based on the number of required nurses

Number of nurses Parameters

Rate of cooling Initial temperature Number of iteration in each temperature

1-10 0.988 200 500

11-30 0.988 200 500

31-60 0.988 500 500

The number of the nurses required for each scheduling period on each day (i.e., d1, d2, and d3) is generated randomly from the discrete uniform distribution DU[1 , 15]. The values of c,-, u,, g,, and H,for each nurse are generated randomly from discrete uniform distributions DU[0,4], DU[0,2], DU[0, 1], and DU[0 , 1], respectively. Moreover, the nurses preferences during weekends and shifts in weekdays, i.e., fi,t and p,j,t are generated randomly from the discrete uniform distribution 2du[1,3] _ 1.

Regarding Eq. (3), the following inequality should be considered:

i > 2 x(max{d1, d2} + d3)

Several restrictions are considered in the process of generating parameters. Regarding the parameters gi, u,, and ci, the following restrictions are considered:

Ci > maxfgi, Ui} i = 1,2 ,... , n (25)

In addition, to meet the demands of the first day in the current planning horizon, the number of available nurses should be greater than or equal to the number of required nurses on this day. The minimum number of the required nurses on each day is equal to max{d1, d2} + d3. If nurse i works a night shift on the last day or works four consecutive working days at the end of the previous planning horizon (i.e., gi = 1 or c, = 4), he/she should be off on the first day in the current planning horizon (constraints 3 and 5, respectively). Thus, to meet the demands of the first day, the following inequality should be met:

— ) > max{d1, d2} + d3

Since each nurse should be off for at least 2 weekends, it is assumed that each nurse chooses 2 weekends to be off as his/her major preferred by assigning preference 7 to those 2 weekends and another weekend as the next choice by assigning preference 3 to that one. Also, it is assumed that each nurse selects a shift as the main shift for each week by assigning preference 7 to that shift and another shift as the next choice by assigning preference 3 to that one.

To evaluate the efficiency of the applied SA algorithm, 20 test problems are generated for each of three classes defined (totally 60 test problems).

The results

All 60 generated random test problems are solved using the proposed mathematical model and the SA algorithm. The CPLEX interactive optimizer, version 10.1.1 is used to solve test problems with the proposed mathematical model. The

SA algorithm is coded with C++ programming language. The experimental design is performed with SAS, version 9.1. A Pentium IV 2.1 GHz PC is used to solve the test problems. Each test problem is solved once with the applied SA algorithm. The results obtained from the mathematical model and the applied SA algorithm are summarized in Table 6, based on different test problem classes.

To solve test problems using the mathematical model, a maximum running time of 3, 6, and 10 h for small(Ci)-, medium(C2)-, and large(C3)-sized problems are considered, respectively. All small-sized problems are optimally solved using the mathematical model. For medium-sized problems, only 10 test problems are solved optimally using the mathematical model in the time limit. The maximum number of nurses in problems that are solved optimally is 22 nurses. For the problems in this class that are not solved optimally, the maximum running time corresponding to class C2 (i.e., 6 h) has been considered as the required computational time of problems. For all large-sized problems, the optimal solutions could not be obtained in the time limit. Thus, in class C3, the average of the best upper bounds provided by the CPLEX optimizer is reported. Also, the maximum running time corresponding to class C3 (i.e., 10 h) is considered as the required computational time of large-sized problems. Therefore, the average of computational time related to class C3 is equal to 36,000 s [i.e., (20 x 10 x 3600)/20 = 36,000]. The average of the percentage gap between the objective function value of solutions obtained from the applied SA and the upper bounds of mathematical model obtained from CPLEX optimizer is given in the last column of Table 6. The value of percentage gap for each test problem is calculated by the following equation:

UB - obj(SA)

In Eq. (27), UB and obj(SA) are the upper bound of mathematical model obtained from CPLEX optimizer and objective function value obtained from the SA algorithm, respectively. If the generated test problem is optimally solved by using the CPLEX optimizer in the time limit, UB is equal to the optimum objective function value. Also, the average of the results obtained from all 60 test problems are summarized in the last row of Table 6. Regarding the obtained results, though the average of the upper bound of objective function values obtained from the mathematical model (i.e., 3164.32) is better than the average of objective function values obtained from the SA algorithm (i.e., 2999.64), but the average of required computational time obtained from the SA algorithm (i.e., 920.37 s) is significantly less than the average of required computational time obtained from the mathematical model (i.e.,

Table 6 The average of results obtained from 60 generated test problems

Mathematical model

SA algorithm

Computational time (s)

Objective function value

Upper bound

Computational time (s)

Objective function value

Percentage gap (%)

Average

216.14 10944.5 36,000 15720.2

656.13

656.13 2537.46 6299.36 3164.32

491.44 539.23 1730.44 920.37

638.74 2413.8 5798.91 2999.64

2.72 5.12 8.63 5.49

15720.22 s). In other words, the applied SA algorithm converges to efficient solutions with the average percentage gap of 5.49 % compared to the upper bounds of mathematical model obtained from CPLEX optimizer very quickly.

Moreover, minimum and maximum percentage gap obtained in three classes Ci, C2, and C3 are presented in Table 7.

In order to compare the performance of the applied SA algorithm, the solution provided by the SA algorithm for Example 1 is presented in Table 8.

The objective function values and computational times obtained by using three methods, i.e., a manual schedule of head nurse, the proposed mathematical model, and the applied SA algorithm for Example 1 are presented in Table 9. Computational results show that the applied SA algorithm provides a good-quality solution with the percentage gap of 2.99 % compared to the optimum solution obtained by the mathematical model. Moreover, in comparison with the manual schedule provided by the head nurse, the SA algorithm provides a significantly better schedule for the nurses in a very short time.

The trend of objective function improvements using the SA algorithm for solving Example 1 is illustrated in Fig. 2. As it is shown, the convergence of the algorithm toward good solutions is very quick during the earlier iterations. In other words, the applied SA algorithm can find a good-quality solution in a very short period of time. This advantage can be used if there is a time limit to solve a problem.

An experimental design is performed to compare the performance of the applied eight neighborhood structures (NS1 through NS8) in the case of using them separately, with the case of using them simultaneously as the combined neighborhood structure (CNS). This experiment is

Table 7 The minimum and maximum percentage gap obtained in three classes

Class Minimum Maximum

percentage gap (%) percentage gap (%)

C1 1.45 6.85

C2 3.86 7.78

C3 3.73 21.06

performed by using the all 60 generated test problems. A single factor experiment with nine levels (eight neighborhood structures separately and one CNS) is used to perform the comparison. The applied experimental model is as follows:

yij = I + Si + ßj + eij

i = NS1, NS2,..., NS8, CNS, j

1; 2,.

where y The response variable, i the overall mean, s the effect of treatment (neighborhood structure) factor, b the effect of block (test problem) factor, e the error term

The hypothesis test for this comparison is represented as follows:

h0 : sns1 = sns2 = ••• = sns8 = scns = 0

H1 : if any of the s s is nonzero

A significance level of 5 % is used in this experiment. All 60 generated random test problems are solved using the SA algorithm by considering each neighborhood structure, separately. The results of the experiments are shown in ''Appendix 2''. The results show that there is a statistically significant difference among the performance of these neighborhood structures (The P values of neighborhood structures are less than 0.0001).

The Tukey test is performed to find difference between the performances of each two neighborhood structures. The results of the Tukey test are provided in ''Appendix 3.'' The Waller-Duncan test is performed to classify the neighborhood structures. The results of the Waller-Duncan test are summarized in ''Appendix 4.'' The results show that there is significant difference among performance of combined neighborhood structure and other neighborhood structures. As presented in ''Appendix 4,'' since the average of objective function values for combined neighborhood structure is higher than the others, it can be concluded that, it has a better performance than the rest.

Conclusions and future researches

In this research, the NSP is approached by maximizing the nurses' preferences for working shifts and weekends off as

Table 8 The solution obtained from the applied simulated annealing algorithm for Example 1

Demand for morning scheduling period Demand for evening scheduling period Demand for night scheduling period

Number of required nurses: 12

Mon 1 Tue 2 Wed 3 Thu 4 Fri 5 Sat 6 Sun 7 Mon 8 Tue 9 Wed 10 Thu 11 Fri 12 Sat 13 Sun 14 Mon 15

Nurses

1 L - - L L - - L L M L - L M L

2 N - - N - - N - L L M - L L E

3 L M N - L L M N - N - L L N -

4 L M L - L L - N H H N - - M N

5 M N - N - M M - L - - L - - L

6 - L L M L - M - L - - - L - -

7 L - L L - L L N - - - N H - E

8 - L - L - L - - N - N - N - M

9 - - L L N - L L M - L L - L -

10 - - - - M - - L - L H L L - L

11 - N - N - N - L - L L - L L -

12 - L L - H H - M - M M M - - L

Period

Morning 5 5 5 5 5 5 5 5 5 5 5 5 6 5 5

Evening 4 3 5 4 4 4 2 4 4 3 3 4 6 3 6

Night 1 2 1 3 1 1 1 3 1 1 2 1 1 1 1

Days Working time

Tue 16 Wed 17 Thu 18 Fri 19 Sat 20 Sun 21 Mon 22 Tue 23 Wed 24 Thu 25 Fri 26 Sat 27 Sun 28

Nurses

1 L - L - L L - - - - H - - 163.0

2 E - E E E - - M M N - N - 164.5

3 N - - M N - N - - - - - - 169.5

4 - N - N - N - N - - N - - 163.0

5 - L L - L L M - M M M M - 164.5

6 M M - M M - L L N - L - L 164.0

7 N - N - E - M M M M - M M 164.5

8 M M M - M M - L - L L - L 164.0

9 N - - M N - - H - - L L - 163.0

10 - L - L - L L - L L - L L 169.0

11 L M M - M - - M M M M - M 164.5

12 L - L L - L L - L - - L N 163.5

Period

Morning 5 5 5 5 5 5 5 5 6 5 5 5 5

Evening 4 2 4 3 4 4 3 2 2 2 3 3 3

Night 3 1 1 1 2 1 1 1 1 1 1 1 1

Table 9 Comparison of the solutions obtained from head nurse, mathematical model, and simulated annealing algorithm for solving Example 1

Approach

Computational time (s) Objective function value Gap (%)

Mathematical model (Optimum schedule) 6128.70 SA algorithm (Heuristic schedule) 502.48

Head nurse (Manual schedule) 28800.00

869.13 843.16 619.38

0.00 2.99 28.72

2 750 ■■P

_iu 700 O 650

0 100 200 300 400 500 600 700 800

Elapsed Iterations

Fig. 2 The trend of objective function improvements using the applied simulated annealing algorithm for Example 1

the objective. Several real world constraints such as hospital's policies, labor laws, governmental regulations, and the status of nurses at the end of the previous planning horizon are considered based on observations in a hospital. Due to the shortage of available nurses, a method to find the minimum total number of required nurses was suggested. Then, a mathematical programming model was proposed to maximize the nurses' preferences. The AHP method was used to estimate the weight of each part of the objective function. Since the research problem is shown to be NP-hard, a meta-heuristic algorithm based on SA was applied to heuristically solve the problem. As the steps of

the applied SA algorithm, an initial feasible solution generator algorithm was proposed. Moreover, eight neighborhood structures are applied in order to provide more chance for the algorithm to find good solutions.

To evaluate the performance of the applied SA algorithm, test problems were generated randomly and are solved using the mathematical model and the SA algorithm. Computational results indicate that the applied SA algorithm converges to good-quality solutions in a short period of time with an average percentage gap of 5.49 % compared to the upper bounds of mathematical model obtained from CPLEX optimizer. This advantage can be used if there is a time limit to solve a problem.

Future research can be performed by solving the proposed research problem by considering different skill levels for the nurses or considering priorities for senior nurses.

Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://crea-tivecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

Appendix 1: The outline of pseudo-code for the applied SA algorithm

Stepl: Generate an initial feasible solution x using the proposed algorithm for generating the initial feasible solution.

Step2: Specify the rate of cooling (5), initial temperature (T), and the number of iterations in

each temperature (K). Step3: Repeat the following steps:

• Set repetition counter k = 0.

• Repeat the following steps:

- Generate a neighbor solution x' by implementing all eight applied neighborhood structures on current solution x after each other from the first one to the last one.

- Calculate objective function value of current solution (f(x)) and neighbor solution (J(x'J).

- Calculate A = /(*') - /(*).

- If A> 0, then x *- x'. Else x <- x' with probability of Exp(^/j).

- k*-k + 1 Until k == K.

• T<- ST

Until stopping criterion is met (i.e., T == 0.1).

Appendix 2: The result of analysis of variance related to the all 60 test problems

Source Degree Sum of Mean of F- P value

of square square value

freedom

Treatments 8 200657705.30 25082213.20 68.53 <0.0001

(neighborhood

structures)

Blocks (test 59 839349754.10 14226267.00

problems)

Error 472 172755658.00 366008.00

Total 539 1212763117.00

Appendix 3: The results of Tukey test related

to the all 60 test problems

Algorithms Difference 95 % Confidence

comparison between means limits

CNS-NS7 909.8 692.8 1126.9***

CNS-NS8 1161.3 944.2 1378.3***

CNS-NS5 1306.9 1089.9 1524.0***

CNS-NS6 1712.8 1495.7 1929.8***

CNS-NS3 1825.3 1608.3 2042.4***

CNS-NS4 1847.0 1629.9 2064.0***

CNS-NS2 1946.7 1729.7 2163.7***

CNS-NS1 1949.0 1731.9 2166.0***

NS7-NS8 251.4 34.4 468.5***

NS7-NS5 397.1 180.0 614.1***

NS7-NS6 802.9 585.9 1020.0***

NS7-NS3 915.5 698.4 1132.5***

NS7-NS4 937.1 720.1 1154.2***

NS7-NS2 1036.9 819.8 1253.9***

NS7-NS1 1039.1 822.1 1256.2***

NS8-NS5 145.6 -71.4 362.7

NS8-NS6 551.5 334.4 768.5***

NS8-NS3 664.0 447.0 881.1***

NS8-NS4 685.7 468.6 902.7***

NS8-NS2 785.4 568.4 1002.5***

NS8-NS1 787.7 570.6 1004.7***

NS5-NS6 405.9 188.8 622.9***

NS5-NS3 518.4 301.4 735.4***

NS5-NS4 540.1 323.0 757.1***

NS5-NS2 639.8 422.7 856.8***

NS5-NS1 642.1 425.0 859.1***

NS6-NS3 112.5 -104.5 329.6

NS6-NS4 134.2 -82.8 351.2

NS6-NS2 233.9 16.9 451.0***

NS6-NS1 236.2 19.2 453.2***

NS3-NS4 21.7 -195.4 238.7

NS3-NS2 121.4 -95.7 338.4

Algorithms comparison Difference between means 95 % Confidence limits

NS3-NS1 123.7 -93.4 340.7

NS4-NS2 99.7 -117.3 316.8

NS4-NS1 102.0 -115.0 319.0

NS2-NS1 2.3 -214.8 219.3

Comparisons significant at the 0.05 level are indicated by ***

Appendix 4: The results of Waller-Duncan test related to the all 60 test problems

Waller-Duncan grouping Mean Number of test problems Algorithms

A 2999.6 60 CNS

B 2089.8 60 NS7

C 1838.4 60 NS8

C 1692.7 60 NS5

D 1286.9 60 NS6

E D 1174.3 60 NS3

E D 1152.7 60 NS4

E 1052.9 60 NS2

E 1050.7 60 NS1

Means with the same letter are not significantly different

References

Al-Yakoob M, Sherali HD (2007) Mixed integer programming models for an employee scheduling problem with multiple shifts and work locations. Ann Oper Res 155:119-142 Arthur JL, Ravindran A (1981) A multiple objective nurse scheduling

model. IIE Trans 13(1):55-60 Azaiez MN, Al-Sharif SS (2005) A 0-1 goal programming model for

nurse scheduling. Comput Oper Res 32:491-507 Bard JF, Purnomo H (2005) Preference scheduling for nurses using

column generation. Eur J Oper Res 164:510-534 Bard JF, Purnomo HW (2007) Cyclic preference scheduling of nurses

using a Lagrangian-based heuristic. J Sched 10:5-23 Belien JE, Demeulemeester E (2008) A branch and price approach for integrating nurse and surgery scheduling. Eur J Oper Res 189:652-668

Bertsimas D, Tsitsiklis J (1993) Simulated annealing. Stat Sci 1:10-15

Burke EK, Decausmaecker P, Berghe GV (1999) A hybrid tabu search algorithm for the nurse rostering problem. Simulated Evol Learn 1584:187-194 De Causmaecker P, Vanden Berghe G (2011) A categorisation of

nurse rostering problems. J Sched 14:3-16 Dowsland KD, Thompson JM (2000) Nurse scheduling with knapsacks, networks and tabu search. J Oper Res Soc 51:825-833 Glover F, Kochenberger GA (2003) Handbook of metaheuristics.

Kluwer Academic Publishers, New York Guo M, Wu S, Li B, Rong Y (2014) Maximizing the efficiency of use of nurses under uncertain surgery durations: a case study. Comput Ind Eng 78:313-319

Gutjahr J, Rauner S (2007) An ACO algorithm for a dynamic regional nurse scheduling problem in Austria. Comput Oper Res 34:642-666

Hadwan M, Ayob M, Saber NR, Qu R (2013) A harmony search

algorithm for nurse rostering problems. Inf Sci 233:126-140 He F, Qu R (2012) A constraint programming based column generation approach to nurse rostering problems. Comput Oper Res 39:3331-3343 Hertz A, Kobler D (2000) A framework for the description of

evolutionary algorithms. Eur J Oper Res 126:1-12 Issaoui B, Zidi I, Marcon E, Ghedira K (2015) New multi-objective approach for the home care service problem based on scheduling algorithms and variable neighborhood descent. Electron Notes Discrete Math 47:181-188 Janiszewski G (2003) The nursing shortage in the United States of America: an integrative review of the literature. J Adv Nurs 43:335-343

Legrain A, Bouarab H, Lahrichi N (2015) The nurse scheduling

problem in real-life. J Med Syst (In press) Li J, Burke EK, Curtois T, Petrovic S, Qu R (2012) The falling tide algorithm: a new multi-objective approach for complex workforce scheduling. Omega 40:283-293 Lu K, Lin P, Wu C, Hsieh Y (2002) The relationships amongst turnover intentions, professional commitment and job satisfaction of hospital nurses. J Prof Nurs 18(4):214-219 M'Hallah R, Alkhabbaz A (2013) Scheduling of nurses: a case study of a Kuwaiti health care unit. Oper Res Health Care 2:1-19

Maenhout B, Vanhoucke M (2010) Branching strategies in a branch-and-price approach for a multiple objective nurse scheduling problem. J Sched 13:77-93 Majumdar J, Bhunia AK (2007) Elitist genetic algorithm for assignment problem with imprecise goal. Eur J Oper Res 177:684-692

Miller H, Pierskalla EW, Rath G (1976) Nurse scheduling using

mathematical programming. Oper Res 24:857-870 Murray M (2002) The nursing shortage: past, present, and future.

J Nurs Adm 32:79-84 Osogami T, Imai H (2000) Classification of various neighborhood operations for the nurse scheduling problem. Lect Notes Comput Sci 1969:72-83

Saati TL (1977) A scaling method for priorities in hierarchical

structures. J Math Psychol 15:234-281 Valouxis C, Gogos C, Goulas G, Alefragis P, Housos E (2012) A systematic two phase approach for the nurse rostering problem. Eur J Oper Res 219:425-433 Wong TC, Xu M, Chin KS (2014) A two-stage heuristic approach for nurse scheduling problem: a case study in an emergency department. Comput Oper Res 51:99-110 Wright PD, Mahar S (2013) Centralized nurse scheduling to simultaneously improve schedule cost and nurse satisfaction. Omega 41:1042-1052