# Nurse Scheduling Using Genetic Algorithm

Authors: Komgrit Leksakul; Sukrit Phetsawat
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

This study applied engineering techniques to develop a nurse scheduling model that, while maintaining the highest level of service, simultaneously minimized hospital-staffing costs and equitably distributed overtime pay. In the mathematical model, the objective function was the sum of the overtime payment to all nurses and the standard deviation of the total overtime payment that each nurse received. Input data distributions were analyzed in order to formulate a simulation model to determine the optimal demand for nurses that met the hospital’s service standards. To obtain the optimal nurse schedule with the number of nurses acquired from the simulation model, we proposed a genetic algorithm (GA) with two-point crossover and random mutation. After running the algorithm, we compared the expenses and number of nurses between the existing and our proposed nurse schedules. For January 2013, the nurse schedule obtained by GA could save 12% in staffing expenses per month and 13% in number of nurses when compare with the existing schedule, while more equitably distributing overtime pay between all nurses.


---

## Body

## 1. Introduction

In order to succeed in organization management, one of the important factors that should be taken into consideration is human resource management within the organization for maximum efficiency at all times. This will enable the organization to always drive the mission to the target successfully with the highest efficiency and effectiveness. For personnel management within hospitals, scheduling the work of nurses is one factor that is important and difficult to manage for maximum efficiency due to the uncertainty of the number of patients each day, which causes difficulty in managing nursing staff to adequately and appropriately provide services to patients. If there are too many nurses, the hospital will likely unnecessarily waste the budget. However, if there are too few nurses, the hospital will not have enough nurses for all the patients or each nurse may receive or have to take on excessive workload [1]. Due to the high complication associated with nurse scheduling problems, using people to schedule may cause errors easily, such as the task not being done with high effectiveness and the process taking longer times.Approaches in the 1970s and 1980s addressed a number of problem formulations and solution techniques. A goal in many studies was to provide support tools to reduce the need for manual construction of nurse scheduling. Some studies [2–6] addressed the problem of determining staff levels and skills based on the numbers of patients and their medical need. Further advances [7–9] were made in applying linear and mixed integer programming and network optimization techniques for developing nurse scheduling. The numbers of researches have included a mix of heuristic and simulation techniques in an attempt to deal with more complex nurse scheduling. As real world problems are immense and deal with many constraints heuristics and recently metaheuristic such as simulated annealing (SA), tabu search (TA), and genetic algorithms (GA) have been developed to generate high quality nurse schedules in an acceptable computation time. Reference [10] proposed TA for constructing nurse scheduling whose objective is to ensure that enough nurses are on duty at all times while taking account of individual preference and requests for days off in a way that is seen to treat all nurses fairly. Recently, GA has been applied to staff scheduling in different application areas such as transportation systems [11], health care systems [12], emergency services, ambulance and fire brigade, call centers, and many other service organizations.In this paper, we intended to solve nurse scheduling problem by combining mathematical model, computer simulation, and GA. Nonlinear integer model was formulated. The average total overtime payment and fairly payment to all the nurses were considered to minimize which maintains the standard of service level. When mathematical models are applied to solve the problems, the objective function becomes the sum of the overtime payment of all the nurses and the standard deviation of the total overtime payment that each nurse received. This study aimed to create the most appropriate nurse scheduling model by applying the simulation technique to analyze the distribution of the data. Thereafter, a simulation model was created to determine the appropriate demand for nurses with no more than 15% of patients waiting longer than the average service time, as well as those with more than 25% of patients waiting, and, with the application of GA coding in Matlab program, to calculate the best work schedule from the most appropriate demand for nurses acquired from the simulation. Then the expenses and the number of nurses from the new work schedule were compared with the actual expenses of the work schedule and the previous number of nurses.


## 2. Problem Analysis and Formulation

### 2.1. Cause and Problem Analysis of Nurse Scheduling

Currently, one hospital is using manpower planning for nurse scheduling. This method involves workload and productivity efficiency measure per hour of work on average by having 20 nurses in the outpatient department who are rotated for work in the following five departments:(
1
) department of surgery (SUR), (
2
) department of internal medicine (MED), (
3
) department of eye, ear, nose, and throat (EENT), (
4
) department of pediatrics (PED), and (
5
) department of obstetrics and gynecology (OBG). There are two types of nurses’ working schedules: 8 hours per day (08.00–16.00 hours) and 12 hours per day (8.00–20.00 hours), with fixed workload each day, and the working time cannot be changed at this stage. This causes problems while allocating the holidays in order to meet the needs of the nurses [13, 14].Nurse scheduling at this hospital uses only one format which assigns the same number of nurses to take care of each department every week. This format of scheduling is not consistent with the number of patients treated each day and does not bring into consideration factors related to service levels and queuing systems in nurse scheduling. It is not possible to allocate similar rates of overtime payment for all nurses. The researcher emphasizes the importance of an appropriate and effective nurse scheduling model for ensuring the least cost to the hospital while maintaining the level of service of the hospital and being fair in paying overtime to all the nurses at similar rates by using simulation and optimization method to create the most appropriate nurse scheduling.


### 2.2. Mathematical Modeling and Demand Function

We created the objective and the limitation equations under various conditions based on the information obtained from the hospital by developing an integer programming mathematical model with assignment problem [15, 16]. The preliminary data were set in the following conditions:
(1)
x
i
j
k
l
=
1
,
when
nurse
i
works
on
⁡
date
j
at
time
k
in
department
l
0
,
otherwise
,
where i
=
1,2
,
3
,
…
,
20 (nurse), j
=
1,2
,
3
,
…
,
7 (seven working days: Monday, Tuesday, Wednesday
,
…, Sunday), k
=
1,2 (two working shifts: regular working hours (08.00–16.00 hours) and overtime hours (16.00–20.00 hours)), l
=
1,2
,
3,4
,
5 (department of surgery (SUR), department of internal medicine (MED), department of eye, ear, nose, and throat (EENT), department of pediatrics (PED), and department of obstetrics and gynecology (OBG)), N = total number of nurses, SOT = sum of all the overtime payments that nurses receive, SD = standard deviation of the total overtime payment that each nurse receives, AVG = average of total overtime payment that each nurse receives, OTD
i
j
l = additional overtime payment that nurse i receives on the working date j in the department l, OTW
i = overtime payment that nurse i receives in a week, OTS
i = total overtime payment that nurse i receives, and Demand
j
k
l = demand for nurses on date j at time k in the department l.The objective equation includes two purposes.(1)
The expenses of the hospital are minimal.
(2)
The standard deviations of the total overtime payments of the nurses are the most similar.Doing a calculation to find the answers for the problem patterns with multiple objectives would be highly complicated, and it would be difficult to find an answer. To make it easier to calculate, two equations were combined together. However, since both the equations are in different units, to include the two together, it is necessary to change them into the same unit by making these two equations in the form of a percentage of the total. Weighting the importance of the target functions tow percent and 1
-
w percent, respectively, will make up the sum of the hospital cost percentage equation, and the standard deviation of the total overtime payment that each nurse receives can be estimated as follows:
(2)
Min
⁡
Z
=
w
×
SOT
AvgSOT
+
1
-
w
×
SD
AvgSD
,
where w = weight adjusted, AvgSOT = sum of average total overtime payment that every nurse receives in that particular month, and AvgSD = standard deviation of the total overtime payment that each nurse receives in that particular month.Constraints equation includes the following.(1)
The number of nurses must be adequate to meet the needs of the patients in each working period and day:(3)
∑
i
=
1
N
x
i
j
k
l
≥
Demand
j
k
l
∀
j
∀
k
∀
l
.
(2)
One nurse must work at least 40 hours per week (4) but fewer than 60 hours per week (5):
(4)
8
×
∑
l
=
1
5
∑
j
=
1
7
x
i
j
1
l
+
4
×
∑
l
=
1
5
∑
j
=
1
7
x
i
j
2
l
≥
40
∀
i
(5)
8
×
∑
l
=
1
5
∑
j
=
1
7
x
i
j
1
l
+
4
×
∑
l
=
1
5
∑
j
=
1
7
x
i
j
2
l
≤
60
∀
i
.
(3)
All nurses must be selected to work (6) and work not over six days per week (7):
(6)
∑
j
=
1
7
x
i
j
k
l
≥
1
∀
i
∀
k
∀
l
(7)
∑
j
=
1
7
x
i
j
k
l
≤
6
∀
i
∀
k
∀
l
.
(4)
In a day, one nurse can work only one period in one department:(8)
x
i
j
11
+
x
i
j
12
+
x
i
j
13
+
x
i
j
14
+
x
i
j
15
≤
1
∀
i
∀
j
,
x
i
j
21
+
x
i
j
22
+
x
i
j
23
+
x
i
j
24
+
x
i
j
25
≤
1
∀
i
∀
j
.Equations related to expenses are as follows.When nurses work for more than 40 hours in a week, they will receive an overtime payment of 650 Baht per eight hours or 81.25 Baht per hour, and if within 16.00–20.00 hours, they will receive 50 Baht extra overtime payment per working day:(9)
OTS
i
=
81.25
×
8
×
∑
l
=
1
5
∑
j
=
1
7
x
i
j
1
l
+
4
×
∑
l
=
1
5
∑
j
=
1
7
x
i
j
2
l
-
40
+
∑
j
=
1
7
50
×
∑
l
=
1
5
x
i
j
2
l
∀
i
,
AVG
=
∑
i
=
1
N
OTS
i
N
,
SOT
=
∑
i
=
1
N
OTS
i
,
SD
=
∑
i
=
1
N
OTS
i
-
AVG
2
N
.
After that, the least number of nurses i is determined in order to be scheduled under existing limitations.Proposed mathematical model with objective function (2) subject to constraints (3)–(9) was verified by simple problem, as shown in Table 1. With the conventional exact solution approach, the nurse scheduling was constructed for two departments, SUR and MED, and reported by Gantt chart, as shown in Table 2. In Table 2, * and # represent the schedule of SUR and MED, respectively. Lingo software also reported that the mathematical model is nonlinear model with integer variables.Table 1
Demand for nurses: verify case study.
Department
Period
Hospital demand (person)
Mon.
Tue.
Wed.
Thu.
Fri.
Sat.
Sun.
SUR
Regular
1
1
2
1
2
1
2
Overtime
1
2
1
2
1
1
1
MED
Regular
2
1
2
1
1
1
1
Overtime
1
1
1
2
1
2
2Table 2
The Gantt chart of nurses’ working schedule was constructed by the Lingo program.
Nurses
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
Total hours
Regular hours
Overtime
Regular hours
Overtime
Regular hours
Overtime
Regular hours
Overtime
Regular hours
Overtime
Regular hours
Overtime
Regular hours
Overtime
1
*
*
*
*
#
#
40
2
#
*
*
#
#
#
40
3
#
*
*
#
*
*
40
4
#
*
#
*
#
*
40
5
#
*
#
#
*
#
40
6
*
#
#
#
*
*
40
7
#
#
*
*
*
*
40
8
#
#
*
#
#
*
40
9
*
*
#
#
#
#
40
10
*
#
*
*
#
#
40


