An evolutionary algorithm based on constraint set ... · for nurse rostering problems ... Keywords...
Transcript of An evolutionary algorithm based on constraint set ... · for nurse rostering problems ... Keywords...
ORIGINAL ARTICLE
An evolutionary algorithm based on constraint set partitioningfor nurse rostering problems
Han Huang • Weijia Lin • Zhiyong Lin •
Zhifeng Hao • Andrew Lim
Received: 24 September 2013 / Accepted: 14 December 2013 / Published online: 3 January 2014
� Springer-Verlag London 2014
Abstract The nurse rostering problem (NRP) is a repre-
sentative of NP-hard combinatorial optimization problems.
The hardness of NRP is mainly due to its multiple complex
constraints. Several approaches, which are based on an
evolutionary algorithm (EA) framework and integrated
with a penalty-function technique, were proposed in the
literature to handle the constraints found in NRP. However,
these approaches are not very efficient in dealing with
large-scale NPR instances and thus need to be improved
upon. In this paper, we investigate a large-scale NRP in a
real-world setting, i.e., Chinese NRP (CNRP), which
requires us to arrange many nurses (up to 30) across a
1-month scheduling period. The CNRP poses various
constraints that lead to a large solution space with multiple
isolated areas of infeasible solutions. We propose a single-
individual EA for the CNRP. The novelty of the proposed
approach is threefold: (1) using a constraint separation to
partition the constraints into hard and soft constraints;
(2) using a revised integer programming to generate a high-
quality initial individual (solution), which then leads the
subsequent EA search to a promising feasible solution
space; and (3) using an efficient mutation operator to
quickly search for a better solution in the restricted feasible
solution space. The experimental results based on extensive
simulations indicate that our proposed approach signifi-
cantly outperforms several existing representative algo-
rithms, in terms of solution quality within the same
calculation times of the objective function.
Keywords Evolutionary algorithm � Nurse rostering
problem � Constraint set partitioning � Integer
programming
1 Introduction
Nurse rostering problem (NRP) is a class of resource-
allocation problems [1–5] that pose various constraints.
Due to the health care system’s improvement and patients’
various requirements, hospitals have the responsibility of
caring for many patients with limited medical resources.
One of the challenging problems is to assign working shifts
to the nurses more effectively. The final shift assignment
will directly determine how fully the medical human
resources are utilized for patient care. A reasonable and
robust shift assignment solution helps to deal with patients’
requirements, reduces nurses’ workload and improves
medical service. Hence, the goals of nurse rostering prob-
lems are to find a best solution for shift assignments that
satisfies multiple constraints such as minimal nurse
demands, maximum work allowances and individual day-
off requirements.
Assigning nurses is a tough job due to patients’ various
requirements and nurses’ requests for certain shifts. These
requirements are classified into hard constraints and soft
H. Huang (&) � W. Lin
School of Software Engineering, South China University of
Technology, Guangzhou 510006, People’s Republic of China
e-mail: [email protected]; [email protected]
H. Huang � A. Lim
Department of Management Sciences, College of Business,
City University of Hong Kong, Kowloon, Hong Kong
Z. Lin
Department of Computer Science, Guangdong Polytechnic
Normal University, Guangzhou, People’s Republic of China
Z. Hao
Faculty of Computer Science, Guangdong University of
Technology, Guangzhou 510006, People’s Republic of China
123
Neural Comput & Applic (2014) 25:703–715
DOI 10.1007/s00521-013-1536-2
constraints. Hard constraints are those that should be fully
satisfied (e.g., daily coverage requirement), and thus, any
hard constraint violation would result in an invalid solu-
tion. Soft constraints are those conditions that are desirable
but not necessary (e.g., nurse’s complete weekends
request), which are mainly used to evaluate the quality of
the schedule solution. These constraints make nurse
rostering problem a challenging task for the hospital
administrators to handle.
Researchers have been working on many instances and
have developed a variety of methods to handle typical
nurse rostering problems [1, 2]. Most techniques of NRP
solutions can be classified into two categories: exact
algorithms [6–8] and heuristics [9–12]. Exact algorithms
aim to find an optimal solution for a problem by exhaustive
search, in which every possible shift assignment instance is
searched for and evaluated in the solution space. NRP was
also tackled by several heuristics methods such as simu-
lated annealing [13], tabu search [14], variable neighbor-
hood searches [15] and estimation of distribution
algorithms [16]. Heuristics have performed effectively to
solve some NRP instances [9–12], by producing high-
quality feasible solutions that are not always optimal.
However, exact algorithms and heuristic methods are
not available to handle all NRPs, like the large-scale one
tackled in this paper. More and more modern real-world
NRPs have motivated the researchers to find efficient
algorithms for their solution. As the scale of problems
grows larger, the situations become more complex. For
example, hospitals in China would employ many more
nurses (up to 28 or even more) than others [17–19] due to
the large population and involve more rules (up to 16) [20].
These rules aim to control the workload of nurses and
improve their service quality for the needs of the hospital in
China. Traditional approaches [6–8] fail to deal with these
real problems in large hospitals.
The NRP [20, 21] with higher dimensions (more nurses,
more constraints) is denoted as CNRP which is short for
Chinese Nurse Rostering Problem. CNRP contains many
nurses across a longer duration and various constraint sets,
which requires trade-off results between quality and com-
putational time. Exact algorithms and recent heuristics
approaches [9–12] are usually not able to tackle such large-
scale problems since the solution space of CNRP contains a
large area of infeasible solutions. These considerations
provoke us to find an efficient approach by integrating
different algorithms to solve the CNRP like combining
their advantages together. The major contribution of our
study is to raise a hybrid algorithm including integer pro-
gramming (denoted as IP) and evolutionary algorithm
(denoted as EA), on a basis of the set partition for soft
constraints. Constraints set partition is helpful to reduce the
difficulties of solving CNRP. Based on the partition, IP was
used to generate an initial solution with several rigid con-
straints. Then, a single-individual EA was carried out to
optimize the initial solution and obtain the final results
through evolutionary operator per iteration.
In this paper, we aim to: (1) analyze the characteristics
of constraints in CNRP and divide the constraints into two
sets; (2) propose an IP ? EA algorithm to produce solu-
tions satisfying the constraints respectively; (3) build a
basic and simplified NRP problem model at the IP stage,
conquer the first constraint set and obtain an initial solution
of high quality (low penalty-function value); (4) design an
EA stage that does not violate the first constraint set and
satisfies the second constraint set, to improve the initialized
solution in finite evolutionary iterations; EA will eventu-
ally result the final solution that obeys all the constraints;
and (5) compare the proposed IP ? EA algorithm with
other approaches for NRPs to find out their advantages and
disadvantages in different CNRP instances.
The remainder of this paper is structured as follows.
Section 2 describes a brief literature review. Section 3
introduces the basic mathematical model of CNRP.
Section 4 presents constraint analysis, constrain set parti-
tion and the procedure of IP ? EA algorithm for CNRP.
Section 5 shows the experimental results and analysis by
comparing the proposed algorithm with other approaches
[17, 22]. Finally, Sect. 6 presents the conclusion of this
paper.
2 Literature review
This section will present a brief overview of the existing
research on solving nurse rostering problems.
Studies [23–25] of nurse rostering problems date back to
the early 1960s. Most of the researchers [6–8, 26–28]
adopted convention optimization approaches to generate
solutions with minimum cost. They are always able to
obtain the optimal solution if there is no time limit.
However, the methods were only effective with small-scale
NRPs with simple constraints since they strongly replied on
the particularity of the problems.
Because exact algorithms were impractical for real-
world NRPs, many heuristic methods [5, 9–12, 29] were
proposed to improve the feasibility. Different from exact
algorithms, the heuristics cannot always guarantee the
optimal solution for each run, but they always result in a
solution approximate to the optimal in the limited runtime.
Thus, they generate a feasible solution in quality and
efficiency, which is practical for real NRPs. After early
attempts, other metaheuristic algorithms were used for
solving NRPs, such as simulated annealing [13], tabu
search method [14], variable neighborhood search [15] and
estimation of distribution method [16]. More heuristic
704 Neural Comput & Applic (2014) 25:703–715
123
methods are necessary to the high-quality solutions of real
NRPs that involve many constraints from hospital, patients
and nurses, due to their difficulty in handling highly con-
strained problems.
Given the advantages and disadvantages of exact algo-
rithms and heuristics, some researchers applied hybrid
methods to solve NRP, by combining the assets of different
methods. Substantial results have been presented in recent
years. Burke et al. [17] proposed a two-stage hybrid
method of IP and variable neighborhood search (VNS).
This approach gained better solutions when compared with
a genetic algorithm (GA) method from ORTEC’s Harmony
[30] and a hybrid VNS approach based on heuristic ranking
method [31]. Moreover, the results showed that it outper-
formed pure IP method or pure VNS method. Tsai and Li
[18] developed a two-stage mathematical modeling and
applied GA in the two-stage processing. Their results
showed that GA is an efficient tool for the NRP and this
model could be easily modified to suit different cases. Bai
et al. [22] formed a hybrid EA combining stochastic
ranking and simulated annealing method for a classical
NRP problem [32], in which there was one hard constraint
and three soft constraints. They compared the hybrid EA
approach with other four approaches (TSHH [33], IGA
[34], EDA [35] and SAHH [36]) and found that the hybrid
EA approach obtained better performance for the NRP
instances.
As the scale of a nurse rostering problem increases
(more nurses and longer scheduling period) and the con-
straints become more complex, research on large-size nurse
rostering problems is greatly needed. As a result, several
studies on large-size NRPs such as CNRP [21] have been
presented. Yet, we wish to find an approach to improve
upon this research. Our research would handle a complex
nurse rostering problem [21] proposed from hospitals in
China. This paper will present an EA for solving CNRP, a
large-scale NRP with many complex constraints. The
CNRP possesses two main features: comparatively large
number of nurses and an additional constraint of balancing
the nurses’ workload. Therefore, the proposed results will
help further the research on solutions for large complex
rostering problems.
3 The nurse rostering problem
CNRP, a large-size nurse rostering problem with complex
constraints, will be introduced in this section. In the nurse
shifting system of hospitals [20, 21], the day shifts can be
classified into three types, as follows:
A-shift: 8:00–15:00
P shift: 15:00–22:00
N-shift: 22:00–8:00
A nurse works at most one shift per day. The goal of the
problem is to come up with a shifts-assignment solution.
CNRP contains several hard and soft constraints. The hard
constraints should be satisfied, including:
HC1 The number of nurses should satisfy daily coverage
requirements for each shift type.
HC2 The number of total working days for each nurse
should range between the maximum boundary and the
minimum boundary.
HC3 An N-shift followed by an A-shift is not allowed.
The soft constraints are those to be satisfied as much as
possible, which also serve as the criteria for evaluating the
quality of the solution. The soft constraints are described as
follows:
SC1 (Fair workload) The difference between the number
of different working shifts for each nurse and the
corresponding average value should be no more than 1.
SC2 The number of consecutive working days of each
nurse should range between three and seven.
SC3 There should be at most five consecutive working
night shifts for each nurse.
SC4 (Complete weekends) There should be either no
shift or two shifts on a weekend.
SC5 There should be at most four working days on
weekends in the scheduling period.
SC6 There should be at least 2 days of rest after a series
of working days.
According to the requirement [21], the first four soft
constraints have the same priority and the last two soft
constraints have lower priority. All of the soft constraints’
priorities correspond to the soft constraints’ weights in
quality evaluation. According to the complete statement of
the problem above, we present a mathematical model of
CNRP, which is similar to the one raised by Burke [17].
The NRP contains a task of shift assignment of M days’
scheduling period which involves N nurses. Let I be the set
of nurses, J be the set of days in the period and K be the set
of nurses’ shift types. The decision variable xijk denotes
whether nurse i works on the shift k in day j, in which:
k ¼1;works on A shift
2;works on P shift
3;works on N shift
8<
:
Hence,
xijk ¼1; nurse i works on the shift k in day j
0; otherwise
�
;
where i 2 I and j 2 J.
Neural Comput & Applic (2014) 25:703–715 705
123
For the hard constraints shown by Exp. (2)–(4), let rjk be
the minimum coverage requirement of shift k in day j,
workmin be the minimum working days of a nurse and
workmax be the maximum working days of a nurse. For the
soft constraints shown in Exp. (6)–(15), let p1–p6 be the
corresponding penalty weights and s1–s6 be the number of
different violations of the current solution. Therefore, the
complete mathematical model of CNRP is described as
follows:
min f ¼X6
t¼1
ptst ð1Þ
s:t:X
k2K
xijk � 1 8i 2 I; j 2 J ð2Þ
HC1:X
i2I
xijk � rjk 8j 2 J; k 2 K ð3Þ
HC2: workmin�X
j2J;k2K
xijk �workmax 8i 2 I ð4Þ
HC3: xij3 þ xiðjþ1Þ1� 1 j 2 f1; 2; . . .;M � 1g ð5Þ
Inequality constraint (2) ensures the basic feature of
CNRP, that is, a nurse works at most one shift in a day.
Inequality constraints (3), (4) and (5) are corresponding to
HC1, HC2 and HC3, respectively.
The details of s1–s6 are shown as follows, in which
workave is defined as the average working shifts of the
nurses. s1–s6 are corresponding to all the soft constraints
from SC1–SC6.
workave ¼1
N
X
i2I
X
j2J
X
k2K
xijk ð6Þ
SC1: s1 ¼X
i2I
maxX
j2J
X
k2K
xijk � workave
�����
�����; 1
!
� 1
" #
ð7Þ
s21 ¼X
i2I
maxXrþ7
j¼r
X
k2K
xijk � 7; 0
!
r 2 1; 2; . . .;M � 5f gð8Þ
s22 ¼X
i2I
X
j2J0max
X
k2K
xijk �X
k2K
xiðj�1Þk �X
k2K
xiðjþ1Þk; 0
!
J0 ¼ 2; 3; . . .;M � 1f gð9Þ
s23 ¼X
i2I
X
j2J00max
max
X
k2K
xijk þX
k2K
xiðj�1Þk �X
k2K
xiðjþ1Þk
�X
k2K
xiðjþ2Þk; 0
!
� 1; 0
!
J00 ¼ 2; 3; . . .;M � 2f g
ð10Þ
SC2: s2 ¼ s21 þ s22 þ s23 ð11Þ
SC3: s3 ¼P
i2I
maxPrþ5
j¼r
xij3 � 5; 0
!
r 2 1; 2; . . .;M � 5f gð12Þ
SC4: s4 ¼P
i2I
P
j2S
minP
k2K
xiðj�1Þk � xijk
��
��; 1
� �
S ¼ 7; 14; 21; 28f gð13Þ
SC5: s5 ¼P
i2I
maxP
j2S
P
k2K
ðxiðj�1Þk þ xijkÞ � 4; 0
!
S ¼ 7; 14; 21; 28f gð14Þ
SC6: s6 ¼P
i2I
P
j2J 0max
P
k2K
xiðj�1Þk�P
k2K
xijkþP
k2K
xiðjþ1Þk
����
�����1;0
� �
J0 ¼ 2;3; . . .;M�1f gð15Þ
4 Hybrid approach based on constraint set partitioning
The main innovation of our IP ? EA method is to reduce
the complexity of solving CNRP and to satisfy the con-
straints step-by-step. Within the proposed algorithm, the
constraints are fully analyzed and handled. They are also
divided into two different constraint sets (Set A and Set B)
according to their features by meeting these constraints
separately. By taking the advantage of the precision of IP
for Set A, we narrow the solution space into the one of high
quality. In the next stage, with the improvement of EA
process, the new solutions are in the direction of satisfying
Set B with little violation of Set A. Finally, we obtain a
solution that satisfies as many soft constraints as possible.
4.1 Constraint set partitioning
The problem includes three hard constraints and six soft
constraints. It is useful for the solution to find that some of
the constraints are highly relative or have similar forms by
analyzing their properties, such as:
1. SC1 is related to the total workload of a nurse, and it is
easy to satisfy by controlling the total workload.
Workload control is a global issue of the rostering
problem, and it has a great impact on the probability of
obtaining feasible solutions. A heavy workload will
make it harder to achieve an acceptable solution,
because it splits the solution space into many regions,
most of which are infeasible. A small workload is good
for finding the best solution, but this kind of situation
seldom happens in real life and possesses no practical
value.
706 Neural Comput & Applic (2014) 25:703–715
123
2. SC4 and SC5 are related to the shift assignment on
weekends. We can do a special arrangement for these
work assignments.
3. SC2, SC3 and SC6 have similar forms, which are
concerned with the number of consecutive day-on or
day-off. Therefore, we can describe them using a
similar model.
According to the analysis above, the hard constraints
HC1–HC3 and the soft constraints SC2, SC4, SC5 and SC6
need to be considered first. The hard constraints should be
satisfied through designing an algorithm strategy. The
calculation of SC2, SC4, SC5 and SC6 is easier than other
soft constraints, so they are considered first in order to
reduce the computational complexity of the solution. The
constraints will be met in steps for special purposes in the
proposed algorithm, which helps to obtain better solutions
by lowering the complexity of the rostering problem.
In most studies [6–12, 26–28], mathematical models
were built for the tackled nurse rostering problem, and the
final results were obtained by using evaluation function and
various searching strategies. NRP problems involve many
complex constraints, and the evaluation function is related
to all of the constraints, which will cost the solution
approaches much computational time. Therefore, in the
proposed algorithm, the constraint set is divided into sub-
sets effectively. The most infeasible and poor solutions are
abandoned and improved step-by-step. As a result, it takes
a shorter time to evaluate the value of the remaining
solutions that seldom violate the constraint rules. There-
fore, we raise the idea of combining IP and EA to improve
the solution of NRP.
The main process of our proposed algorithm is briefly
introduced in Fig. 1. First, the soft constraint set is divided
into two subsets: Set A and Set B. Thus, IP ? EA hybrid
approach takes advantage of the characteristics of IP and
EA, respectively, and satisfies these two constraint sets
step-by-step. Second, the hybrid approach solves the sim-
plified problem (Set B is not included) by using IP algo-
rithm and produces an initial solution. Obviously, the
initial solution satisfies the hard constraints, as well as the
constraints in Set A. Later, temporary solutions will be
improved by an EA (shown by Fig. 1), aiming to satisfy the
constraints in Set B and obtain the final optimized result.
According to the analysis of the properties of all the soft
constraints above, the division strategy of soft constraints
set is indicated as follows:
Set A contains SC2, SC4, SC5 and SC6. These con-
straints have strong restraining force, which leads to gen-
erating many areas of infeasible solutions in the solution
space. If non-precision algorithms are used to deal with
them, the running process will converge to a local optimal
solution in a short time, which deviates from the original
goal of optimization. Therefore, these soft constraints are
also considered to design the IP stage, aiming to discard a
large number of infeasible solutions and generate an initial
solution for the evolutionary stage. The initialization is
required to satisfy the strongly-restrained constraints of Set
A and ensure the good quality of the consecutive
population.
Set B contains SC1 and SC3. Satisfying SC1 will
involve a large amount of computation; therefore, it should
be met late in Set B. Also, since SC2 involves the
arrangement of consecutive working days, the process of
satisfying SC2 also helps to satisfy SC3 (consecutive
working nights). Hence, SC3 is supposed to be included in
Set B, which reduces the computation of the IP stage. Thus,
because they possess weaker restraining force than the
constraints in Set A, another feasible solution can be
generated from the original one easily by using a chain-
move operation. This feature is helpful to generate new
populations in the EA. The proposed algorithm will use
evolutionary operators in selection and mutation operations
to ensure that all the individuals do not violate the hard
constraints and rarely violate the constraints in Set A.
Figure 1 shows the analysis of the constraint sets.
4.2 Procedure of IP ? EA algorithm
With the partition of soft constraint set, the first stage of the
IP ? EA algorithm handles a nurse rostering problem
which mainly deals with the hard constraints and the
Fig. 1 The partition of constraints and the corresponding algorithm
stages
Neural Comput & Applic (2014) 25:703–715 707
123
constraints in Set A. The goal is not to obtain the final
solution directly, but to obtain an excellent initial solution
by taking advantage of precision of IP approach to handle
those strict constraints of Set A. The second stage of
IP ? EA algorithm deals with the complete problem.
Figure 2 presents the flow chart of IP ? EA algorithm.
In the IP stage, a simplified CNRP problem is solved by
applying IP to generate initial solution for the EA stage. All
the constraints in Set B will be excluded (i.e., only the hard
constraints and the constraints in Set A are included) to
generate a simplified problem. As a result, the simplified
problem is made from the original NRP presented in Sec-
tion III, by removing the constraints shown in Expressions
(7) and (15) and replacing the hard constraint shown in
Expression (4) with the following expression:
workmin�X
j2J;k2K
xijkworkmin þ 1 8i 2 I ð16Þ
The new hard constraint does not violate the original
hard constraint (HC2), and it also satisfies SC1 by
controlling the total workload of nurses. It is trivial to
prove that all the solutions of the simplified problem are
also the solutions of the original NRP. The simplified
problem has a downsized solution space since a strict hard
constraint (Expression 16) replaces a relatively relaxed
hard constraint (Expression 4). So we adopt IP approach to
produce a solution in limited iteration steps. The best one
generated from IP stage is selected as the initial solution of
the next steps, which highly satisfies the constraints in Set
A.
In the EA stage, the original problem is tackled by
evolutionary operators shown in Figs. 3 and 4. On the basis
of the initial solution produced by the IP stage, the EA
stage is to satisfy HC1–HC3 strictly, minimize the sum of
penalty-function value by Exp. (1) and gain the final
solution of NRP. The population size of EA is one, i.e.,
only an offspring will be generated from an individual
parent. The offspring will replace its parent (best-so-far
solution) unless it is superior to the best-so-far individual.
The evaluation function of the individual is calculated by
the weighted sum of the penalty value. Thus, a lower
penalty value is better for the individual.
The pseudocode of EA stage is presented in Fig. 3.
4.3 Mutation operator
The results are given in Table 4, which once again show
the average of the best solutions ± standard deviation (SD)
for each algorithm; the problems are approximately
ordered from simple to complex. Although ELPSO could
not obtain the optimal solution for the Sphere and Rosen-
brock problems, its overall performance among all the
examined algorithms is the best. In particular, ELPSO is
clearly superior when solving multimodal function
problems.
Step 3 is the core operator of EA stage. Item delta is a
parameter for the subalgorithm Mutation(nurse_x, delta),
which generates an offspring offs_x from nurse_x.
Obj(offs_x) is an evaluation function calculated by Exp.
(1). As a result, evaluation function is implemented only
once per iteration. There is only one individual in the
population, and so current individual nurse_x will be
replaced with the offspring offs_x if the evaluation value
offs_s is less than nurse_s. Figure 4 describes the
pseudocode of the evolutionary operation Muta-
tion(nurse_x, delta).
In the mutation process, variable pmuta is a threshold
value. The value of pmuta determines the probability of the
mutation for weekend and workday shifts. If the value of
random probability is smaller than threshold pmuta, evo-
lutionary operation will be implemented. As the iteration
number increases, the value of pmuta decreases according
to Step 3 of Fig. 3 and Step 1 of Fig. 4. For example, at the
beginning of the EA stage, the mutation runs by high
probability since the value of pmuta is high. However,
when closing in on the end of the evolutionary process, the
solution gradually converges because the value of pmuta is
reduced to a lower mutation probability.
Figure 5 explains the reason why we set a descending
value of pmuta. By comparing different values of pmu-
ta(descending value, ascending value and fixed value) inFig. 2 IP ? EA algorithm flow chart
708 Neural Comput & Applic (2014) 25:703–715
123
the evolutionary process (11 sample points of the average
penalty value in five experiments of 20,000 generations are
captured), the descent policy helps to generate the final
shift solution with less penalty value. By contrast, the other
two policies stop optimizing the results before the termi-
nation condition is reached. According to the result of
Fig. 5, since the mutation operation involves no policy that
guarantees better solutions, high mutation rate may easily
cause much disturbance on the best-so-far solution, so it is
difficult to ensure that a better solution can be generated.
The details of mutation are given by Figs. 6 and 7.
1. Figure 6 shows an example of the mutation for the
weekends, in which we swap the shifts of two working
nurses chosen randomly. In Fig. 5, the swapped objects
are weekend shifts (Sat and Sun) of Nurse 1 and Nurse
2. The swapped shifts still satisfy SC4 and SC5.
2. Figure 7 shows an example of shift swapping on
workdays. For the working days, two nurses (rows) in
the shifts are randomly chosen, and then their shifts on
two days are swapped. For example, the swapped
objects are workdays of Nurse 1 and Nurse 3 in Fig. 6.
The total workload of each nurse remains unchanged.
The EA stage will take effect to a certain degree,
making up for the loss of several excellent solutions. The
operation in EA stage will cause only minor violations in
Set A. For the weekends, in order to strictly satisfy SC4
and SC5, both the shifts for the two days in weekend are
swapped. For the working days, the total workload of the
two nurses involved in shift swapping remains unchanged
on working days. Though the workload of different shift
types for each nurse may change, we tolerate this distur-
bance by penalty function [Exp. (1)] in the EA stage.
Fig. 3 Pseudocode of EA stage
Fig. 4 Pseudocode of
Mutation(nurse_x, delta)
function
Neural Comput & Applic (2014) 25:703–715 709
123
In fact, the IP strategy in our approach may cause the
loss of several excellent solutions. These solutions do not
satisfy the constraints in Set A, but with the satisfaction
of Set B, they possess overall lower penalty values.
Therefore, the solution obtained by EA stage is not
strictly restrained by Set A, but the mutation operator will
expand the searching area of EA slightly, in order to
involve the solutions that have been abandoned in the IP
stage.
The implementation and investigation of the proposed
algorithm will be presented in the Sect. 5.
5 Experiment and results
This section will present the experimental setting and
results. The experiments aim to adopt the proposed algo-
rithm to solve the CNRP and compare the results with
those produced by other recent approaches [17, 22].
5.1 Experimental settings
There were 20 CNRP instances generated in the experi-
ment. The two main differences between these instances
are in daily coverage requirement of each shift type and
minimum number of working days for each nurse. For the
soft constraints, we assigned them different penalty
weights referring the studies [17, 21, 22]. The value of
p1–p4 is 10, and the value of p5–p6 is 1.
CNRP is a large-scale nurse roster problem that contains
a huge solution space including many infeasible areas. The
size of CNRP instances was larger than those tested in
other references [17–19, 21, 22]. The CNRP instances
studied in the experiments involve 30 nurses across a
30-day time horizon and include three hard constraints and
six soft constraints. Compared with the problems in the
literature (Index of Table 1 including the numbers of nur-
ses and days determine the size of the problem), the
problem of size presented here is relatively the largest one.
Fig. 6 Mutation for weekend
shift
Fig. 5 The comparison of
different values of parameter
pmuta
710 Neural Comput & Applic (2014) 25:703–715
123
The experiments will compare the performance of
relaxed IP method, IP ? VNS algorithm [17], simple EA
algorithm, hybrid evolutionary approach (HEA) [22],
modified harmony search algorithm and the proposed
IP ? EA algorithm. The implementation of the algorithms
in the experiment is described as follows.
The relaxed IP is the algorithm only containing an IP
stage of Fig. 2. Because there is no available result obtained
by the IP strategy [17] after 1,000,000 iterations, IP ? VNS
algorithm was implemented by modifying its IP to be a
relaxed IP. VNS was programmed strictly according to Ref.
[17]. Simple EA algorithm is the algorithm of EA stage in
Fig. 2. Hybrid evolutionary approach (HEA) [22] was
carried out by adding a relaxed IP for initialization since it is
difficult to obtain a feasible solution for CNRP instances
without any modification. In brief, the proposed IP ? EA
algorithm includes a relaxed IP (IP stage in Fig. 2) and a
simple EA (EA stage in Fig. 2). MHSA [37] is carried out in
20,000 iterations, which is the same with EA stage.
The purposes of different comparisons for the IP ? EA
algorithm and other methods are to:
1. compare IP ? VNS with IP ? EA and determine
whether the proposed EA is better than VNS strategy
[17] with the same initial solution;
2. compare the relaxed IP and IP ? EA and determine
the effectiveness of IP ? EA is better than single IP
for solving CNRP;
3. compare IP ? EA and simple EA to determine
whether IP stage for initialization is necessary.
4. compare IP ? EA and HEA [22] and indicate which
evolutionary approach is better in solving CNRP.
5. compare IP ? EA and MHSA [37] and indicate which
approach is better in solving CNRP.
Table 2 presents the termination condition of each
approach. The iteration number is considered as a major
index of computational time and experiment termination
since the evaluation function of Exp. (1) is calculated once
per iteration in most of the compared algorithms. To make
sure that the approaches involving the EA method can be
compared under the same condition, the maximum number
of iteration of all EA stages is assigned with the same
value. Also, to make sure the VNS operation and the IP
method could be fully executed, the maximum numbers of
iterations are assigned with very high values. Specially, for
the proposed approach, the simple EA and HEA are run 30
times on each experiment, and the best result is recorded in
Table 3. Furthermore, the means in average and SDs are
shown in Table 4.
Table 1 Size comparison of our problem and other problems in previous literature
Approach The number of Published in
Nurses Days Hard constraints Soft constraints
The proposed EA 30 30 3 6
IP ? VNS algorithm [17] 16 30 10 7 2010
Hybrid evolutionary approach [22] 30 7 2 1 2010
Utopic Pareto genetic heuristic [19] 5 7 5 3 2008
Two-stage modeling with genetic algorithm [18] 15 30 7 5 2009
Modified harmony search algorithm [37] 10 28 2 10 2011
Fig. 7 Mutation for workday
shift
Neural Comput & Applic (2014) 25:703–715 711
123
The experiments are all carried out on an Intel Core Duo
(2.40 GHz and 2.40 GHz) PC with 2G RAM under Win-
dow 7. The IP stage is implemented by software lingo 11.0
(http://www.lindo.com/). The EA stage is programmed and
running on MATLAB R2010b (http://www.mathworks.cn/).
The data of CNRP instances and the source code of the
proposed IP ? EA algorithm can be downloaded on the
web address http://www.rayfile.com/zh-cn/files/cb5aaf8f-
4c28-11e2-bf3b-0015c55db73d/.
5.2 Experimental results
The important index of experiment is the penalty-function
value [by Exp. (1)] of the final solution for each compared
approach. Lower penalty-function values imply better
solutions if the solution is feasible for all of the hard
constraints. Tables 3, 4 and 5 present the overall experi-
mental results of 20 CNRP instances.
Table 3 presents the comparison of the solution results.
From the overall view on the penalty value of all the
approach, the proposed hybrid approach (IP ? EA) gen-
erates solutions with the least penalty values in 17 instan-
ces. That is, our approach is regarded as an effective
method for the CNRP, and it outperforms other approaches
in terms of resulting low-penalty results.
Table 4 presents the percentage deviation of the average
penalty value from the lowest penalty value in each
instance. For the simple EA, the hybrid EA [22] and
MSHA [37], they can produce stable results (little differ-
ence among each run) since the average deviation is no
more than 1 %. Specially, the proposed IP ? EA algorithm
is the most stable of all since it produced the same final
solution in each run. Moreover, since the IP ? VNS
method and IP method are deterministic algorithms, all the
Table 3 Best penalty value of the proposed EA and other NRP approaches
Exp no. Object value
IP ? EA (best) Simple EA (best) IP ? VNS IP Hybrid EA (best) MHSA (best)
1 110 307 253 642 594 609
2 300 321 653 523 570 568
3 360 372 770 683 925 603
4 378 344 365 745 666 707
5 199 219 239 593 604 585
6 237 346 494 657 649 631
7 248 286 271 612 593 632
8 337 311 589 649 601 571
9 320 398 456 617 549 521
10 381 442 396 853 803 817
11 258 258 695 548 511 560
12 269 205 257 506 487 475
13 191 290 255 570 600 627
14 167 229 326 941 911 929
15 191 219 239 593 604 647
16 196 200 542 667 576 575
17 183 211 653 600 601 647
18 270 220 646 543 502 481
19 389 709 418 937 849 819
20 277 339 317 740 694 675
Avg. 263.05 311.3 441.7 660.95 644.45 640.2
The items colored in red are the best of all
Table 2 Termination condition (maximum iterations)
Method Maximum number of iteration
IP ? EA IP: 150,000 Simple EA: 20,000
IP ? VNS IP: 150,000 VNS: 500,000
Relaxed IP 300,000
Simple EA 20,000
IP ? HEA IP: 150,000 HEA: 20,000
MHSA 20,000
712 Neural Comput & Applic (2014) 25:703–715
123
approaches involved in the experiments are relatively
stable.
Table 5 presents the runtime cost of each approach. As
the maximum iteration number was fixed in Table 2,
Table 5 only indicates the runtime per iteration of each
algorithm on average instead of the solution speed. For
different problem instances, the runtime may vary from
300 to 900 s. Also, the average runtime cost varies from
540 s (9 min) to 630 s (about 11 min). For a CNRP, it is
trivial to compare the time cost of each approach as more
time cost does not ensure better results.
Based on the same initial solution from IP stage, the
results of IP ? EA are obviously better than the IP ? VNS
approach in 18 instances, except for the fourth and 12th
ones. Table 2 shows that the iteration number of
IP ? VNS is much more than that of IP ? EA. Therefore,
IP ? VNS has more computational time than IP ? EA if
calculating the evaluation function of Exp. (1) is consid-
ered as a basic operator of the compared algorithms. The
results of fourth instance and 12th instance only mean that
IP ? EA needs more iterations to obtain the better solution
than IP ? VNS.
IP ? EA performs better than simple EA in 15 instan-
ces, equally in the 11th instance and slightly worse in the
4th, 8th, 12th and 18th instances. It uses a promising initial
solution from IP stage. On the contrary, the initial solution
of simple EA approach is generated randomly. Therefore,
high-quality initial solution is useful in the final optimi-
zation, and IP stage is necessary. The three instances in
which the simple EA method performs slightly better may
have traps of local optimization. IP ? EA cannot jump out
of local optimal when the initial solution from IP stage falls
in the trap of local optimization. Random initialization can
produce various solutions per run, so it has higher proba-
bility to avoid falling in local optimization. Thus, the
simple EA is better than IP ? EA in solving the three
instances.
The results from the relaxed IP method have 2–5 times
function value as the hybrid approach: That is, the relaxed
IP method performs notably worse. Though the maximum
number of iteration of IP approach is very large, it is not
enough to obtain a low-penalty solution. For IP approach,
the slight improvement on solutions needs a large amount
of runtime, which is not a practical way to solve the CNRP
instance. The results in Fig. 7 also indicate that efficiency
does not mainly depend upon the function of IP stage. The
EA stage plays a role in the solution of CNRP.
Apparently, HEA achieves poor solutions with a much
higher penalty value. HEA is able to adopt valid
Table 4 Percentage deviation of the average penalty value
Exp
no.
Mean and SD of penalty value
IP ? EA Simple EA Hybrid EA MHSA
Mean Std. Mean Std. Mean Std. Mean Std.
1 110 0.0 309 4.47 600 5.48 566 0
2 300 0.0 323 4.47 572 4.47 596 0
3 360 0.0 372 0.00 929 5.48 657 0
4 378 0.0 344 0.00 666 0.00 674 4.47
5 199 0.0 223 5.48 606 4.47 653 0
6 237 0.0 348 4.47 653 5.48 691 0
7 248 0.0 286 0.00 593 0.00 601 0
8 337 0.0 313 4.47 607 5.48 613 5.48
9 320 0.0 398 0.00 553 5.48 531 0
10 381 0.0 442 0.00 803 0.00 849 4.47
11 258 0.0 258 0.00 511 0.00 504 0
12 269 0.0 211 8.94 491 5.48 457 0
13 191 0.0 292 4.47 602 4.47 645 4.47
14 167 0.0 233 8.94 913 4.47 933 0
15 191 0.0 219 0.00 606 4.47 612 4.47
16 196 0.0 200 0.00 576 0.00 572 0
17 183 0.0 211 0.00 601 0.00 581 4.47
18 270 0.0 222 4.47 506 8.94 520 0
19 389 0.0 711 4.47 851 4.47 877 0
20 277 0.0 339 0.00 696 4.47 672 0
Avg. 263.05 0.0 312.7 2.73 646.75 3.66 640.2 1.3915
Table 5 Comparison of running time cost
Exp
no.
Running time cost (s)
IP ? EA IP ? VNS EA
(avg)
IP Hybrid
EA (avg)
MHSA
(avg)
1 444 408 446 672 533 527
2 361 343 367 603 409 409
3 488 484 499 611 506 507
4 421 422 491 677 451 464
5 576 522 614 671 475 492
6 711 661 719 599 526 540
7 602 551 848 701 646 638
8 558 509 562 768 598 599
9 490 456 490 659 551 545
10 382 356 386 577 629 631
11 403 365 406 774 586 590
12 648 352 395 646 590 602
13 752 691 711 722 545 558
14 592 548 567 587 611 629
15 659 593 693 710 602 611
16 788 677 786 658 623 632
17 654 657 608 658 533 537
18 789 737 689 656 523 517
19 880 898 838 617 617 617
20 704 691 686 676 474 485
Avg. 595.1 546.05 590.05 662.1 551.4 555.1
Neural Comput & Applic (2014) 25:703–715 713
123
evolutionary operation for the small problems with rela-
tively few hard constraints. Moreover, it heavily relies on
the simplicity of the hard constraints, so that HEA can
adopt the means of penalty function (some infeasible
solutions are accepted) and rectify the solutions in heuristic
methods (only the feasible solutions survive). For the
CNRP, it is impossible to include the infeasible solutions,
because the solution space is huge and unpredictable,
which is easy to trap in the infeasible solution space so that
no valid result can be produced. Therefore, the hybrid EA
method is problem-specific for its own problem instance,
making it hard to solve multiple-hard-constraint NRPs like
CNRP.
Finally, MHSA [37] performs much worse than our
proposed method. Though MHSA has been proved to solve
some specific nurse rostering problems, it is hard to handle
the problems that include more hard constraints as well as
the problem in this paper. That is because MHSA heavily
relies on the stable optional patterns of problems, which
means less feasible solution can be obtained. Since pro-
cessing the problem in this paper will cause many infea-
sible solutions, MHSA is not able to correct and handle
these solutions, and so it produces many bad solutions to
the results.
All the results presented above show that the IP stage is
able to generate an initial solution under the hard con-
straints and part of the soft constraints, which provides the
basis of EA improvement. With an initial solution for the
CNRP (the problem in this paper involves 30 nurses in
30 days), the EA stage is well designed for the specific
problem and obtains a good result in the accepted runtime.
IP ? EA combines the precision of IP and rapid evolve-
ment of EA and outperforms the other four approaches
[17, 21, 22] in 20 instances on average.
6 Conclusion
This paper has considered a large-scale nurse rostering
problem (named as CNRP) with many complex constraints.
By analyzing the features of the constraints and problem
modeling, we partitioned the constraints into two sets
according to their features and tried to satisfy them
respectively. On the basis of this, we proposed the hybrid
approach of IP and EA stages to achieve global optimiza-
tion. The IP stage is used as the initialization of EA stage
by solving a simplified problem with constraints partition.
The EA stage adopted an evolutionary operation by slightly
violating the previous constraints and tended to satisfy as
many of the soft constraints as possible. The proposed
algorithm took advantage of a deterministic approach and
evolutionary operator to solve the CNRP. In 20 instances,
the proposed algorithm outperformed the other four
approaches on average, which indicates that the IP stage
can produce a high-quality initial solution for evolution and
the EA stage has capacity for global optimization. This
paper sparks the idea of flexible partitioning constraints
and overcoming them respectively, which helps to reduce
the computational complexity of solving NRP problems.
According to the experimental results, it is worth further
study to improve the proposed algorithm for other complex
nurse rostering problems.
One possible direction of future study is to use the
proposed IP ? EA for solving other complex nurse
rostering problems and scheduling optimization problems
in which there are multiple constraints. Moreover, the
combination of IP and EA needs to be studied in detail to
adjust the hybrid algorithm for better optimization.
Acknowledgments This work was supported by National Natural
Science Foundation of China (61370102, 61170193, 61202453,
61203310), Guangdong Natural Science Foundation
(S2011040002890, S2012010010613), the Fundamental Research
Funds for the Central Universities, SCUT (2012ZZ0087,
2014ZG0043) and The Pearl River Science&Technology Star Project
(2012J2200007). The authors thank Dr. Kyle McIntosh for his
proofreading.
References
1. Burke EK, De Causmaecker P, Vanden Berghe G, Landeghem H
(2004) The state of the art of nurse rostering. J Sched
7(6):441–499
2. Sitompul D, Randhawa S (1990) Nurse scheduling models: a
state-of-the-art review. J Soc Health Syst 2:62–72
3. Hung R (1995) Hospital nurse scheduling. J Nurs Adm 25(7–8):
21–23
4. Cheang B, Li H, Lim A, Rodrigues B (2003) Nurse rostering
problems—a bibliographic survey. Eur J Oper Res 151:447–460
5. Aickelin U, Burke EK, Li J (2009) An evolutionary squeaky
wheel optimization approach to personnel scheduling. IEEE
Trans Evol Comput 13(2):433–443
6. Beaumont N (1997) Scheduling staff using mixed integer pro-
gramming. Eur J Oper Res 98:473–484
7. Warner M, Prawda J (1972) A mathematical programming model
for scheduling nursing personnel in a hospital. Manag Sci
19:411–422
8. Warner DW (1976) Scheduling nurse personnel according to
nursing preference: a mathematical programming approach. Oper
Res 24(5):842–856
9. Aickelin U, Dowsland K (2000) Exploiting problem structure in a
genetic algorithm approach to a nurse rostering problem. J Sched
3:139–153
10. Burke EK, Cowling P, De Causmaecker P, Vanden Berghe G
(2001) A memetic approach to the nurse rostering problem. Appl
Intell 15:199–214
11. Easton FF, Mansour N (1999) A distributed genetic algorithm for
deterministic and stochastic labor scheduling problems. Eur J
Oper Res 118:505–523
12. Kawanaka H, Yamamoto K, Yoshikawa T, Shinigi T, Tsuruoka S
(2001) Genetic algorithm with the constraints for nurse sched-
uling problem. In: Proceedings of congress on evolutionary
computation (CEC), pp 1123–1130
714 Neural Comput & Applic (2014) 25:703–715
123
13. Burke EK, De Causmaecker P, Vanden Berghe G (1999) A
hybrid tabu search algorithm for the nurse rostering problem. In:
Proceedings of the simulated evolution learning: selected papers
2nd Asia-Pacific conference simulated evolution learning.
(SEAL), Lecture Notes in Computer Science Series 1585.
Springer, Berlin, pp 187–194
14. Burke EK, De Causmaecker P, Petrovic S, Vanden Berghe G
(2001) A multicriteria meta-heuristic approach to nurse rostering.
In: Proceedings of the practice theory automated timetabling:
selected revised papers 3rd practice theory automated timetabling
international conference, Lecture Notes in Computer Science
Series 2079. Springer, Berlin, pp 118–131
15. Burke EK, De Causmaecker P, Petrovic S, Vanden Berghe G
(2006) Metaheuristics for handling time interval coverage con-
straints in nurse scheduling. Appl Artif Intell 20(9):743–766
16. Beddoe G, Petrovic S (2006) Selecting and weighting features
using a genetic algorithm in a case-based reasoning approach to
personnel rostering. Eur J Oper Res 175(2):649–671
17. Burke EK, Li J, Qu R (2010) A hybrid model of integer pro-
gramming and variable neighbourhood search for highly-con-
strained nurse rostering problems. Eur J Oper Res 203:484–493
18. Tsai C-C, Li SHA (2009) A two-stage modeling with genetic
algorithms for the nurse scheduling problem. Expert Syst Appl
36:9506–9512
19. Pato MV, Moz M (2008) Solving a bi-objective nurse rerostering
problem by using a utopic Pareto genetic heuristic. J Heuristics
14:359–374
20. Cheng BMW, Lee JHM, Wu JCK (1997) A constraint-based
nurse rostering system using a redundant modeling approach.
IEEE Trans Inf Technol Biomed 1:44–54
21. Sheer BB, Wong FKY (2008) The development of advanced
nursing practice globally. J Nurs Scholarsh 40(3):204–211
22. Bai R, Burke EK, Kendall G, Li J, McCollum B (2010) A hybrid
evolutionary approach to the nurse rostering problem. IEEE
Trans Evol Comput 14(4):580–590
23. Wolfe H, Young JP (1965) Staffing the nursing unit: part I. Nurs
Res 14(3):236–243
24. Wolfe H, Young JP (1965) Staffing the nursing unit: part II. Nurs
Res 14(4):199–303
25. Howell JP (1966) Cyclical scheduling of nursing personnel.
Hospitals 40(2):77–85
26. Bard J, Purnomo HW (2005) Preference scheduling for nurses
using column generation. Eur J Oper Res 164:510–534
27. Berrada I, Ferland JA, Michelon P (1996) A multi-objective
approach to nurse scheduling with both hard and soft constraints.
Socio Econ Plan Sci 30:183–193
28. Ikegami A, Niwa A (2003) A subproblem-centric model and
approach to the nurse scheduling problem. Math Program
97:517–541
29. Hadwan M, Ayob M, Sabar NR, Qu R (2013) A harmony search
algorithm for nurse rostering problems. Inf Sci 233:126–140
30. Post G, Veltman B (2004) Harmonious personnel scheduling. In:
Proceedings of the fifth international conference on practice and
automated timetabling (PATAT), pp 557–559
31. Burke EK, Curtis T, Post G, Qu R, Veltman B (2008) A hybrid
heuristic ordering and variable neighbourhood search for the
nurse rostering problem. Eur J Oper Res 188:330–341
32. Dowsland KA (1998) Nurse scheduling with tabu search and
strategic oscillation. Eur J Oper Res 106(2–3):393–407
33. Burke EK, Kendall G, Soubeiga E (2003) A tabu-search hype-
rheuristic for timetabling and rostering. J Heuristics 9(6):451–470
34. Aickelin U, Dowsland KA (2003) An indirect genetic algorithm
for a nurse scheduling problem. Comput Oper Res 31(5):761–778
35. Aickelin U, Burke EK, Li J (2007) An estimation of distribution
algorithm with intelligent local search for rule-based nurse ro-
stering. Eur J Oper Res 58(12):1574–1585
36. Bai R, Blazewicz J, Burke EK, Kendall G, McCollum B (2007) A
simulated annealing hyper-heuristic methodology for flexible
decision support. School of CSiT, Univ. Nottingham, Notting-
ham, UK, Tech. Rep. NOTTCS-TR-2007-8
37. Awadallah MA, Khader AT, Al-Betar MA et al (2011) Nurse
rostering using modified harmony search algorithm/Swarm,
evolutionary, and memetic computing. Springer, Berlin, pp 27–37
Neural Comput & Applic (2014) 25:703–715 715
123