A heuristic algorithm based on multi-assignment procedures for nurse scheduling

This paper tackles a Nurse Scheduling Problem which consists of generating work schedules for a set of nurses while considering their shift preferences and other requirements. The objective is to maximize the satisfaction of nurses’ preferences and minimize the violation of soft constraints. This paper presents a new deterministic heuristic algorithm, called MAPA (multi-assignment problem-based algorithm), which is based on successive resolutions of the assignment problem. The algorithm has two phases: a constructive phase and an improvement phase. The constructive phase builds a full schedule by solving successive assignment problems, one for each day in the planning period. The improvement phase uses a couple of procedures that re-solve assignment problems to produce a better schedule. Given the deterministic nature of this algorithm, the same schedule is obtained each time that the algorithm is applied to the same problem instance. The performance of MAPA is benchmarked against published results for almost 250,000 instances from the NSPLib dataset. In most cases, particularly on large instances of the problem, the results produced by MAPA are better when compared to best-known solutions from the literature. The experiments reported here also show that the MAPA algorithm finds more feasible solutions compared with other algorithms in the literature, which suggest that this proposed approach is effective and robust.


Introduction
In this paper, we tackle a Nurse Scheduling Problem (NSP) which consists of assigning work shift patterns to a team of nurses over a pre-defined scheduling period in such a way that nurses' preferences (soft constraints) for what type of shift to work in each day are best satisfied while additional requirements (hard constraints) are met. A penalty cost is associated to the non-satisfaction of nurses' preferences and also to the non-satisfaction of the additional requirements. Thus, the objective is to generate feasible nurse schedules with a minimum total penalty cost. The general nurse scheduling problem was classified by Osogami and Imai (2000) as NP-hard. In the literature, we find many different descriptions and models for nurse scheduling due to the different characteristics and policies that arise in each hospital. Similarly, we can find a wide variety of solution procedures to tackle the nurse scheduling problems and a fair comparison between the many proposed algorithms seems to be impractical as discussed by Maenhout and Vanhoucke (2007). Cheang et al. (2003) and Burke et al. (2004) provide surveys of nurse scheduling problems and solution approaches. These surveys reveal that most of the heuristic algorithms for nurse scheduling algorithms in the literature are based on local search procedures. Even recent works tackling nurse scheduling in a multi-objective fashion (e.g. Burke et al. 2012) are still largely based on local search. The distinctive feature of the heuristic algorithm proposed here is that it is based on exact resolution of successive assignment problems instead of local search. The surveys by Cheang et al. (2003) and Burke et al. (2004) also identify the need for a set of benchmark problem instances to facilitate the comparison of the many proposed algorithms for the problem. Towards this, Maenhout and Vanhoucke (2005) proposed a large dataset called NSPLib, which also includes a problem instance generator. NSPLib has 248,640 nurse scheduling problem instances randomly generated and they are classified according to their size and complexity. A subset of these instances is called the 'realistic' set which includes instances with a scheduling period of 28 days. The other set is called the 'diverse' set which includes instances with a scheduling period of 7 days. Instances of both types are used in the experiments of this paper. As mentioned above, NSPLib includes a program for generating different tests instances by changing the type of contract (full-time or part-time), skill sets, etc. For a detailed description, see Maenhout and Vanhoucke (2005). The NSPLib problem instances are available at: http://www.projectmanagement.ugent.be/nsp.php. In their work on nurse scheduling using the NSPLib dataset, Maenhout and Vanhoucke (2006, 2007 have proposed several algorithms and reported a range of results. Other benchmark datasets for nurse scheduling problems have been made available more recently. For example, the First International Nurse Rostering Competition 2010 (see Haspeslagh et al. 2012 and http://www.kuleuven-kulak.be/nrpcompetition for details) includes 60 problem instances classified in three groups according to the expected computational difficulty. Also, Tim Curtois at the University of Nottingham maintains a large collection of employee scheduling benchmark problem instances including nurse scheduling (see http://www.cs.nott.ac.uk/~tec/NRP/ for details). In addition De Causmaecker and Vanden Berghe (2011) proposed a classification system for nurse rostering problems, comparing three datasets: http://www.cs.nott.ac.uk/~tec/NRP/ (Burke et al. 2008), http://allserv.kahosl.be/~burak/project.html (Bilgin et al. 2008) and NSPLib at http://www.projectmanagement.ugent.be/nsp.php (Maenhout and Vanhoucke 2005). In their attempt to classify and compare the problem instances in these tree datasets, they proposed and discussed several notations and categories. According to the authors, the advantage of NSPLib is its large size, which facilitates statistical analysis of different solution approaches.
Developing formal models for the many specific objectives and constraints in nurse scheduling problems and applying optimization methods to solve them are very difficult tasks. Then, developing heuristic algorithms to tackle these problems is a common and effective approach. In fact, Maenhout and Vanhoucke (2005) suggest that the purpose of NSPLib is to be a benchmark dataset for evaluating heuristic approaches to solve nurse scheduling problems. The best results for the NSPLib instances have been obtained with different meta-heuristic approaches including the Electromagnetic method by Maenhout and Vanhoucke (2007), Scatter Search by Maenhout and Vanhoucke (2006) and Genetic Algorithms by Maenhout and Vanhoucke (2008). The present paper presents a new deterministic heuristic algorithm called MAPA (multi-assignment problem-based algorithm), which produces new best solutions for some instances in NSPLib.
According to Cordeau et al. (2002) a good heuristic must satisfy some criteria such as simplicity, flexibility, accuracy and speed. They also state that "algorithms that contain too many parameters are difficult to understand and unlikely to be used". The MAPA algorithm proposed here is simple because it does not require parameter tuning and it uses the wellknown linear assignment problem that is solvable in polynomial time. It is flexible because it is well suited to tackle different constraints (hard and soft) by only adapting the procedure to calculate the matrix of costs (see Sect. 4.1). It also has reasonable accuracy and speed which is illustrated by the experiments described in the next sections.
The remainder of this paper is as follows. The problem description is given in Sect. 2. A high-level description of the proposed MAPA algorithm is given in Sect. 3 and then a detailed description is provided in Sect. 4. Experimental results are presented and discussed in Sect. 5. The final Sect. 6 draws overall conclusions and suggestions for future research.