## 2.1. Cause and Problem Analysis of Nurse Scheduling

Currently, one hospital is using manpower planning for nurse scheduling. This method involves workload and productivity efficiency measure per hour of work on average by having 20 nurses in the outpatient department who are rotated for work in the following five departments:(
1
) department of surgery (SUR), (
2
) department of internal medicine (MED), (
3
) department of eye, ear, nose, and throat (EENT), (
4
) department of pediatrics (PED), and (
5
) department of obstetrics and gynecology (OBG). There are two types of nurses’ working schedules: 8 hours per day (08.00–16.00 hours) and 12 hours per day (8.00–20.00 hours), with fixed workload each day, and the working time cannot be changed at this stage. This causes problems while allocating the holidays in order to meet the needs of the nurses [13, 14].Nurse scheduling at this hospital uses only one format which assigns the same number of nurses to take care of each department every week. This format of scheduling is not consistent with the number of patients treated each day and does not bring into consideration factors related to service levels and queuing systems in nurse scheduling. It is not possible to allocate similar rates of overtime payment for all nurses. The researcher emphasizes the importance of an appropriate and effective nurse scheduling model for ensuring the least cost to the hospital while maintaining the level of service of the hospital and being fair in paying overtime to all the nurses at similar rates by using simulation and optimization method to create the most appropriate nurse scheduling.


## 2.2. Mathematical Modeling and Demand Function

We created the objective and the limitation equations under various conditions based on the information obtained from the hospital by developing an integer programming mathematical model with assignment problem [15, 16]. The preliminary data were set in the following conditions:
(1)
x
i
j
k
l
=
1
,
when
nurse
i
works
on
⁡
date
j
at
time
k
in
department
l
0
,
otherwise
,
where i
=
1,2
,
3
,
…
,
20 (nurse), j
=
1,2
,
3
,
…
,
7 (seven working days: Monday, Tuesday, Wednesday
,
…, Sunday), k
=
1,2 (two working shifts: regular working hours (08.00–16.00 hours) and overtime hours (16.00–20.00 hours)), l
=
1,2
,
3,4
,
5 (department of surgery (SUR), department of internal medicine (MED), department of eye, ear, nose, and throat (EENT), department of pediatrics (PED), and department of obstetrics and gynecology (OBG)), N = total number of nurses, SOT = sum of all the overtime payments that nurses receive, SD = standard deviation of the total overtime payment that each nurse receives, AVG = average of total overtime payment that each nurse receives, OTD
i
j
l = additional overtime payment that nurse i receives on the working date j in the department l, OTW
i = overtime payment that nurse i receives in a week, OTS
i = total overtime payment that nurse i receives, and Demand
j
k
l = demand for nurses on date j at time k in the department l.The objective equation includes two purposes.(1)
The expenses of the hospital are minimal.
(2)
The standard deviations of the total overtime payments of the nurses are the most similar.Doing a calculation to find the answers for the problem patterns with multiple objectives would be highly complicated, and it would be difficult to find an answer. To make it easier to calculate, two equations were combined together. However, since both the equations are in different units, to include the two together, it is necessary to change them into the same unit by making these two equations in the form of a percentage of the total. Weighting the importance of the target functions tow percent and 1
-
w percent, respectively, will make up the sum of the hospital cost percentage equation, and the standard deviation of the total overtime payment that each nurse receives can be estimated as follows:
(2)
Min
⁡
Z
=
w
×
SOT
AvgSOT
+
1
-
w
×
SD
AvgSD
,
where w = weight adjusted, AvgSOT = sum of average total overtime payment that every nurse receives in that particular month, and AvgSD = standard deviation of the total overtime payment that each nurse receives in that particular month.Constraints equation includes the following.(1)
The number of nurses must be adequate to meet the needs of the patients in each working period and day:(3)
∑
i
=
1
N
x
i
j
k
l
≥
Demand
j
k
l
∀
j
∀
k
∀
l
.
(2)
One nurse must work at least 40 hours per week (4) but fewer than 60 hours per week (5):
(4)
8
×
∑
l
=
1
5
∑
j
=
1
7
x
i
j
1
l
+
4
×
∑
l
=
1
5
∑
j
=
1
7
x
i
j
2
l
≥
40
∀
i
(5)
8
×
∑
l
=
1
5
∑
j
=
1
7
x
i
j
1
l
+
4
×
∑
l
=
1
5
∑
j
=
1
7
x
i
j
2
l
≤
60
∀
i
.
(3)
All nurses must be selected to work (6) and work not over six days per week (7):
(6)
∑
j
=
1
7
x
i
j
k
l
≥
1
∀
i
∀
k
∀
l
(7)
∑
j
=
1
7
x
i
j
k
l
≤
6
∀
i
∀
k
∀
l
.
(4)
In a day, one nurse can work only one period in one department:(8)
x
i
j
11
+
x
i
j
12
+
x
i
j
13
+
x
i
j
14
+
x
i
j
15
≤
1
∀
i
∀
j
,
x
i
j
21
+
x
i
j
22
+
x
i
j
23
+
x
i
j
24
+
x
i
j
25
≤
1
∀
i
∀
j
.Equations related to expenses are as follows.When nurses work for more than 40 hours in a week, they will receive an overtime payment of 650 Baht per eight hours or 81.25 Baht per hour, and if within 16.00–20.00 hours, they will receive 50 Baht extra overtime payment per working day:(9)
OTS
i
=
81.25
×
8
×
∑
l
=
1
5
∑
j
=
1
7
x
i
j
1
l
+
4
×
∑
l
=
1
5
∑
j
=
1
7
x
i
j
2
l
-
40
+
∑
j
=
1
7
50
×
∑
l
=
1
5
x
i
j
2
l
∀
i
,
AVG
=
∑
i
=
1
N
OTS
i
N
,
SOT
=
∑
i
=
1
N
OTS
i
,
SD
=
∑
i
=
1
N
OTS
i
-
AVG
2
N
.
After that, the least number of nurses i is determined in order to be scheduled under existing limitations.Proposed mathematical model with objective function (2) subject to constraints (3)–(9) was verified by simple problem, as shown in Table 1. With the conventional exact solution approach, the nurse scheduling was constructed for two departments, SUR and MED, and reported by Gantt chart, as shown in Table 2. In Table 2, * and # represent the schedule of SUR and MED, respectively. Lingo software also reported that the mathematical model is nonlinear model with integer variables.Table 1
Demand for nurses: verify case study.
Department
Period
Hospital demand (person)
Mon.
Tue.
Wed.
Thu.
Fri.
Sat.
Sun.
SUR
Regular
1
1
2
1
2
1
2
Overtime
1
2
1
2
1
1
1
MED
Regular
2
1
2
1
1
1
1
Overtime
1
1
1
2
1
2
2Table 2
The Gantt chart of nurses’ working schedule was constructed by the Lingo program.
Nurses
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
Total hours
Regular hours
Overtime
Regular hours
Overtime
Regular hours
Overtime
Regular hours
Overtime
Regular hours
Overtime
Regular hours
Overtime
Regular hours
Overtime
1
*
*
*
*
#
#
40
2
#
*
*
#
#
#
40
3
#
*
*
#
*
*
40
4
#
*
#
*
#
*
40
5
#
*
#
#
*
#
40
6
*
#
#
#
*
*
40
7
#
#
*
*
*
*
40
8
#
#
*
#
#
*
40
9
*
*
#
#
#
#
40
10
*
#
*
*
#
#
40


