Ant colony optimization with semi random initialization for nurse rostering problem

A nurse rostering problem is an NP-Hard problem that is difficult to solve during the complexity of the problem. Since good scheduling is the schedule that fulfilled the hard constraint and minimizes the violation of soft constraint, a lot of approaches is implemented to improve the quality of the schedule. This research proposed an improvement on ant colony optimization with semi-random initialization for nurse rostering problems. Semi-random initialization is applied to avoid violation of the hard constraint, and then the violation of soft constraint will be minimized using ant colony optimization. Semi-random initialization will improve the construction solution phase by assigning nurses directly to the shift that is related to the hard constraint, so the violation of hard constraint will be avoided from the beginning part. The scheduling process will complete by pheromone value by giving weight to the rest available shift during the ant colony optimization process. This proposed method is tested using a real-world problem taken from St. General Hospital Elisabeth. The objective function is formulated tominimize the violation of the constraints and balance nurse workload. The performance of the proposed method is examined by using different dimension problems, with the same number of ant and iteration. The proposed method is also compared to conventional ant colony optimization and genetic algorithm for performance comparison. The experiment result shows that the proposed method performs better with small to medium dimension problems. The semi-random initialization is a success to avoid violation of the hard constraint andminimize the objective value by about 24%. The proposed method gets the lowest objective value with 0,76 compared to conventional ant colony optimization with 124 and genetic algorithm with 1.


Introduction
Personnel scheduling is a complex problem that deals with the allocation of resources over given time periods to fulfil some constraints or tasks. Generally, personnel scheduling is divided into three main categories, such as time of day schedule, day of week schedule, and combination of both [1]. A combination of both personnel scheduling categories happens to the facility that operates 24 hours and seven days a week, such as hospitals. Scheduling in hospitals deals with allocating personnel into shifts in a day, dan scheduling days in a week simultaneously. Since the hospital has 24 hours and seven days a week to operate, scheduling in the hospital became a critical issue, especially nurse scheduling. Hospitals need to ensure that nurses are available 24 hours and seven days a week. The quality of health care in the hospital is affected by the quality of nurse schedules [2].
Nurse scheduling or also called Nurse Rostering Problem (NRP), is a nondeterministic polynomial-time hard problem (NP-hard problem). The objective of NRP is to allocate nurses to the operational time of the hospital with fulfilling some constraints [3]. Constraints in NRP are divided into hard constraints and soft constraints. Hard constraints are a set of rules that need to fulfil by the schedule such as, period time of work, shift, and days off. Soft constraints are a set of rules that are actually optional to fulfil by the schedule, but it will affect the nurse satisfaction index, such as nurse preference to get longer days off [4]. The nurses that need to be assigned are also divided into senior nurses and junior nurses. A senior nurse is a nurse that is considered as experienced staff, and a junior nurse is a nurse that is considered as less experienced staff [5].
NRP has the objective to assign nurses to any shift, with fulfil the hard constraints and satisfying the soft constraints as much as possible to be good quality scheduling [6]. Since NRP is an NP-hard problem, there are three main techniques to provide the solution for NRP, exact method, heuristics method, dan hybrid method. Exact methods guarantee an optimal solution, but process time might be not acceptable. Example of the exact method is integer programming (IP), constraint programming (CP), etc. The heuristics method would provide a highquality solution with acceptable process time, but in any possibility, the solution provided is not an optimal solution. Example of heuristics method is tabu search, ant colony optimization, genetic algorithm, etc. The hybrid method combined some different techniques to provide a better solution with high flexibility [2]. NRP solution is very difficult to find with regard to real case problems. Because of the diversity of scope and constraints that need to fulfil, it's possible if there is no feasible solution for NRP [5].
Previous research has been conducted to recognized wide variety of methodologies and models to deals with different problem within the NRP [7]. Enhance the initial solution phase by with hyper heuristics approach and utilises a statistical Markov model. [8] improve differential algorithm with scenario-base to increase the flexibility of differential algorithm to deal with different NRP scenario. Ramli et al. [5] conduct research on NRP using tabu search with modification at initialization stage. Initial solution enhanced by perform semi-random initialization. Semi random initialization ensures that each nurse comes with the desired shift, this can increase the level of nurse satisfaction, but also fulfil the hard constraints. Nurse schedule will enhance with tabu search to find better solution and minimize the penalty value. [9] combine decision tree and greedy search to fulfil the hard constraints, then use bat algorithm and particle swarm optimization to optimize by minimizing the violation of soft constraints. Ramli et al. [10] proposed hybrid ant colony optimization (ACO) with hill climbing technique. The hill climbing employed to improve solution generated by ant colony, hill climbing provide a potential solution for NRP that meets the criteria of scope, quality, flexibility and cost. [11] embed reward based movement into bee colony optimization, the reward will give the bee ability to search another optimal solution or duplicate the best solution from previous iteration. Jaradat et al. [4] improve the elitist ant system with external memory, iterated local search, intensification mechanisms, and diversification mechanism. Bunton et al. [12] improve ant colony optimization with integer programming to escape from local optima in ant colony optimization. Ant colony optimization will assign weight to each shift through the pheromone value, then the best shift is selected based on the pheromone value contained in one shift, then the integer programming will select the best solution.
One of the various metaheuristic method can provide possible solution for NP-hard problems is ant colony optimization López-Ibáñez et al. [13]. Which has the main characteristic of using pheromone value as a guide in the search space within repeated of a probabilistic solution construction that led to the optimal solution. Ant colony optimization also have successfully been applied at booth Combinatorial Optimization Problems (COPs) and Stochastic Combinatorial Optimization Problem (SCOPs) by improve the continuous model to non-deterministic discrete automaton [14], it shows that ant colony optimization is expandable and flexible incorporated to deal with a wide various optimization problem. To deal with NRP that complex due to the variety of how many constraints applied and search space of the problem, Aickelin et al. [15] simplify the basic ant colony optimization by represent one time table schedule as one artificial ant, so only one ant allowed to travel and schedule every nurse to available time slots, then use the pheromone values as indicator how good the choice of available time slots to form a feasible schedule.
This research will propose ant colony optimization with semi random initialization for nurse rostering problem. Semi random initialization proposed by Ramli et al. [5] has proven very efficient and give the best feasible solution. This research will improve the ant colony optimization with semi random initialization proposed by Ramli et al. [5]. Semi random initialization employed to ensure hard constraints fulfilled by the schedule, then this research will use ant colony optimization to improve random process and maximize the satisfy of soft constraints. Ant colony optimization implement to give weight to the rest available shift during the ant colony optimization process. Main contribution of this research is utilization of semi random initialization collaborate with pheromone value to give weight in random process so the violation of hard constraints can be avoided, the violation of soft constraints can be minimized, and escape from possibility of local optima in ant colony optimization 2 Theory and proposed method

