A Bayesian Optimization Algorithm for the Nurse Scheduling Problem
Total Page:16
File Type:pdf, Size:1020Kb
A Bayesian Optimization Algorithm for the Nurse Scheduling Problem Proceedings of 2003 Congress on Evolutionary Computation (CEC2003), pp. 2149-2156, IEEE Press, Canberra, Australia, 2003. Jingpeng Li School of Computer Science Uwe Aickelin University of Nottingham School of Computer Science NG8 1BB UK University of Nottingham [email protected] NG8 1BB UK [email protected] Abstract- A Bayesian optimization algorithm for the (Aickelin and Dowsland, 2003; Li and Kwan, 2001b and nurse scheduling problem is presented, which involves 2003) for nurse and driver scheduling. In these indirect choosing a suitable scheduling rule from a set for each GAs, the solution space is mapped and then a separate nurse’s assignment. Unlike our previous work that decoding routine builds solutions to the original problem. used GAs to implement implicit learning, the learning In our previous indirect GAs, learning was implicit in the proposed algorithm is explicit, i.e. eventually, we (‘black-box’) and restricted to the efficient adjustment of will be able to identify and mix building blocks weights for a set of rules that are used to construct directly. The Bayesian optimization algorithm is schedules. The major limitation of those approaches is applied to implement such explicit learning by that they learn in a non-human way. Like most existing building a Bayesian network of the joint distribution construction algorithms, once the best weight combination of solutions. The conditional probability of each is found, the rules used in the construction process are variable in the network is computed according to an fixed at each iteration. However, normally a long initial set of promising solutions. Subsequently, each sequence of moves is needed to construct a schedule and new instance for each variable is generated by using using fixed rules at each move is thus unreasonable and the corresponding conditional probabilities, until all not coherent with the human learning processes. variables have been generated, i.e. in our case, a new When a human scheduler works, he normally builds a rule string has been obtained. Another set of rule schedule systematically following a set of rules. After strings will be generated in this way, some of which much practice, the scheduler gradually masters the will replace previous strings based on fitness selection. knowledge of which solution parts go well with others. He If stopping conditions are not met, the conditional can identify good parts and is aware of the solution probabilities for all nodes in the Bayesian network are quality even if the scheduling process is not completed updated again using the current set of promising rule yet, thus having the ability to finish a schedule by using strings. Computational results from 52 real data flexible, rather than fixed, rules. In this paper, we design a instances demonstrate the success of this approach. It more human-like scheduling algorithm, by using a is also suggested that the learning mechanism in the Bayesian optimization algorithm to implement explicit proposed approach might be suitable for other learning from past solutions. A nurse scheduling problem scheduling problems. with 52 real data instances gathered from a UK hospital is used as the test problem. Nurse scheduling has been widely studied in recent 1 Introduction years, and an extensive summary of the approaches can be found in Hung (1995) and Sitompul and Randhawa Scheduling problems are generally NP-hard combinatorial (1990). This problem is highly constrained, making it problems, and a lot of research has been done to solve extremely difficult for most local search algorithms to these problems heuristically (Aickelin and Dowsland, find feasible solutions, let alone optimal ones. In our 2002 and 2003; Li and Kwan, 2001a and 2003). However, nurse scheduling problem, the number of the nurses is most previous approaches are problem-specific and fixed (up to 30), and the target is to create a weekly research into the development of a general scheduling schedule by assigning each nurse one out of up to 411 algorithm is still in its infancy. shift patterns in the most efficient way. The proposed Genetic Algorithms (GAs) (Holland 1975; Goldberg Bayesian approach achieves this by choosing a suitable 1989), mimicking the natural evolutionary process of the rule, from a rule set containing a number of available survival of the fittest, have attracted much attention in rules, for each nurse. A potential solution is therefore solving difficult scheduling problems in recent years. represented as a rule string, or a sequence of rules Some obstacles exist when using GAs: there is no corresponding to nurses from the first one to the last. canonical mechanism to deal with constraints, which are As a model of the selected strings, a Bayesian network commonly met in most real-world scheduling problems, (Pearl 1998) is used in the proposed Bayesian and small changes to a solution are difficult. To overcome optimization algorithm to solve the nurse scheduling both difficulties, indirect approaches have been presented problem. A Bayesian network is a directed acyclic graph with each node corresponding to one variable, and each of days worked is not usually the same as the number of variable corresponding to the individual rule by which a nights. Therefore, it becomes important to schedule the schedule will be constructed step by step. The causal ‘correct’ nurses onto days and nights respectively. The relationship between two variables is represented by a latter two characteristics make this problem challenging directed edge between the two corresponding nodes. for any local search algorithm, because finding and The Bayesian optimization algorithm is applied to maintaining feasible solutions is extremely difficult. learn to identify good partial solutions and to complete The numbers of days or nights to be worked by each them by building a Bayesian network of the joint nurse defines the set of feasible weekly work patterns for distribution of solutions (Pelikan et al, 1999; Pelikan and that nurse. These will be referred to as shift patterns or Goldberg, 2000). The conditional probabilities are shift pattern vectors in the following. For each nurse i and computed according to an initial set of promising each shift pattern j all the information concerning the solutions. Subsequently, each new instance for each node desirability of the pattern for this nurse is captured in a is generated by using the corresponding conditional single numeric preference cost pij . These costs were probabilities, until values for all nodes have been determined in close consultation with the hospital and are generated, i.e. a new rule string has been generated. a weighted sum of the following factors: basic shift- Another set of rule strings will be generated in the pattern cost, general day/night preferences, specific same way, some of which will replace previous strings requests, continuity problems, number of successive based on roulette-wheel fitness selection. If stopping working day, rotating nights/weekends and other working conditions are not met, the conditional probabilities for all history information. Patterns that violate mandatory nodes in the Bayesian network are updated again using contractual requirements are marked as infeasible for a the current set of rule strings. The algorithm thereby tries particular nurse and week by giving them a suitably high to explicitly identify and mix promising building blocks. pij value. It should be noted that for most scheduling problems, 2.2 Integer Programming the structure of the network model is known and all The problem can be formulated as an integer linear variables are fully observed. In this case, the goal of program as follows. learning is to find the rule values that maximize the likelihood of the training data. Thus, learning can amount Indices: to ‘counting’ in the case of multinomial distributions. i = 1... n nurse index; The rest of this paper is organized as follows. Section 2 j = 1... m shift pattern index; gives an overview on the nurse scheduling problem, and k = 1...14 day and night index (1...7 are days and 8...14 the following section 3 introduces the general concepts are nights); about graphical models and Bayesian networks. Section 4 s = 1... p grade index. discuses the proposed Bayesian optimization algorithm, describing the construction of a Bayesian network, Decision variables: learning based on the Bayesian network, and the four 1, nurse i works shift pattern j building rules in detail. Computational results using 52 . xij = data instances gathered from a UK hospital are presented ,0 else in section 5. Concluding remarks are in section 6. Parameters: m = Number of shift patterns; 2 The Nurse Scheduling Problem n = Number of nurses; p = Number of grades; 2.1 General Problem 1, shift pattern j covers day/night k ; a jk = Our nurse scheduling problem is to create weekly ,0 else schedules for wards of nurses by assigning one of a 1, nurse i is of grade s or higher ; number of possible shift patterns to each nurse. These qis = schedules have to satisfy working contracts and meet the ,0 else demand for a given number of nurses of different grades pij = Preference cost of nurse i working shift pattern j; on each shift, while being seen to be fair by the staff Rks = Demand of nurses with grade s on day/night k; concerned. The latter objective is achieved by meeting as Ni = Working shifts per week of nurse i if night shifts are many of the nurses’ requests as possible and considering worked; historical information to ensure that unsatisfied requests Di = Working shifts per week of nurse i if day shifts are and unpopular shifts are evenly distributed. worked; The problem is complicated by the fact that higher Bi = Working shifts per week of nurse i if both day and qualified nurses can substitute less qualified nurses but night shifts are worked {for special nurses}; not vice versa.