## 3. Building Simulation to Find Appropriate Demand for Nurses

In this case, since a service criterion system has not been in use in the hospital, the demand for nurses as in the present may not be an appropriate demand for finding the least cost work schedule. The researcher examined an appropriate demand for nurses (Demand
j
k
l) by creating a simulation using the Arena program to determine the appropriate demand for nurses in each department and in all the periods of each day from the original hospital data. It was found that, on average, 34.08% or 54.87 patients per week had waited longer than 25% of the total average service time. Therefore, the researcher aimed to bring about an improvement at the initial state itself by creating a simulation under the service criteria that set the limitation as only 15% of the patients on average did not have to wait longer than 25% of the total average service time.


### 3.1. Data Collection of Patient Service and Nursing Service Duration

For the data collection of each department at each period of each day (starting from when the patients register until they wait to see a doctor), the researcher chose to use the data as each day in the month to represent day in that month. Collecting data were done by the quality assurance section in case study hospital; they defined the outpatient based on the combination of appointments and walk-ins. Interarrival time for regular and overtime hour including service time has been collected for two years in winter season which has the largest number of outpatients. The interarrival time for regular and overtime periods were separately collected, due to significant static data. However, no significant difference was noticed for service time. Then, the data were classified by day in a week and analyzed for their statistics distribution for three categories.


### 3.2. Data Distribution Analysis

The data were analyzed by using a suitable dispersion, input analyzer, in the Arena program, and by selecting the distribution with the highestP value using the significance level (α) at 0.05 (95% confidence), as shown in Table 3. The P value is a key concept in the approach of Ronald Fisher, where he uses it to measure the weight of the data against a specified hypothesis and as a guideline to ignore data that does not reach a specified significance level.Table 3
Distribution patients interarrival and service time.
Day
Department
Regular hour
Overtime hour
Service time
P value
Avg. time
Interarrival time
P value
Interarrival time
P value
Monday
SUR
−0.5 + EXPO(8.52)
0.333
−0.5 + EXPO(10.7)
0.225
0.5 + WEIB(7.11, 1.85)
>0.750
6.84
MED
−0.5 + EXPO(5.39)
0.654
−0.5 + EXPO(7.68)
0.616
POIS(4.13)
0.051
4.13
PED
−0.5 + WEIB(9.51, 1.14)
0.113
−0.5 + EXPO(12.3)
0.075
0.5 + EXPO(6.5)
0.078
7.00
EENT
−0.5 + EXPO(9.54)
0.478
5.5 + EXPO(16.5)
0.171
0.5 + EXPO(4.58)
0.615
5.08
OBG
−0.5 + WEIB(14.6, 1.54)
0.465
11.5 + EXPO(22.5)
0.228
TRIA(2.5, 3, 19.5)
0.244
9.10
Tuesday
SUR
−0.5 + WEIB(10.5, 1.2)
0.334
−0.5 + WEIB(9.87, 0.925)
0.702
0.5 + 18 * BETA(0.774, 1.25)
0.481
7.40
MED
−0.5 + WEIB(6.32, 1.33)
0.510
−0.5 + EXPO(9.13)
0.746
0.5 + LOGN(4.12, 5.32)
0.109
4.43
PED
−0.5 + EXPO(5.6)
0.607
−0.5 + ERLA(4.98, 2)
0.526
1.5 + EXPO(8.7)
0.066
10.20
EENT
−0.5 + GAMM(6.63, 1.11)
0.063
−0.5 + EXPO(10.5)
0.057
0.5 + 18 * BETA(0.409, 1.23)
0.427
4.98
OBG
−0.5 + GAMM(7.59, 1.3)
0.145
1.5 + EXPO(30.1)
0.125
TRIA(2.5, 5.96, 19.5)
0.421
9.32
⋮
⋮
⋮
⋮
⋮
⋮
Sunday
SUR
−0.5 + LOGN(9.7, 12.6)
>0.750
−0.5 + EXPO(14.4)
0.068
0.5 + 17 * BETA(0.76, 1.06)
0.581
7.37
MED
−0.5 + GAMM(9.47, 1.16)
0.283
1.5 + EXPO(22.4)
0.105
UNIF(0.5, 18.5)
0.589
8.76
PED
−0.5 + WEIB(5.12, 0.841)
0.197
−0.5 + EXPO(10.3)
0.733
0.5 + EXPO(4.5)
0.210
5.00
EENT
−0.5 + LOGN(10.5, 16.6)
0.349
UNIF(−0.5, 19.5)
0.438
0.5 + 19 * BETA(0.898, 1.56)
0.489
7.44
OBG
−0.5 + LOGN(13.1, 20.7)
0.673
0.5 + EXPO(17.5)
0.097
POIS(6.35)
0.126
6.35


### 3.3. Simulation Modeling

We created a simulation modeling starting from when the patient registered at the service department based on interarrival time and service time statistics distribution reported in Table3. Because these statistics distributions consider the arrival of appointment and walk-in patients then this simulation model can take into account the dynamics of walk-in patients. Beginning with statistics distributions patients’ arrival, patients had registered at the service department. According to patient’s symptom, they had moved to required department counter and waited for medical history file. To parallel with file searching and coming, patients had queued and waited for nurse service. Nurses served the fundamental examination such as weight, blood pressure, temperature measure, pre-symptom examined and finally recorded all measure data in the file after it arrived. Service time distributions recorded and fitted by statistic approach in Table 3 were used as the data set in process box. After that, we saved the percentage information of those patients whose waiting time exceeded the service time limitation, as shown in Figure 1.Figure 1
The simulation model created by the Arena program.Then we adjusted the number of nurses (resource) in the capacity column manually, as shown in Table4, until the percentage of the patients waiting for more than the limit (average and half-width) in each department was less than 15%, according to what we wanted in every section, as shown in Table 5. After that, we processed 100 replications.Table 4
The example for adjusting the number of nurses in the Arena program.
Name
Type
Capacity
1
Resource SUR
Fixed capacity
2
2
Resource MED
Fixed capacity
2
3
Resource PED
Fixed capacity
3
4
Resource EENT
Fixed capacity
2
5
Resource OBG
Fixed capacity
1Table 5
Average and half-width values based on number of nurses adjusted.
Output
Average
Half-width
EENT
0.4418
0.35
MED
1.2505
0.80
OBG
3.4024
1.64
PED
1.6794
1.04
SUR
4.4273
1.25From Table4, it can be observed that the departments of SUR, MED, and EENT appointed two people, PED appointed three people, and OBG appointed one person to work in their departments.From Table5, we can see that all the departments with the percentage of patients waiting for more than the limit (average and half-width) do not exceed 15%. The EENT, MED, OBG, PED, and SUR departments had the percentages of patients waiting for longer than the limit (average plus positive half-width) at 0.7918%, 2.0505%, 5.0424%, 2.7194%, and 5.6773%, respectively. We considered only the positive half-width because we would like to know the maximum percentage of patients waiting.


### 3.4. Simulation Model Verification