Scheduling
Scheduling has an important role in the manufacturing and service industry, for example scheduling personnel or employees [16]. The purpose of scheduling is to achieve efficiency, balanced load, and satisfy individual needs as much as possible. The main characteristic of the scheduling problem is allocating limited resources into various kinds of activities that must be fulfilled. The scheduling process is carried out routinely in the decision-making process, based on mathematical and heuristic techniques to allocate work with limited resources [17]. The most common classification of scheduling problems is Pinedo's Classification [18]. Pinedo's Classification divides scheduling into two types, work scheduling, and service system scheduling. Work scheduling is a scheduling that is oriented on resource allocation for jobs that must be fulfilled, for example, machine scheduling, assembly line scheduling, and project scheduling. Service system scheduling is a scheduling that is oriented on resource allocation for services or services that must be fulfilled, for example nurse scheduling, maintenance scheduling, and railway scheduling. The methods used to find solutions for scheduling problems are grouped into three main categories [16], optimal methods, heuristic solution methods, and simulation methods. Optimal methods or also known as exact methods [19], for example are integer programming, linear programming, and dynamic programming. Heuristic solution methods for example are genetic algorithms, tabu search, and ant colony. Simulation method or also known as hybrid method, is a combined method of two or more methods to solve scheduling problems.

Nurse rostering
Nurse rostering problem is one of the scheduling problems related to scheduling nurses in a hospital. Nurse scheduling problems related to managing existing nurses and arranging nurses on shifts that must be fulfil for hospital operations. A good nurse schedule is one that fits the workload, fair, and lowest costs. The quality of nurse schedule can affect the level of nurse satisfaction and the quality of hospital services [20].
Nurse rostering problems have four main entities that can affect the level of complexity of the problem, that is event, time, resources, and constraints [21]. Events are activities that must be carried out, in the case of scheduling nurses, for example shifts that must be undertaken by nurses. Time is a specified time range, in the case of nurse scheduling, an example would be a scheduling time range of four weeks. Resources are subject that run an event, in the case of nurse scheduling resources is a nurse. Constraints are a rule that must be met, in the case of scheduling nurses, for example the minimum working hours or shifts that must be fulfilled by each nurse [22].
Nurse rostering problems is a NP-hard problem [23]. The main purpose of each schedule is to ensure that all hard constraints are fulfilled and satisfy the soft constraints as much as possible. Solution for nurse rostering problem can be achieved by performing optimization to maximize the fulfillment of constraints. Optimization of the solution nurse rostering problem can be done by modeling the problem into a cost function that can calculate against constraints, so that the nurse's rostering problem can be formulated to be optimal by using the maximum or minimum function [4]. The method to find the optimal solution of the nurse rostering problem is exact method, heuristic method, and hybrid method [2]. This research will use data sourced from previous research conducted by [24]. The data is from hospitals in Indonesia, Central Java Province, named General Hospital St. Elizabeth Purwokerto. The data included a list of nurses, type of shift, category of nurses, and constraints. Number of nurses is 12. The types of shifts are morning shift starting at 07.00 until 15.00, afternoon shift starting at 15.00 until 23.00, and night shift starting at 23.00 until 07.00. The categories of nurses used are senior nurses and junior nurses. The Hard constraints used are 9 constraints such as, -Every nurse only assigned to 1 shift in each day.
-Every nurse only assigned to 1 shift in each day.
-Minimum number of nurses is 1 in each shift.
-Maximum number of nurses is 4 in each shift.
-Each shift at least contains 1 junior nurses.
-Each shift at least contains 2 senior nurses.
-Nurses that assigned in night shift is not allowed to assign in morning shift in the next day. -Every nurse that assigned to night shift will get days off.
-Every nurse work for 6 days per week.
-Every nurse work 24 days per month.
The soft constraint is used are 4 constraints such as, -Equal number of working days for every nurses.
-Equal number of morning shift for every nurses.
-Equal number of afternoon shift for every nurses.
-Equal number of night shift for every nurses.
-Ant Colony Optimization