Description of the nurse scheduling problem
The nurse scheduling problem addressed in this paper is the same as stated by Maenhout and Vanhoucke (2007) with test instances from the NSPLib. The problem involves requirements that must be met (hard constraints) and requirements that are desirable to meet (soft constraints) when constructing the schedule. Hard constraints in this problem are the prohibition of certain successive shift assignments to nurses (for example a night shift followed by an early or a day shift), maximum number of consecutive assignments of the same type (i.e. identical shift assignments), minimum and maximum number of overall working assignments for a nurse and minimum number of consecutive assignments of the same type (i.e. identical shift assignments). Soft constraints in this problem are the minimum coverage requirement (to satisfy the workload demand of each day) and the nurses' preferences.
Nurses express their preferences for the shifts that they want to work in each day. A cost is associated to every shift and this cost is inversely proportional to the expressed preference, i.e. less preferred shifts carry a higher cost. The cost of violating hard constraints is added to the cost of violating soft constraints to obtain the total solution cost which should be minimized. Full details of the costs calculation are given in Sect. 4 when the MAPA algorithm is described.
More formally, the Nurse Scheduling Problem tackled here can be stated as follows. A set of nurses N needs to be scheduled within a scheduling period of d max days (d = 1, . . . , d max ). Each nurse needs to be assigned to a set of shifts in the scheduling period while minimizing the cost of violating hard and soft constraints. Thus, we have: N : set of nurses, index n (n = 1, . . . , n max ), n max = |N |; D: set of days within the scheduling period, thus d max = |D|; S d : set of required shifts for day d, index s (s = 1, . . . , s d ), s d = |S d |.
The term shift refers to a given working period (early, day or night shift) or a rest period (free shift), although the starting/ending times of each shift are not defined in the NSPLib instances. Note that S d represents the minimum coverage requirement, i.e. |S d | is the minimum number of nurses required on day d, then |S d | ≤ |N |. A duty roster, or roster, is a sequence of shifts assigned to one nurse during the scheduling period of d max days. A solution or nurse schedule is a collection of n max duty rosters.