In model verification, we compared the results between real situation which occurred in this hospital and the simulation model. Average number of patients receiving service, average number of patients waiting longer than average service time, and average number of patients waiting less than average service time were proposed for preforming simulation model efficient. The 100 times with eight-hour simulation were conducted for all five outpatients departments. The results were reported in Table6. In simulation row, we reported the average number plus/minus with their corresponding half-width.Table 6
Comparison between real situation and simulation model.
Department
Calculated result
AVG number of patients receiving service
AVG number of patients waiting longer than AVG time
AVG number of patients waiting less than AVG time
Percentage of patients waiting longer than AVG time
SUR
Real situation
59
0.2
58
0.338%
Simulation
61.63 ± 1.63
0.19 ± 0.36
60.51± 1.66
0.196± 0.32%
% error
4.27%
5.26%
4.33%
—
MED
Real situation
96
0
98
0%
Simulation
98.79 ± 1.91
0 ± 0
97.94 ± 1.91
0%
% error
2.90%
0%
0.06%
—
PED
Real situation
55
0
53
0%
Simulation
57.58 ± 1.48
0 ± 0
56.69 ± 1.46
0%
% error
4.69%
0%
6.96%
—
EENT
Real situation
53
18.2
34
34.34%
Simulation
54.46 ± 1.76
16.73 ± 4.14
36.64 ± 3.46
19.99 ± 5.12%
% error
2.75%
8.07%
7.76%
—
OBG
Real situation
34
0
35
0%
Simulation
38.4 ± 0.85
0± 0
37.7 ± 0.84
0%
% error
12.94%
0%
7.71%
—Table6 reported that the OBG got the highest % error in terms of average number of patients receiving service due to the low P value reported in Table 3. With this error, however, we can adopt this simulation model generated by the arena program for real case application.After model verification, manual adjustment of the resource capacity was done and selected under hospital top management service policy. The service level policy was set as no more than 15% of patients waiting longer than the average service time. Then, the appropriate resource (number of nurses) from simulation was shown for each department in Table7. This number of nurses will be used as the data for nurses demand (Demand
j
k
l) in the mathematical model for obtaining the optimal nurse schedule. Even though, to obtain the optimal nurse schedule with conventional approach always consumes computational runtime and hardware implementation. Genetic algorithm was proposed to solve and obtain an acceptable solution.Table 7
Demand for nurses obtained from simulation model.
Department
Period
Hospital demand (person)
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
SUR
Regular
2
2
2
2
2
2
2
MED
3
3
3
3
3
2
2
PED
3
3
3
3
3
3
3
EENT
2
2
2
2
2
2
2
OBG
2
2
2
2
2
2
2
SUR
Overtime
2
2
2
2
2
1
2
MED
3
2
2
2
2
2
2
PED
2
2
2
2
3
2
2
EENT
2
2
2
2
2
2
2
OBG
1
1
1
2
1
1
1


## 3.1. Data Collection of Patient Service and Nursing Service Duration

For the data collection of each department at each period of each day (starting from when the patients register until they wait to see a doctor), the researcher chose to use the data as each day in the month to represent day in that month. Collecting data were done by the quality assurance section in case study hospital; they defined the outpatient based on the combination of appointments and walk-ins. Interarrival time for regular and overtime hour including service time has been collected for two years in winter season which has the largest number of outpatients. The interarrival time for regular and overtime periods were separately collected, due to significant static data. However, no significant difference was noticed for service time. Then, the data were classified by day in a week and analyzed for their statistics distribution for three categories.


## 3.2. Data Distribution Analysis

The data were analyzed by using a suitable dispersion, input analyzer, in the Arena program, and by selecting the distribution with the highestP value using the significance level (α) at 0.05 (95% confidence), as shown in Table 3. The P value is a key concept in the approach of Ronald Fisher, where he uses it to measure the weight of the data against a specified hypothesis and as a guideline to ignore data that does not reach a specified significance level.Table 3
Distribution patients interarrival and service time.
Day
Department
Regular hour
Overtime hour
Service time
P value
Avg. time
Interarrival time
P value
Interarrival time
P value
Monday
SUR
−0.5 + EXPO(8.52)
0.333
−0.5 + EXPO(10.7)
0.225
0.5 + WEIB(7.11, 1.85)
>0.750
6.84
MED
−0.5 + EXPO(5.39)
0.654
−0.5 + EXPO(7.68)
0.616
POIS(4.13)
0.051
4.13
PED
−0.5 + WEIB(9.51, 1.14)
0.113
−0.5 + EXPO(12.3)
0.075
0.5 + EXPO(6.5)
0.078
7.00
EENT
−0.5 + EXPO(9.54)
0.478
5.5 + EXPO(16.5)
0.171
0.5 + EXPO(4.58)
0.615
5.08
OBG
−0.5 + WEIB(14.6, 1.54)
0.465
11.5 + EXPO(22.5)
0.228
TRIA(2.5, 3, 19.5)
0.244
9.10
Tuesday
SUR
−0.5 + WEIB(10.5, 1.2)
0.334
−0.5 + WEIB(9.87, 0.925)
0.702
0.5 + 18 * BETA(0.774, 1.25)
0.481
7.40
MED
−0.5 + WEIB(6.32, 1.33)
0.510
−0.5 + EXPO(9.13)
0.746
0.5 + LOGN(4.12, 5.32)
0.109
4.43
PED
−0.5 + EXPO(5.6)
0.607
−0.5 + ERLA(4.98, 2)
0.526
1.5 + EXPO(8.7)
0.066
10.20
EENT
−0.5 + GAMM(6.63, 1.11)
0.063
−0.5 + EXPO(10.5)
0.057
0.5 + 18 * BETA(0.409, 1.23)
0.427
4.98
OBG
−0.5 + GAMM(7.59, 1.3)
0.145
1.5 + EXPO(30.1)
0.125
TRIA(2.5, 5.96, 19.5)
0.421
9.32
⋮
⋮
⋮
⋮
⋮
⋮
Sunday
SUR
−0.5 + LOGN(9.7, 12.6)
>0.750
−0.5 + EXPO(14.4)
0.068
0.5 + 17 * BETA(0.76, 1.06)
0.581
7.37
MED
−0.5 + GAMM(9.47, 1.16)
0.283
1.5 + EXPO(22.4)
0.105
UNIF(0.5, 18.5)
0.589
8.76
PED
−0.5 + WEIB(5.12, 0.841)
0.197
−0.5 + EXPO(10.3)
0.733
0.5 + EXPO(4.5)
0.210
5.00
EENT
−0.5 + LOGN(10.5, 16.6)
0.349
UNIF(−0.5, 19.5)
0.438
0.5 + 19 * BETA(0.898, 1.56)
0.489
7.44
OBG
−0.5 + LOGN(13.1, 20.7)
0.673
0.5 + EXPO(17.5)
0.097
POIS(6.35)
0.126
6.35


## 3.3. Simulation Modeling

We created a simulation modeling starting from when the patient registered at the service department based on interarrival time and service time statistics distribution reported in Table3. Because these statistics distributions consider the arrival of appointment and walk-in patients then this simulation model can take into account the dynamics of walk-in patients. Beginning with statistics distributions patients’ arrival, patients had registered at the service department. According to patient’s symptom, they had moved to required department counter and waited for medical history file. To parallel with file searching and coming, patients had queued and waited for nurse service. Nurses served the fundamental examination such as weight, blood pressure, temperature measure, pre-symptom examined and finally recorded all measure data in the file after it arrived. Service time distributions recorded and fitted by statistic approach in Table 3 were used as the data set in process box. After that, we saved the percentage information of those patients whose waiting time exceeded the service time limitation, as shown in Figure 1.Figure 1
The simulation model created by the Arena program.Then we adjusted the number of nurses (resource) in the capacity column manually, as shown in Table4, until the percentage of the patients waiting for more than the limit (average and half-width) in each department was less than 15%, according to what we wanted in every section, as shown in Table 5. After that, we processed 100 replications.Table 4
The example for adjusting the number of nurses in the Arena program.
Name
Type
Capacity
1
Resource SUR
Fixed capacity
2
2
Resource MED
Fixed capacity
2
3
Resource PED
Fixed capacity
3
4
Resource EENT
Fixed capacity
2
5
Resource OBG
Fixed capacity
1Table 5
Average and half-width values based on number of nurses adjusted.
Output
Average
Half-width
EENT
0.4418
0.35
MED
1.2505
0.80
OBG
3.4024
1.64
PED
1.6794
1.04
SUR
4.4273
1.25From Table4, it can be observed that the departments of SUR, MED, and EENT appointed two people, PED appointed three people, and OBG appointed one person to work in their departments.From Table5, we can see that all the departments with the percentage of patients waiting for more than the limit (average and half-width) do not exceed 15%. The EENT, MED, OBG, PED, and SUR departments had the percentages of patients waiting for longer than the limit (average plus positive half-width) at 0.7918%, 2.0505%, 5.0424%, 2.7194%, and 5.6773%, respectively. We considered only the positive half-width because we would like to know the maximum percentage of patients waiting.