Ant colony optimization
Ant colony optimization is a meta heuristic algorithm that first introduced by Dorigo [25]. Ant colony optimization algorithm is a metaheuristic which inspired based on how the ant colony works. The ant colonies naturally will choose the shortest route when carrying food from the food source to the nest. The ant colony will find the optimum food source, by finding the closest distance from the nest to the food source [26]. Ant colony optimization has an important element named pheromone. The pheromone will always be updated every time the ant finishes its journey [27]. Pheromone can get stronger on the candidate solution that leads to the optimal solution and evaporate on the candidate for the less optimal solution [28]. Updates to the pheromone value will make the pheromone stronger in the optimal solution candidate and influence the next ant to follow the same solution, then reduce the pheromone value for the less optimal solution [29]. The search for optimal solutions using ant colony optimization will be characterized by a high pheromone value in the set of solutions, and the number of ants that follow the solution [27]. The characteristics of ant colony optimization are a combination of prior information regarding promising solution structures, with posterior information regarding the best solution structure previously found. Ant colony optimization has two main operations, namely solution construction, pheromone updates Mirjalili et al. [30]. The characteristics of ant colony optimization are a combination of prior information regarding the structure of a promising solution, with posterior information regarding the structure of the best solution previously found [31].

Ant colony optimization with semi random initialization
This research will use the semi-random initialization concept in the construct solution phase. Semi-random initialization is a process to assign nurses on the available shift by considering the hard constraint, so the violation of hard constraint can be minimized, and then use ant to improve schedule and minimize the violation of soft constraint. The concept of semi-random initialization is applied to the process of selecting available nurses. Semirandom initialization ensures that schedule formation does not violate hard constraints, so this concept will be implemented by creating a list of available nurses to be assigned to each shift in one day. The list of available nurses is stored in an array that will be updated daily. Nurses from 1 to n can be included in the list of available nurses, taking into account the condition of each nurse based on existing hard constraints. Only nurses who meet the hard constraints criteria can be included in the list of available nurses. The construction of the solution-phase will assign a nurse to night shift and a day off sequentially since the hard constraint is a nurse with the night shift will get a day off the next day.
The assigning term also considers the other two hard constraints, which is maximum working days in a week and maximum working days in a month. By implementing the semi-random initialization concept, this method ensures that the hard constraint is already fulfilled from the beginning, so basically, this method minimizes the violation from the beginning. It could be minimizing the time consumption also, compared with another method. Figure 1 is a flow chart of ant colony optimization with semi-random initialization for nurse rostering problems. Figure 2 is a detailed flow of the Construct Solution stage.

Cost function
The mathematical model to calculate cost function that used in this research is based on data that collected from previous research conducted by [24]. The objective function