A multipartite model for nurse scheduling
In this paper we represent the above nurse scheduling problem as an acyclic multipartite graph with d max + 1 partitions, where the first partition of vertices corresponds to the set of nurses and the remaining partitions correspond to the sets of shifts (i.e. one partition per day in the scheduling period). Figure 2 shows a sample of this representation in the case where n max = 4 nurses. An edge represents a possible assignment of a shift to a nurse in a particular day (according to the partition number). There are no edges connecting vertices in the same partition. Instead, a sequence of edges connecting vertex n from the first partition (corresponding to nurse n) to a vertex in the last partition indicates the sequence of shifts that are assigned to nurse n. The weight associated to an edge is the cost of assigning a particular shift to nurse n according to the nurse's preferences.
More formally, let's have a graph G = (T , A), where T is the set of vertices and A is the set of edges as described above. The set T is composed by the partitions T o , T 1 , T 2 , . . . , T dmax , where T o is the set of vertices representing the nurses and T d (d from 1 to d max ) is the set of vertices representing the shifts on day d. Thus, we have a multipartite graph representation. The objective is to find n max paths from the first to the last partition while minimizing the total cost. Each path represents a duty roster for one nurse, i.e. the sequence of shifts assigned to a nurse for each day of the scheduling period. In order to find these paths we propose a heuristic algorithm that solves successive assignment problems, each one corresponding to a matching problem between two consecutive partitions (bipartite graph). This assignment problem is formulated as follows: Subject to: The cost matrix [c d ij ] is always a square matrix of size n 2 max and has different interpretation and structure depending on the algorithm phase, as explained in the next section. In some cases, the cost c d ij in (5) (6) and (7) indicate a one-to-one assignment between two partitions. This means that each nurse (partition T 0 ) will be assigned exactly one (working or free) shift for each partition (day). The main idea is to find the minimal cost matching for each bipartite graph so that we find the n max paths (each path corresponds to an individual nurse roster). The main advantage of tackling the nurse scheduling problem in this way is that the assignment problem can then be solved in polynomial time using the algorithm proposed by Carpaneto and Toth (1987) which has a polynomial running time complexity of O(n 3 max ). Also, the heuristic procedure is deterministic producing the same solution every time is applied to the same problem instance. However, note that in our approach we need to solve the assignment problem many times in order to obtain a full nurse schedule.

The proposed heuristic algorithm
We propose a multi-assignment problem-based algorithm (MAPA) which consists of two phases, both based on successive resolutions of an assignment problem between two consecutive partitions in the multipartite graph described above. In the first phase, an initial solution (set of duty rosters) is built. In the second phase, two procedures are employed to improve the initial solution by modifying the previous assignments between the partitions.