## 3.4. Simulation Model Verification

In model verification, we compared the results between real situation which occurred in this hospital and the simulation model. Average number of patients receiving service, average number of patients waiting longer than average service time, and average number of patients waiting less than average service time were proposed for preforming simulation model efficient. The 100 times with eight-hour simulation were conducted for all five outpatients departments. The results were reported in Table6. In simulation row, we reported the average number plus/minus with their corresponding half-width.Table 6
Comparison between real situation and simulation model.
Department
Calculated result
AVG number of patients receiving service
AVG number of patients waiting longer than AVG time
AVG number of patients waiting less than AVG time
Percentage of patients waiting longer than AVG time
SUR
Real situation
59
0.2
58
0.338%
Simulation
61.63 ± 1.63
0.19 ± 0.36
60.51± 1.66
0.196± 0.32%
% error
4.27%
5.26%
4.33%
—
MED
Real situation
96
0
98
0%
Simulation
98.79 ± 1.91
0 ± 0
97.94 ± 1.91
0%
% error
2.90%
0%
0.06%
—
PED
Real situation
55
0
53
0%
Simulation
57.58 ± 1.48
0 ± 0
56.69 ± 1.46
0%
% error
4.69%
0%
6.96%
—
EENT
Real situation
53
18.2
34
34.34%
Simulation
54.46 ± 1.76
16.73 ± 4.14
36.64 ± 3.46
19.99 ± 5.12%
% error
2.75%
8.07%
7.76%
—
OBG
Real situation
34
0
35
0%
Simulation
38.4 ± 0.85
0± 0
37.7 ± 0.84
0%
% error
12.94%
0%
7.71%
—Table6 reported that the OBG got the highest % error in terms of average number of patients receiving service due to the low P value reported in Table 3. With this error, however, we can adopt this simulation model generated by the arena program for real case application.After model verification, manual adjustment of the resource capacity was done and selected under hospital top management service policy. The service level policy was set as no more than 15% of patients waiting longer than the average service time. Then, the appropriate resource (number of nurses) from simulation was shown for each department in Table7. This number of nurses will be used as the data for nurses demand (Demand
j
k
l) in the mathematical model for obtaining the optimal nurse schedule. Even though, to obtain the optimal nurse schedule with conventional approach always consumes computational runtime and hardware implementation. Genetic algorithm was proposed to solve and obtain an acceptable solution.Table 7
Demand for nurses obtained from simulation model.
Department
Period
Hospital demand (person)
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
SUR
Regular
2
2
2
2
2
2
2
MED
3
3
3
3
3
2
2
PED
3
3
3
3
3
3
3
EENT
2
2
2
2
2
2
2
OBG
2
2
2
2
2
2
2
SUR
Overtime
2
2
2
2
2
1
2
MED
3
2
2
2
2
2
2
PED
2
2
2
2
3
2
2
EENT
2
2
2
2
2
2
2
OBG
1
1
1
2
1
1
1


## 4. Programming for Genetic Algorithm Nurse Scheduling

We coded a genetic algorithm program for use in the shift scheduling of nurses with the Matlab program by using the following steps.


### 4.1. Chromosome Format and Chromosome Encoding

A chromosome format uses a binary number system, and it is divided into three levels, as shown in Figure2, wherelevel 1 is a nurse at1,2
,
3
,
…
,
N;
level 2 is the working days Monday, Tuesday, Wednesday,
…, Sunday;
level 3 is the number of 8 bit code.Figure 2
The chromosome format.


### 4.2. Chromosome Encoding and Chromosome Decoding

To encode the chromosome, we used the binary coded decimal system which is a system that uses the 8 bit binary code instead of the general code we have set up. We can encode and decode the chromosome, as shown in Table8, where(i)
NDA = not working during regular hours,
(ii)
DA1 = working during regular hours at Division 1,
(iii)
DA2 = working during regular hours at Division 2,
(iv)
DA3 = working during regular hours at Division 3,
(v)
DA4 = working during regular hours at Division 4,
(vi)
DA5 = working during regular hours at Division 5,
(vii)
NOT = not working overtime,
(viii)
OT1 = working overtime at Division 1,
(ix)
OT2 = working overtime at Division 2,
(x)
OT3 = working overtime at Division 3,
(xi)
OT4 = working overtime at Division 4,
(xii)
OT5 = working overtime at Division 5.Table 8
Example for encoding binary coded decimal.
Decimal
Binary
Regular hour
Overtime hour
Code
Type
Demand 1
Demand 2
Hours
0
00000000
NDA
NOT
NDA, NOT
Type 0
0
0
0
1
00000001
DA1
NOT
DA1, NOT
Type 1
DA1++
0
8
2
00000010
DA2
NOT
DA2, NOT
Type 2
DA2++
0
8
3
00000011
DA3
NOT
DA3, NOT
Type 3
DA3++
0
8
⋮
⋮
⋮
⋮
⋮
⋮
⋮
⋮
⋮
255
11111111
NDA
NOT
NDA, NOT
Type 255
0
0
0


### 4.3. Creating Initial Population

Each nurse’s chromosome can be randomly generated for the initial state. Then check whether it is in the scope of primary goal or not, with working hours fewer than 60 hours. If that chromosome is not in the scope of the primary goal, again random search until each nurse’s chromosome completes for the entire length and all the nurse’s chromosomes are generated to reach the number of population specified.


### 4.4. Crossover and Mutation

Crossover is an important operator which combines the good properties of both parents in order to possibly yield new better children chromosomes [17, 18]. As usual, the simple crossover operator (one-point crossover) consists of randomly choosing a crossover point and then recombining the pieces of a pair of chromosomes to form two new chromosomes. The simple crossover is compatible with the random keys encoding, though it generally fails to preserve the permutation when dealing with natural encoding. Hence, for natural encoding, special crossover operators must be used [19]. Roulette wheel selection (RWS), ranking selection (RS), tournament selection (TS), partially matched crossover (PMX), order crossover (OX), and cycle crossover (CX) are evaluated by comparing the performance of GA’s operators on university course timetabling problem [20]. PMX, OX, and CX operators require two crossover points. Given two parent chromosomes, A and B, child chromosome A
′ will inherit form A the subsequence between these two points and child chromosome B
′, form B, the respective subsequence. The elements of A
′ and B
′ outside the two points are copied from the other parent chromosome, while trying to preserve its position under the PMX operator or by trying to preserve its order under the OX operator. A comparative analysis of PMX, CX, and OX crossover operators for solving travelling salesman problem (TSP) was reported in [21]. The experimental results show that the PMX crossover outperforms the CX and OX crossover operator in TSP with 25 numbers of cities. For our problem, simple test was conducted and we found PMX provided a better solution than one-point crossover; specifically, one-point crossover cannot take into account all constraints (3)–(8).After applying crossover, the mutation operator acts on the pairs of chromosomes. Although mutation occurs infrequently in nature, it is believed to be an important driving force for evolution. The mutation is adopted to allow for the introduction of new chromosome into the population and is effective to escape from a local optimum. The simple mutation operates by randomly changing its value with a given probability used in our experiments.


### 4.5. Evaluation of Fitness Value

The fitness value can be evaluated by using two criteria, as follows.Criterion one: a chromosome is a feasible solution.
(
i
)
Fitness value is the objective function that is processed by (2).
Criterion two: a chromosome is a nonfeasible solution.
(
i
)
Fitness value is equal to 1000 units.


### 4.6. Chromosome Selection

We selected the chromosome by using roulette.


### 4.7. Elite Preserve Strategy

The previous chromosomes with high fitness values were replaced by the new chromosomes with the lower fitness values. Then, they were used as the initial population for the next iteration.


### 4.8. Termination Criteria

The condition to stop seeking answers was that when the required number of solutions fully meets the numbers of iteration specified; we stop the examination process immediately.


## 4.1. Chromosome Format and Chromosome Encoding

A chromosome format uses a binary number system, and it is divided into three levels, as shown in Figure2, wherelevel 1 is a nurse at1,2
,
3
,
…
,
N;
level 2 is the working days Monday, Tuesday, Wednesday,
…, Sunday;
level 3 is the number of 8 bit code.Figure 2
The chromosome format.


## 4.2. Chromosome Encoding and Chromosome Decoding