Experiment result
This research aims to improve ant colony optimization by implementing semi-random initialization for nurse rostering problems. Several cases to examine the proposed method is implemented, such as comparing our proposed method with conventional ant colony optimization and previous method used for NRP case in RS. Elizabeth genetic algorithm proposed by [24], and evaluate the effectiveness of our proposed method with a different number of nurses as a representation of the dimension problem. For the performance comparison, each algorithm will be measured based on the fitness value and the smallest penalty value that has been obtained. Algorithm performance can be said to be better if the fitness value and penalty value are the smallest. The fitness function that used in this research is based on previous research conducted by [24]. The dimensions of the data used for comparison are 12 nurses divided into two categories, 4 junior nurses and 8 senior nurses, 3 shifts (morning, afternoon, evening), and 31 scheduling days. Performance can be said to be better if the fitness value and penalty value are smaller than the others. The parameters used by each algorithm are the parameters that have obtained the best results based on several trials. Table 1 is the result of the comparison of the proposed method ant colony optimization with semi-random initialization, with the conventional ant colony and genetic algorithm proposed by [24]. The performance test is extended by comparing our proposed method with GA and manual scheduling. Performance is measured by several variables such as Time, Violation Value, Fitness Value, and Nurse Workload. In this performance test, we modify the stopping criteria to stop the searching process if the best minimum value has been reached, so we can see the time consuming of each method clearly compared to manual scheduling. Table 3 is the result of comparison scheduling with manual scheduling, genetic algorithm proposed by [24], and the proposed method ant colony optimization with semirandom initialization.
The effectiveness of the method is examined by runs method in some different dimensions [4,12]. The dimension data is represented as number of nurses in this research, so we run our proposed method using a various number of nurses by using 50 number of ants, with several parameters such as a = 2, b = 1, evaporation rate = 0.2, and a large number of iterations 1000 to maximize the search procedure. Figure 3 shows the performance of the proposed method using 12 nurses to assign. Figure 4 shows the performance of the proposed method using 20 nurses to assign. Figure 5 shows the performance of the proposed method using 24 nurses to assign. Table 3 shows the result performance of the proposed method deals with a different number of dimensions data. The result of scheduling 12 nurses, 31 days, and 3 shifts is shown in Figure 6, with an objective value of 0.76. Symbols M for morning shift, E for evening shift, N for night shift, and O for day off.

Discussion
Performance of the ant colony optimization algorithm with semi-random initialization, conventional ant colony and genetic algorithm was compared to find solutions for nurse rostering problem. The results of the comparison of the performance of the three algorithms are shown in Table 1.
The semi-random initialization concept is applied to make sure the assigning process is avoided in the violation of hard constraints, and it's applied at the beginning phase so it can minimize time consumption. The advantage of the combination between the semi-random initialization concept and the pheromone value that was applied succeeded in avoiding schedules that violated hard constraints and minimizing the violation of soft constraints. The semi-random initialization concept succeeds in avoiding the violation of hard constraints by obtaining 0 of penalty value, compared to a conventional ant colony, which received a penalty value of 1. The     combination with pheromone value is also working for minimizing the violation of soft constraint by reducing the fitness value by about 24% compared to genetic algorithm. A lower fitness value is obtained by the proposed algorithm, which is 0.76, compared to the genetic algorithm with a fitness value of 1, and the shortest time is also obtained by our proposed method by 18.42 faster than genetic algorithm, according to Table 2.
The effectiveness performance of the proposed method ant colony optimization with semi-random initialization is presented in Figures 3-5. The proposed method is performed better with small to medium dimensions of data, which is 12 nurses. The proposed method still provides a feasible solution by 0 penalty value in all data dimensions, and it means no violation on hard constraints. Bad performance occurs when the number of nurses is larger than 12, and it may be caused by the constraint that only four nurses can assign to each shift, that mean only 12 nurses assign in each day, assigning more than 12 nurses can cause the violation soft constraints of an equal number of morning shift, afternoon shift, and night shift for every nurse. Table 3 summarize the performance the proposed algorithm to deal with a different dimension of data.

Conclusion
In this research, an improvement on ant colony optimization for the nurse rostering problem is proposed. The semi-random initialization concept can be implemented in the construction scheduling phase with the ant colony optimization. The proposed method ant colony optimization with semi-random initialization has proven to get a minimum objective value than conventional ant colony optimization. Since the violation of hard constraints makes the schedule not acceptable, the adoption of the semi-random initialization concept is successful in reducing the violation of hard constraints and improving the solution constructed with ant colony. Utilization of pheromone values in the ant colony, and the semi-random concept complement the random process so the weight value can be assigned to each of the remaining options from the semi-random process. Strategy for avoiding violation of hard constraints from the beginning also affected time consumption much faster compared to manual scheduling and the other method such as genetic algorithm. The proposed method optimally performs with small to medium dimension data. The objective value and constraint must be evaluated to deal with the largest dimension of data. In future, this proposed method can be enhanced by hybridizing it with other population methods and modifying the objective function to deal with a larger dimension of data.