Construction phase
The construction phase starts by generating the multipartite graph as defined in Sect. 3. An initial solution is obtained by solving d max successive assignment problems from the first to the last day of the scheduling period.
As stated above, the square matrix of costs [c d ij ] has different interpretations in each phase of the algorithm. In this first phase c d ij is the cost of assigning shift j to nurse i on day d. We note that in the nurse scheduling problem instances tackled here, the number of nurses available to work on a day is usually greater than or equal to the number of required working shifts on that day (covering requirement), i.e. |S d | ≤ |N | as stated in Sect. 2. Then, we complete the cost matrix with spare shifts in order to get a square matrix [c d ij ] where a spare shift is a type of shift considered in the problem (early, late, night or free shift). This means that the algorithm can assign more working shifts than needed in day d (further discussion below on how we deal with this). In this first phase, the matrix [c d ij ] is divided into two blocks as shown in Fig. 1.
Block I contains the shifts that satisfy the required coverage on day d and Block II contains the spare shifts added to form a square matrix [c d ij ] where the number of available Since the minimum coverage requirement is guaranteed by the shifts in Block I, any assignment of spare shifts in Block II to nurses is permitted, including the assignment of free shifts. The function for calculating the costs in Block I is defined as follows: where pc(i, j, d) is the penalty cost (related to the nurse's preferences) for assigning shift j to nurse i on day d; nHCV is the number of hard constraint violations due to this assignment; P h is the penalty for the violation of a hard constraint; nSCV is the number of soft constraint violations due to this assignment and P s is the penalty for the violation of a soft constraint. This cost function is as proposed by Maenhout and Vanhoucke (2007). Let S * d be all the required shifts in S d including free shifts, then S * d = S d ∪ {free shifts}. Therefore, the equation c d ij = min ∀s∈Sd * f (i, s, d) in Block II gives the following information: the penalty cost of assigning spare shift j to nurse i and the shift type in S * d that will be assigned to this nurse i as a spare shift. Note that the value of c d ij in Block II is the same for nurse i. Each cost c d ij in Block II is taken as the minimum cost among the c d ij costs in Block I for the corresponding nurse, also considering the assignments of free shifts to that nurse. This means that for nurse i, each of the costs in Block I corresponds to an assignment (early, day, night or free shift) towards a covering of the required shifts in the workload while the corresponding costs in Block II are equal to the minimum of the costs in Block I for that same nurse. Since the assignments in Block II correspond to spare (not required shifts) our approach produces schedules that definitely meet the minimum coverage requirements and possibly exceed that requirement for some days in the scheduling period. Hence, the associated constraint violation costs are set accordingly to complete the overall multi-assignment problem.
An assignment problem is constructed and solved for each day of the scheduling period. Note (see Fig. 2) that in the first assignment of shifts (day 1) from partition 1 to partition 2 there is no previous assigned shift. However, from the second assignment (day 2) onwards, the previous assignments must be considered when calculating the cost matrix. That is, when calculating the c d ij cost for nurse i on day d, the shifts assigned to that nurse in previous days are taken into account. In order to calculate c d ij a simple procedure (called constraints update) checks the sequence of shifts assigned to nurse i in the previous days to day d. The procedure checks the constraints, e.g. if the minimum/maximum number of working assignments is satisfied or not. The time spent in calculating c d ij depends on the length of Fig. 3 Example of reassignment after the cut ( Fig. 2 and then solving the new assignment problem) with the cutting and recombination procedure (CRP), resulting in a reassignment of working and spare shifts. Note that on day 5 a spare shift was changed (updated) for reducing the cost corresponding to nurse 2 individual roster (assuming that nurse 2 prefers shift D to shift E) that sequence of shifts which is known to be not greater than d max . This process is repeated for each day in the scheduling period. Then, at the end of this multi-assignment process, we have constructed an initial solution, i.e. a duty roster for each nurse. The construction phase just explained is expressed in the following pseudo-code (AP stands for assignment problem).

Improvement phase
The improvement phase is composed of two procedures that aim to improve the initial solution obtained in the construction phase. The first procedure, called Cutting and Recombination Procedure (CRP), performs successive 'cuts' in the multipartite graph before each day d. This means dividing the duty roster in two parts (left-and right-hand sides) and then constructing another assignment in the cut made, as it is shown in Fig. 3. Therefore, a new assignment problem is formulated with new square costs matrix [c d ij ] and then solved after each cut. An important difference when solving this new assignment problem is that c d ij represents the cost of assigning to nurse i on day d, the left-hand side of schedule j to the right-hand side of the same schedule which takes into account the shifts already assigned before and after the cut. In order to calculate this cost, the algorithm explores which spare shifts (those with the minimum cost) can be updated (reassigned) for the nurse in such a way that the new reassignment has a reduced cost. Such updates in the assignment of spare shifts after the cut are possible due to the degree of flexibility in the nurse' preferences. The satisfaction of such preferences takes into account the left and right-hand sides of the cut schedule, which might be different from the construction of the initial schedule when there is no assignment to the right of the given partition.
The pseudo code of the CRP improving procedure is given below (AP stands for assignment problem).  The second improvement procedure, called Shift Redistribution Procedure (SRP), aims to decrease the total cost of the solution by redistributing shifts among nurses in each day as shown in Fig. 4. Since the solution cost is associated to the nurses' preferences, the same shift assigned to different nurses may contribute with different costs to the overall schedule cost. Then, this SRP improving procedure consists of selecting a day (partition) in the schedule and then reassigning the n max shifts on this day to the n max rosters. The cost of each association is an element of the matrix [c d ij ], where c d ij is the cost of replacing shift j in day d of the schedule for nurse i. This calculation of the costs is analogous to the one performed in the CRP procedure and involves the minimum cost of the spare shifts as well as the constraints update procedure described in Sect. 4.1.
Once the cost matrix is generated and the related assignment problem is solved, the current solution is altered through shift exchanges and some spare shifts may be replaced. Figure 5 shows an example of such alteration.
This SRP improving procedure is repeated for all partitions (all days) according to the pseudo-code shown below (AP stands for assignment problem).  The two improving procedures CRP and SRP described above are performed in a sequential fashion in both directions covering the d max partitions: forward (d = 1 to d max ) and backward (d = d max downto 1). The procedures are performed until there is no improvement for a certain number of iterations (NumIt). Therefore, we defined four variants: RCP_Forward(s), SRP_ Forward(s), RCP_Backward(s) and SRP_Backward(s), where s represents a solution (full schedule). Let Val(s) be the cost of solution s, which is equal to the objective function value of the last assignment problem solved, then the overall proposed improvement phase in our algorithm works as shown in the pseudo-code below (the fixed execution order of the improvement procedure variants was decided by preliminary experimentation). The parameter NumIt is the predefined number of times that the whole improvement procedure is attempted without an improvement in the current solution.

Experimental setting
The proposed MAPA algorithm was implemented in Pascal programming language and the tests were performed on a PC with two 3.2 GHz quad-core Xeon processors and 16 GB of RAM running Windows XP. The problem instances were obtained from the NSPLib library (Maenhout and Vanhoucke 2005).
We tested MAPA on 248,640 problem instances split in two groups: Group 1 with 233,280 instances involving 1-week schedules and Group 2 with 15,360 problem instances involving 4-week schedules. In the Group 1 we find 29,160 requirement-costs problem instances involving a scheduling period of 7 days (1-week schedule). These instances are divided by problem size: 25, 50, 75, and 100 nurses, each subset containing 7,290 instances. Each problem instance has a different set of requirements per day and different preference costs. Furthermore, there are also 8 cases with different preferences and coverage constraints. Then, each of these 8 preferences-coverage cases may be combined with each of the 29,160 requirements-costs problem instances, forming a total of 233,280 1-week schedule problem instances. In the Group 2 we find 1,920 requirement-costs problem instances involving a scheduling period of 28 days (4-week schedule). These instances are divided by problem size: 30 and 60 nurses, each subset containing 960 instances. Again, we combine the 8 preference-coverage cases with each of the 1,920 requirement-costs problem instances forming a total of 15,360 4-week schedule instances. There are two important issues we must discuss about the use of NSPLib. The first issue is that the results we obtained for 38 of these instances (33 instances with 30 nurses and 5 instances with 60 nurses) could not be compared to existing results. We believe that the solution costs are misreported in the NSPLib because in some cases the reported cost is less than zero, which is not possible considering the given definition of penalty costs. The penalty values for soft constraint violations used here are the same as the ones used by Maenhout and Vanhoucke (2006) and Maenhout and Vanhoucke (2007), i.e. P h = P s = 100. Also, we fixed NumIt = 3 in the improvement phase.
The second issue in using NSPLib is that the minimum coverage constraint (working shifts required in each day) is always satisfied by our algorithm (as explained in Sect. 4.1), but this is not the case in some of the (infeasible) solutions reported in the NSPLib. In other words, our MAPA procedure satisfies the minimum coverage hard constraint, while some of the solutions reported in NSPLib satisfy some of the constraints but not necessarily the coverage constraint. We followed exactly the same definition stated by Maenhout and Vanhoucke (2007), i.e. "a nurse schedule is said to be feasible if the coverage constraints and all other case-specific constraints are satisfied". Then, given this issue with feasibility in some solutions reported in NSPLib, in order to compare our results to those NSPLib infeasible solutions, we made the following adjustments. At the end of the improvement phase, if a solution is infeasible we apply a procedure that changes shifts to attempt satisfying all hard constraints except the coverage constraints. Then, if a required working shift is not assigned, a penalty is added to the solution cost. However, if another hard constraint is satisfied, then a penalty is deducted from the solution cost. For example, if a nurse works more than the maximum allowed number of working days, this constraint violation can be satisfied by replacing a working shift with a free shift (in case of a spare shift). Anyway, the solution stays infeasible, but is more comparable to the solutions reported in NSPLib.

Results and discussion
We compare the results obtained by MAPA to the results reported in NSPLib. These results are split in two groups, one for the 1-week instances and the other for the 4-week instances. Each group is then split according to the problem size, i.e. the number of nurses.
The top four sections of Table 1 show the results reported by NSPLib and the results obtained by MAPA for the 233,280 1-week instances involving 25, 50, 75 and 100 nurses. The two sections of Table 1 below the line report results for the 15,322 (not 15,360) 1 4-week instances involving 30 and 60 nurses. The best results are highlighted in bold and the data given in each column is as follows. Column one gives the number of nurses |N |. Column two gives a label for each case (instances of the same type). Column three gives the total number of solved instances (#Inst) for each case. Columns four and six give the average solution cost (AvgCost) reported in NSPLib and obtained by MAPA respectively. Columns five and seven give the average number of constraints violations (AvgVl) reported in NSPLib and obtained by MAPA respectively. Columns eight and nine give the relative difference between the NSPLib results and MAPA results with respect to the average solution cost (GpCost) and the number of constraint violations (GpVI) respectively. The last three columns give the percentage of times in which the best solution cost is reported in NSPLib (column ten), obtained by MAPA (column twelve) or there is a tie (column %both). The %GAP value is calculated as follows: where Val() is the solution cost value obtained by the given method. The results shown in Table 1 indicate that MAPA performed poorly on the 1-week small instances (with 25 nurses), performed better on the 1-week larger instances (with 50, 75 and 100 nurses), but performed very well on the 4-week instances (with 30 and 60 nurses). In the 4-week instances MAPA always reached better results than those reported in NSPLib. Looking at the overall performance of MAPA compared to the solution costs reported in NSPLib across all 1-week schedules, we can report that MAPA obtained solutions with better average cost on 7.26 % of the instances. However, when considering all 4-week schedules, MAPA obtained solutions with better average cost on 99.48 % of the instances. We highlight case 15 with 60 nurses where MAPA showed its best performance, that is, a 12.21 % lower average cost solutions with 32.40 % fewer constraint violations. Case 15 for 30 nurses is also a case where MAPA performed very well. Table 2 shows the average solution cost for those instances in which NSPLib reports feasible solutions (recall that NSPLib reports infeasible solutions for some instances). This table shows the number of instances for which a feasible solution is reported both by MAPA and NSPLib (#BothFeas), the number of instances for which a feasible solution is reported   Table 2 indicate that MAPA reached better solutions and also more feasible solutions on larger instances, mainly 1-week schedules with 100 nurses and 4-week schedules with 30 and 60 nurses. We highlight that on the 4-week schedules MAPA obtained more feasible solutions in all cases.
The results shown in Tables 1 and 2 give us some evidence that the multiple resolutions of the assignment problems in each step of the improvement procedures constitute an effective approach to build larger schedules. Also, these results indicate that the improvement phase is particularly useful when making reassignments of shifts for nurses by targeting existing costly assignments. Table 3 shows the average computational time taken by MAPA and the corresponding computational time reported in NSPLib. Without taking into account that the machines used were different, the last column in the table gives an indication of the difference in computation time between MAPA and NSPLib.

Computational time
Note that for smaller instances the average execution time of MAPA is shorter than the time reported in NSPLib. As the size of the instance grows, the running time of the proposed MAPA method becomes larger compared to the time reported in NSPLib. This also indicates that although the proposed multi-assignment approach is very effective in finding low-cost feasible solutions for large instances, the computational efficiency of MAPA is an aspect that could be improved. The resolution of each assignment problem is done in polynomial time, but the number of assignment problems solved together with the improvement phase, slow down the method on larger instances.

Performance of the improvement procedures
Now we assess the contribution of the CRP and SRP improvement procedures to the performance of MAPA. Table 4 presents results from additional tests with some instances involving 1-week and 4-week schedules. We conducted three independent experiments on the same set of initial solutions: (1) applying CRP only, (2) applying SRP only and (3) applying both CRP and SRP. Table 4 presents the results of these experiments as follows. The initial solution cost is shown in column (InitCost), the cost obtained after applying CRP only to the initial solution is shown in column (CRP-Cost), the percentage cost reduction achieved by CRP is shown in column (%CRP), the cost obtained after applying SRP only to the initial solution is shown in column (SRP-Cost), the percentage cost reduction achieved by SRP is shown in column (%SRP), the cost obtained by applying both CRP and SRP to the initial solution is shown in column (CRP&SRP) and the percentage cost reduction achieved by applying both CRP and SRT is shown in column (%CRP&SRP). Table 4 shows that CRP obtained more cost reductions over the initial cost than SRP. On some instances, CRP alone achieved the same improvement as when applying both procedures. However, Table 4 shows that overall, applying the two procedures achieves better results than applying either CRP or SRP alone.

Performance of MAPA
MAPA has shown to perform better on problem instances of larger size. Figure 6 shows a curve of %GAP for cost reduction and a curve of %GAP for soft constraint violations reduction for different problem instance sizes. Each point in the curves corresponds to the percentage of the average difference between the results obtained by MAPA and those reported in NSPLib. For example, the first point to the left in Fig. 6(a) indicates that on the problem instances with 7-days scheduling period and 25 nurses, MAPA obtained an average solution cost 0.37 % higher. The last point to the right on Fig. 6(a) indicates that on the problem instances with 28-days scheduling period and 60 nurses, MAPA obtained an average solution cost 2.93 % lower. Figure 6(b) shows similar information but with respect to the difference in soft constraints violations. For example, the two first points to the left  indicate that on the problem instance with 7-days scheduling period and 25 or 50 nurses, MAPA obtained an average solution with the same penalty violations as those reported in NSPLib. The last point to the right of Fig. 6(b) indicates that on the problem instances with 28-days scheduling period and 60 nurses, MAPA obtained an average solution with 3.98 % less soft constraints violations. Figure 7 shows the percentage number of times that the best solution cost is reported in NSPLib, is obtained by MAPA or both. It can be seen that MAPA performs better as the size of instances grows. Figure 7 shows that for instances with 7-days scheduling period and 50 nurses, the best results percentage achieved by MAPA and those reported in NSPLib are very close, 21.26 % and 27.52 %, respectively. However, MAPA overcomes the results reported in the NSPLib for instances with 7-days scheduling period and 75 nurses.
These results show again that, as the size of instances grows with respect to the length of the scheduling period or the number of nurses, the performance of MAPA with respect to the solution quality improves considerably producing better results than those reported in NSPLib.
Although MAPA uses some more computational time compared to the results reported in NSPLib, the proposed algorithm can still be considered efficient for large instances. For example, producing a high-quality schedule for a problem with 4-week scheduling period and 60 nurses takes MAPA around 450 seconds (around 7.5 minutes) which can be considered practical.

Usability of MAPA
We should note that while it is common for heuristic algorithms (particularly metaheuristics) to use randomization, MAPA is deterministic and hence multiple executions always generate the same results for the same input. In hospitals it is usually the case that nurse re-scheduling is required due to changes in demand, staff availability, etc. Another interesting aspect of MAPA is the possibility of using it for re-scheduling when facing unforeseen changes. Such re-scheduling is possible by applying the algorithm from the day in which the change happened onwards, while the previous days (left-hand side of the multipartite graph) are treated as historical records. Then, the multipartite model and multi-assignment procedure in MAPA is a suitable re-scheduling approach. The above features can be seen as very valuable for a heuristic approach to be accepted by human decision-makers (Cordeau et al. 2002) and particularly in the context of real-world healthcare environments (Petrovic and Vanden Berghe 2012).

Conclusions
In this work we proposed MAPA (multi-assignment problem algorithm) as a deterministic and effective heuristic algorithm for tackling a nurse scheduling problem. The proposed algorithm is based on an exact solution procedure with polynomial time complexity that solves a series of sub-problems (assignment problems). Each sub-problem corresponds to the assignment of shifts to all nurses on a particular day, while considering the assignments already made on other days of the scheduling period.
We believe that MAPA satisfies the various desirable criteria defined by Cordeau et al. (2002) for heuristic methods. The simplicity criterion is met because the proposed algorithm does not require parameter tuning and it uses a classical well-known assignment problem which is easily solved. The flexibility criterion is also observed when incorporating new constraints which can be achieved by just introducing new values on the cost matrix (through Eq. (9)) and modifying the appropriate constraints update procedure in the improvement stage of the algorithm. Reasonable accuracy and speed criteria are also observed in MAPA, particularly for larger problem instances, as it was shown in the experimental results of Sect. 5.
We also believe that MAPA satisfies several of the seven criteria proposed by Petrovic and Vanden Berghe (2012) for nurse scheduling methods. MAPA has good expressive power given its ability to tackle a wide variety of constraints by only modifying the procedure to construct the cost matrix. MAPA has good flexibility because the multi-assignment procedure can be easily adapted to different nurse scheduling scenarios. The results presented here also show that MAPA has good algorithmic power in terms of effectiveness and efficiency. MAPA has good rescheduling capability (as discussed in Sect. 5.6) given the underlying multipartite model and associated multi-assignment procedure. MAPA is also good on parameter tuning because its performance does not depend on such process. MAPA meets the maintenance criterion because updating the domain knowledge about the specific nurse rostering problem being solved can be done easily by having a procedure to check each constraint (hard or soft) in order to construct the cost matrix. The only criterion of those proposed by Petrovic and Vanden Berghe that is not fully met by MAPA is the learning capability since the method is not capable of self-improving its performance over time.
In general, the solutions obtained by MAPA are better than the solutions reported in the NSPLib dataset. Taking into account all 248,602 solutions, MAPA obtained better solutions in 34.70 % of the instances. On the opposite, NSPLib reports better solutions than those obtained by MAPA in 27.03 % of the instances. Also, MAPA produced more feasible solutions than those reported in NSPLib. Therefore, we believe that this paper contributes with the introduction of a new deterministic and effective heuristic algorithm to tackle the nurse scheduling problems in NSPLib. The paper also contributes by reporting new best results on some NSPLib instances compared to those by Maenhout and Vanhoucke (2007) obtained with different meta-heuristic approaches including the Electromagnetic method, Scatter Search and Genetic Algorithms.
As future research work, we suggest to investigate extensions to MAPA by considering new improvement procedures in addition to those described here. Also, it would be interesting to investigate the applicability of MAPA to other nurse scheduling benchmark datasets. Another suggestion is to combine the improvement procedures (CRP, SRP and perhaps others) with some meta-heuristic techniques to develop a hybrid approach. Having more improvement procedures, could allow using them as neighbourhood search routines and possibly to combine them into a VNS (variable neighbourhood search) style meta-heuristic. Also, the improvement of the computational time used by MAPA in larger problem instances is subject of future investigation.