To encode the chromosome, we used the binary coded decimal system which is a system that uses the 8 bit binary code instead of the general code we have set up. We can encode and decode the chromosome, as shown in Table8, where(i)
NDA = not working during regular hours,
(ii)
DA1 = working during regular hours at Division 1,
(iii)
DA2 = working during regular hours at Division 2,
(iv)
DA3 = working during regular hours at Division 3,
(v)
DA4 = working during regular hours at Division 4,
(vi)
DA5 = working during regular hours at Division 5,
(vii)
NOT = not working overtime,
(viii)
OT1 = working overtime at Division 1,
(ix)
OT2 = working overtime at Division 2,
(x)
OT3 = working overtime at Division 3,
(xi)
OT4 = working overtime at Division 4,
(xii)
OT5 = working overtime at Division 5.Table 8
Example for encoding binary coded decimal.
Decimal
Binary
Regular hour
Overtime hour
Code
Type
Demand 1
Demand 2
Hours
0
00000000
NDA
NOT
NDA, NOT
Type 0
0
0
0
1
00000001
DA1
NOT
DA1, NOT
Type 1
DA1++
0
8
2
00000010
DA2
NOT
DA2, NOT
Type 2
DA2++
0
8
3
00000011
DA3
NOT
DA3, NOT
Type 3
DA3++
0
8
⋮
⋮
⋮
⋮
⋮
⋮
⋮
⋮
⋮
255
11111111
NDA
NOT
NDA, NOT
Type 255
0
0
0


## 4.3. Creating Initial Population

Each nurse’s chromosome can be randomly generated for the initial state. Then check whether it is in the scope of primary goal or not, with working hours fewer than 60 hours. If that chromosome is not in the scope of the primary goal, again random search until each nurse’s chromosome completes for the entire length and all the nurse’s chromosomes are generated to reach the number of population specified.


## 4.4. Crossover and Mutation

Crossover is an important operator which combines the good properties of both parents in order to possibly yield new better children chromosomes [17, 18]. As usual, the simple crossover operator (one-point crossover) consists of randomly choosing a crossover point and then recombining the pieces of a pair of chromosomes to form two new chromosomes. The simple crossover is compatible with the random keys encoding, though it generally fails to preserve the permutation when dealing with natural encoding. Hence, for natural encoding, special crossover operators must be used [19]. Roulette wheel selection (RWS), ranking selection (RS), tournament selection (TS), partially matched crossover (PMX), order crossover (OX), and cycle crossover (CX) are evaluated by comparing the performance of GA’s operators on university course timetabling problem [20]. PMX, OX, and CX operators require two crossover points. Given two parent chromosomes, A and B, child chromosome A
′ will inherit form A the subsequence between these two points and child chromosome B
′, form B, the respective subsequence. The elements of A
′ and B
′ outside the two points are copied from the other parent chromosome, while trying to preserve its position under the PMX operator or by trying to preserve its order under the OX operator. A comparative analysis of PMX, CX, and OX crossover operators for solving travelling salesman problem (TSP) was reported in [21]. The experimental results show that the PMX crossover outperforms the CX and OX crossover operator in TSP with 25 numbers of cities. For our problem, simple test was conducted and we found PMX provided a better solution than one-point crossover; specifically, one-point crossover cannot take into account all constraints (3)–(8).After applying crossover, the mutation operator acts on the pairs of chromosomes. Although mutation occurs infrequently in nature, it is believed to be an important driving force for evolution. The mutation is adopted to allow for the introduction of new chromosome into the population and is effective to escape from a local optimum. The simple mutation operates by randomly changing its value with a given probability used in our experiments.


## 4.5. Evaluation of Fitness Value

The fitness value can be evaluated by using two criteria, as follows.Criterion one: a chromosome is a feasible solution.
(
i
)
Fitness value is the objective function that is processed by (2).
Criterion two: a chromosome is a nonfeasible solution.
(
i
)
Fitness value is equal to 1000 units.


## 4.6. Chromosome Selection

We selected the chromosome by using roulette.


## 4.7. Elite Preserve Strategy

The previous chromosomes with high fitness values were replaced by the new chromosomes with the lower fitness values. Then, they were used as the initial population for the next iteration.


## 4.8. Termination Criteria

The condition to stop seeking answers was that when the required number of solutions fully meets the numbers of iteration specified; we stop the examination process immediately.


## 5. Experiment Design to Determine Optimal Configuration in Genetic Programming

In this section, we introduced design of experiment (DOE) technique for screening the effected parameters and parameters setting guideline for genetic algorithm solution search machine. We conducted the experiment by fixing current number of nurses at 18 with the low level nurses’ demand in each department. All three expecting parameters were set by two levels, maximum and minimum.


### 5.1. Determining Factors and Factor Values in Each Level

Factors can be chosen for the experiment as follows:(1)
population number,
(2)
percent crossover rate,
(3)
percent mutation rate.We used the factors in Table9 to construct the experimental design matrix, full factorial design (2
k) (8), and then conducted the experiment by using three center points per block with all the three replicates. We also fixed the number of maximum cycles to 400 cycles. This was because the research revealed that the number of the calculated cycles had high stability. The cycles also took a long time to calculate and, so, may cause inconvenience in their actual use. The number of nurses, 18 in total, was fixed at the beginning for the experimental design, and the results are shown in Table 10 which includes the use of the data for the demand for nurses from the first week of January.Table 9
Selected experimental factors and factor values in each level.
Factor
Level
Low
High
(1) Population number (A)
10
50
(2) Percent crossover rate (B)
5
95
(3) Percent mutation rate (C)
5
95Table 10
Full factorial design (2
3) experiment with three center points per block type.
Run
Std. order
Run order
Center pt.
Blocks
A
B
C
Obj.
Time (s)
1
1
1
1
1
10
5
5
0.45892
9237.521
2
2
2
1
1
50
5
5
0.50282
57621.902
3
3
3
1
1
10
95
5
0.47113
7904.851
⋮
⋮
⋮
⋮
⋮
⋮
⋮
⋮
⋮
⋮
25
25
25
0
1
30
50
50
0.48018
31281.694


### 5.2. Effect and Coefficient Analysis and Model Adequacy Checking

We used the experimental results to analyze the effects and coefficients by using the Minitab program in order to find the factors affecting the expected responses.Figure3 shows that the data were normally and consistently distributed without any tendency and can be used to analyze further results.Figure 3
The residual plots for objective function.Table11 shows that the correlation of the data is linear because the center pt. is greater than 0.05 and the P values of the A, C, A
C, B
C, and A
B
C factors are less than 0.05, which is significant for the experiment. It was concluded that the A and C factors were significant at the confidence level of 0.05, as shown in Figure 4.Table 11
Effect and obj. coefficient analysis results.
Factorial fit: obj. versusA
,
B
,
C
Estimated effects and coefficients for obj. (coded units)
Term
Effect
Coeff.
SE coeff.
T
P
Constant
0.48216
0.001318
365.75
0.000
A
0.05200
0.02600
0.001318
19.72
0.000
B
0.00027
0.00013
0.001318
0.10
0.921
C
−0.02134
−0.01067
0.001318
−8.10
0.000
A
*
B
−0.00285
−0.00143
0.001318
−1.08
0.293
A
*
C
−0.00850
−0.00425
0.001318
−3.22
0.005
B
*
C
−0.01395
−0.00697
0.001318
−5.29
0.000
A
*
B
*
C
−0.00974
−0.00487
0.001318
−3.69
0.002
Ct. Pt.
−0.00198
0.003955
−0.50
0.623Figure 4
The normal plot of the standardized effects (response is obj., alpha = 0.05).TheR-Sq. value ranges from 0 to 1 or from 0% to 100%. If the R-Sq. value is very close to 1, then it indicates that the simulation can explain the different variables more properly and accurately. Table 12 shows that the R-Sq. value is equal to 99.48%, which is very high. This means that the data can explain dependent variables properly and can analyze further response optimizer functions.Table 12
R-square decision-making coefficients.
S = 2082.09  PRESS = 152191461
R-Sq. = 99.48% R-Sq. (pred.) = 98.99% R-Sq. (adj.) = 99.25%


### 5.3. Analysis for Finding out Most Appropriate Results by Using Response Optimizer

The results were analyzed by using a response optimizer of Minitab, as shown in Figures5 and 6.Figure 5
The response optimizer configuration of obj. response.Figure 6
The results of the data analysis using the response optimizer of the obj. response.From the results obtained, as shown in Figure5, this study aims to determine the lowest target equation. As a result, we changed “Goal” to “Minimize” since the target equation was the sum of the hospital expense percentage and the standard deviation of the overtime each nurse received which ranged from 0 to 100. As a result, the target was set to 0 and the upper target to 100.Figure6 shows that if we want to configure the genetic program to obtain the lowest target equation, it must be set as shown in Table 13. From the prediction equation, the target equation should be equal to 0.4492 (obj. = 0.4492). Possible optimal parameters setting may occur at the low level % mutation; we conducted the experiment and reported in Table 14. The reports showed that the objective function is worse when % mutation decreased. The reports also shown that the higher % mutation, the better objective functions.Table 13
Guideline setting for genetic program from response optimizer function.
Factor
Level
(1) Population number (A)
10
(2) Percent crossover rate (B)
95
(3) Percent mutation rate (C)
95Table 14
Experimental results obtained at low level % mutation.
Max. iteration
Population
% crossover
% mutation
Obj.
Time (s)
1500
10
95
95
0.44442
8,049
1500
10
95
1
0.48580
10,161
1500
10
95
0.1
0.50286
10,523
1500
10
95
0.01
0.53612
10,117


### 5.4. Result Confirmation Experiment

We experimented to check for accuracy by configuring the genetic program, as shown in Table12, together with fixing the maximum iterations to the number of nurses at 400 cycles and 18 nurses, respectively, as shown in Table 15.Table 15
Target equation (obj.) predicted by Minitab program and compared with actual target equation (obj.).
Target equation (obj.)
Comparison of target equation (obj.)percentage
Predicted value
Actual value
Actual value compared with predicted value
0.4492
0.4429
0.63%Table15 shows that the actual target value (obj.) is actually better than (i.e., less than) 0.63% of the predicted value and can be used practically and actually decreased the target equation (obj.).


## 5.1. Determining Factors and Factor Values in Each Level

Factors can be chosen for the experiment as follows:(1)
population number,
(2)
percent crossover rate,
(3)
percent mutation rate.We used the factors in Table9 to construct the experimental design matrix, full factorial design (2
k) (8), and then conducted the experiment by using three center points per block with all the three replicates. We also fixed the number of maximum cycles to 400 cycles. This was because the research revealed that the number of the calculated cycles had high stability. The cycles also took a long time to calculate and, so, may cause inconvenience in their actual use. The number of nurses, 18 in total, was fixed at the beginning for the experimental design, and the results are shown in Table 10 which includes the use of the data for the demand for nurses from the first week of January.Table 9
Selected experimental factors and factor values in each level.
Factor
Level
Low
High
(1) Population number (A)
10
50
(2) Percent crossover rate (B)
5
95
(3) Percent mutation rate (C)
5
95Table 10
Full factorial design (2
3) experiment with three center points per block type.
Run
Std. order
Run order
Center pt.
Blocks
A
B
C
Obj.
Time (s)
1
1
1
1
1
10
5
5
0.45892
9237.521
2
2
2
1
1
50
5
5
0.50282
57621.902
3
3
3
1
1
10
95
5
0.47113
7904.851
⋮
⋮
⋮
⋮
⋮
⋮
⋮
⋮
⋮
⋮
25
25
25
0
1
30
50
50
0.48018
31281.694


## 5.2. Effect and Coefficient Analysis and Model Adequacy Checking

We used the experimental results to analyze the effects and coefficients by using the Minitab program in order to find the factors affecting the expected responses.Figure3 shows that the data were normally and consistently distributed without any tendency and can be used to analyze further results.Figure 3
The residual plots for objective function.Table11 shows that the correlation of the data is linear because the center pt. is greater than 0.05 and the P values of the A, C, A
C, B
C, and A
B
C factors are less than 0.05, which is significant for the experiment. It was concluded that the A and C factors were significant at the confidence level of 0.05, as shown in Figure 4.Table 11
Effect and obj. coefficient analysis results.
Factorial fit: obj. versusA
,
B
,
C
Estimated effects and coefficients for obj. (coded units)
Term
Effect
Coeff.
SE coeff.
T
P
Constant
0.48216
0.001318
365.75
0.000
A
0.05200
0.02600
0.001318
19.72
0.000
B
0.00027
0.00013
0.001318
0.10
0.921
C
−0.02134
−0.01067
0.001318
−8.10
0.000
A
*
B
−0.00285
−0.00143
0.001318
−1.08
0.293
A
*
C
−0.00850
−0.00425
0.001318
−3.22
0.005
B
*
C
−0.01395
−0.00697
0.001318
−5.29
0.000
A
*
B
*
C
−0.00974
−0.00487
0.001318
−3.69
0.002
Ct. Pt.
−0.00198
0.003955
−0.50
0.623Figure 4
The normal plot of the standardized effects (response is obj., alpha = 0.05).TheR-Sq. value ranges from 0 to 1 or from 0% to 100%. If the R-Sq. value is very close to 1, then it indicates that the simulation can explain the different variables more properly and accurately. Table 12 shows that the R-Sq. value is equal to 99.48%, which is very high. This means that the data can explain dependent variables properly and can analyze further response optimizer functions.Table 12
R-square decision-making coefficients.
S = 2082.09  PRESS = 152191461
R-Sq. = 99.48% R-Sq. (pred.) = 98.99% R-Sq. (adj.) = 99.25%


## 5.3. Analysis for Finding out Most Appropriate Results by Using Response Optimizer

The results were analyzed by using a response optimizer of Minitab, as shown in Figures5 and 6.Figure 5
The response optimizer configuration of obj. response.Figure 6
The results of the data analysis using the response optimizer of the obj. response.From the results obtained, as shown in Figure5, this study aims to determine the lowest target equation. As a result, we changed “Goal” to “Minimize” since the target equation was the sum of the hospital expense percentage and the standard deviation of the overtime each nurse received which ranged from 0 to 100. As a result, the target was set to 0 and the upper target to 100.Figure6 shows that if we want to configure the genetic program to obtain the lowest target equation, it must be set as shown in Table 13. From the prediction equation, the target equation should be equal to 0.4492 (obj. = 0.4492). Possible optimal parameters setting may occur at the low level % mutation; we conducted the experiment and reported in Table 14. The reports showed that the objective function is worse when % mutation decreased. The reports also shown that the higher % mutation, the better objective functions.Table 13
Guideline setting for genetic program from response optimizer function.
Factor
Level
(1) Population number (A)
10
(2) Percent crossover rate (B)
95
(3) Percent mutation rate (C)
95Table 14
Experimental results obtained at low level % mutation.
Max. iteration
Population
% crossover
% mutation
Obj.
Time (s)
1500
10
95
95
0.44442
8,049
1500
10
95
1
0.48580
10,161
1500
10
95
0.1
0.50286
10,523
1500
10
95
0.01
0.53612
10,117


## 5.4. Result Confirmation Experiment

We experimented to check for accuracy by configuring the genetic program, as shown in Table12, together with fixing the maximum iterations to the number of nurses at 400 cycles and 18 nurses, respectively, as shown in Table 15.Table 15
Target equation (obj.) predicted by Minitab program and compared with actual target equation (obj.).
Target equation (obj.)
Comparison of target equation (obj.)percentage
Predicted value
Actual value
Actual value compared with predicted value
0.4492
0.4429
0.63%Table15 shows that the actual target value (obj.) is actually better than (i.e., less than) 0.63% of the predicted value and can be used practically and actually decreased the target equation (obj.).


## 6. Change in Number of Nurses(
i
) in Optimal Scheduling under Constraint Equation

We changed the number of nurses(
i
) which was an index in the constraint equation in order to find out the least number of nurses (
i
) who were able to schedule the work under the restrictions by using genetic programming and by gradually reducing the number of nurses (
i
) down to the final value at which the program could calculate the answer. The calculation was performed at w
=
0.6 in Table 16.Table 16
Calculation results with reduction in number of nurses (i) at w = 0.6.
Number of nurses (i)
Target equation(obj.)
Calculating time(hour)
21
0.5241
7.67
20
0.3959
6.03
19
Infeasible
Infeasible
18
Infeasible
InfeasibleTable16 shows that the least number of nurses (
i
) which could schedule work under the restrictions was 20. Based on 20 nurses, amount of overtime payment and standard deviation of overtime payment were calculated and reported in Table 17. Therefore, number of working hours for each nurse, number of nurses in each department, and nurse’s schedule plan were generated and reported as shown in Tables 18 and 19.Table 17
Calculating results by 20 nurses (i).
Target equation (obj.)
Calculating time (hour)
Sum of overtime paymentof nurses (Baht)
Standard deviation of total overtimepayment that each nurse received
0.3959
6.03
16,600
214.843Table 18
Number of working hours calculated from 20 nurses (i).
Number of nurses
Hours/person (hour)
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
Total
1
12
12
0
4
0
8
12
48
2
4
8
12
4
8
12
0
48
3
8
8
8
0
12
12
0
48
4
12
0
12
12
12
4
0
52
5
8
12
8
4
0
0
12
44
⋮
⋮
⋮
⋮
⋮
⋮
⋮
⋮
⋮
20
8
12
4
0
12
8
4
48Table 19
Number of nurses working in shifts calculated by 20 nurses (i).
Department
Period
Supply (person)
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
SUR
Regular
2
2
2
2
2
2
2
MED
3
3
3
4
3
2
2
PED
3
3
4
3
3
4
3
EENT
2
3
2
2
2
2
2
OBG
2
2
2
2
2
2
2
SUR
Overtime
2
2
2
2
2
1
2
MED
3
2
2
2
2
2
2
PED
2
2
2
2
3
3
3
EENT
3
2
2
2
2
2
2
OBG
2
2
3
2
1
1
2From Table17, it can be observed that the target equation (obj.) of the responses obtained was equal to 0.3959. The sum of the overtime payment of all nurses was 16,600 Baht per week. The standard deviation of overtime payment that each nurse received was 214.843. For fair comparison, we have to convert the real overtime payment and standard deviation for current 18 nurses to 20 nurses. Then, we can report that the sum of the total overtime payment and the standard deviation of the overtime payment that each nurse received which is obtained from the model were less than those of the old working schedule, at 17,991 Baht per week and 882.369, respectively.Table18 shows that all the nurses worked according to the conditions specified; that is, one nurse must work at least 40 hours per week, as in (4), but must work fewer than 60 hours per week, as in (5), all would be selected to work, as in (6), and the duration of work must not exceed six days a week, as in (7).From Table19, we can see that the number of nurses working in shifts each day was more than the demand for nurses (
Demand
j
k
l
), as shown in Table 6, which is according to (3), and the specified service criteria (on average, 15% of the patients waiting for services should not wait longer than the average service time of 25%) because the number of nurses working in shifts was more than the demand.To study the effect of weight adjustedw, more numerical experiments were conducted by GA coded in Matlab at 400 iterations and reported in Table 20. The report was shown as we expected; more weight adjusted less overtime payment simultaneously with higher standard deviation. It means that if management focuses on reducing the overtime payment, it will lead to unfair payment or bias nurses’ schedule plan.Table 20
Effect of weight adjusted to objective function.
Weight adjusted
w = 0.9
w = 0.6
w = 0.5
Objective function
0.5090
0.4753
0.4823
Sum of overtime payment
24375
24625
26575
Standard deviation
324.898
297.675
288.509


## 7. Comparison of Advantages and Disadvantages of Adaptive Genetic and Optimization Approach

We processed the data to do a comparison between the results of the adaptive genetic approach and the results obtained by the Lingo program using the same data in order to compare the target equation (obj.) and computation runtime, as shown in Tables21 and 22.Table 21
Results of genetic program calculated ten times at 400 rounds and 1500 rounds.
Target equation (obj.)number
Number of 20 nurses
Number of 24 nurses
Calculating cycle400
Calculating cycle1500
Calculating cycle400
Calculating cycle1500
1
0.4701
0.4578
0.5049
0.4730
2
0.4361
0.4436
0.5406
0.4552
3
0.4566
0.4772
0.4789
0.4493
4
0.4812
0.4303
0.4590
0.5160
5
0.4496
0.4781
0.4942
0.4586
6
0.4920
0.4549
0.5383
0.4833
7
0.4779
0.3959
0.5228
0.4626
8
0.5428
0.4352
0.5133
0.4580
9
0.5472
0.4368
0.5497
0.4985
10
0.5231
0.4496
0.4551
0.4542
Mean
0.4876
0.4459
0.5056
0.4708
Standard deviation
0.038
0.024
0.033
0.021Table 22
Comparison table for target equation (obj.) and duration in calculation of GA and Lingo program.
Number of nurses (person)
Number of calculating cycles
GA
Lingo
%
Target equation (obj.)
Time (hour)
Target equation (obj.)
Time (hour)
Different result of obj.
Different in computationalrun time
20
1500
Lowest
0.3959
6.03
5.80%
868.49%
Mean
0.4459 ± 0.024
6.85
0.3379
52.37
10.80 ± 2.4%
764.53%
400
Lowest
0.4361
1.71
9.82%
3,062.57%
Mean
0.4876 ± 0.038
1.66
14.97 ± 3.8%
3,154.82%Table21 shows the results of the processing experiment after it was conducted ten times. The work schedules using 20 and 24 nurses with the calculating cycle of 400 rounds resulted in the best value for the target equations of 0.4361 and 0.4551, respectively. After ten processing experiments, the work schedules for 20 and 24 nurses with the calculating cycle at 1,500 rounds resulted in the best value for the target equations of 0.3959 and 0.4493, respectively, and can be summarized as presented in Table 22.Table22 shows that the work schedule for 20 nurses at 1500 rounds, when compared to the Lingo program, could calculate the work schedule with the target equation (obj.) less than the genetic algorithm by around 5.80% and 10.8
±
2.4%, on average, but that the one created by the Lingo program used longer computational runtime, by over 868.49% and 764.52%, on average. We can also notice that the results at 400 rounds reported the same direction; the best and the average solution of genetic algorithm differ about 9.82% and 14.97
±
3.8% from the optimal, respectively. However, the optimal method used longer time, by over 3062.57% and 3154.81%, on average, showing that the genetic program is more suitable for practical use.


## 8. Conclusion

The findings showed that the genetic program created could manage the work schedule of nurses under given conditions and achieve the desired objective. It could create work schedules of nurses that were fair in overtime payment to all the nurses and could reduce the hospital expenses by setting the new coming nurses’ minimum salary at 15,000 Baht per person.From Tables23, 24, and 25, the following results can be concluded: the work schedules from proposed method reduce the waiting time of the number of patients waiting longer than 1.25 times of the average length nursing service from 34.08% to less than 15%, on average (starting from when the patients register and wait to see the doctor). If we want to schedule the work of the nurses in January 2012 in order to meet the criteria for the service of this study, we have to increase the number of nurses from 18 to 20 so that the number can perfectly meet the needs of the patients according to the criteria. The work schedules of the nurses can be most appropriate if the target equation is 0.3959 which uses the time of calculation as 6.03 hours with a standard deviation of less than 80.28% and the overtime payment less than 29,564 Baht per month. When this is compared with the actual work schedule in January 2013, the work schedule could reduce the number of nurses from 23 to 20 with a decreased standard deviation, that is, 89.08%, and the decrease in the total overtime payment would be 50,148 Baht per month. We could calculate the most appropriate work schedule quicker than by using the conventional approach which results obtained by Lingo program, version 5.0, 868.49% with 1500 rounds for the calculation cycle.Table 23
Comparison of differences in number of nurses, monthly expenses, and SD of work schedule created and actual work schedule in January 2012.
Number of nurses
Monthly expense
SD
Old
New
Increase
Old
New
Decrease
Old
New
Decrease
18
20
2
395,964
366,400
29,564
1,089.212
214.843
80.28%Table 24
Comparison of differences in number of nurses, monthly expenses, and SD of work schedule created and actual work schedule in January 2013.
Number of nurses
Monthly expense
SD
Old
New
Decrease
Old
New
Decrease
Old
New
Decrease
23
20
3
416,548
366,400
50,148
1,966.735
214.843
89.08%Table 25
Target equation and calculation time from genetic program.
Target equation (obj.)
Calculation time (hour)
0.3959
6.03As we know, hospitals belong to the service business sector; continuous improvement along with response to customer satisfaction is the key success factor in this business. To reduce the waiting time in every hospital process, high standards in medical care and highly experienced medical doctors are needed. Presently, Thailand has set its aim to become an Asian medical and tourist hub; this strategy of the country may cause and force hospitals to improve their service quality for responding well to the high number of outpatients. Updated data collection needs to be done; service-level policies have to be reconsidered. Demands of outpatient nurses and their schedules may change from time to time. Inpatient nurses may be allocated to assist when the management wishes to reduce the fluctuation in the number of outpatient nurses. Thus, modern management and high efficient tools are necessary; this is the reason why GA is involved instead of an adoption of the conventional approach. However, regarding the implementation of simulation, even GA is not familiar to the hospital people. Optimization capacity building is another issue that the hospital management will have to consider.



---

*Source: 246543-2014-11-27.xml*