A TWO-PHASE METHOD FOR OPERATING ROOM SCHEDULING

In this paper, a two-phase method and a computational program to perform surgery scheduling for operating rooms in a hospital are presented. In Phase I, surgeries are assigned to operating rooms using a generalized assignment model. In Phase II, a sequence for performing surgeries in each room is established. In the proposed method, Phase I maximizes doctors’ room preferences, taking into account the time available in each room, and Phase II establishes a schedule of surgeries in the rooms, according to doctors’ preferences for periods of day. The program was written in Visual Basic for Microsoft Excel and was tested as a surgery scheduling tool at St. Lydia Hospital, Ribeirão Preto, Brazil.


INTRODUCTION
In this paper, a two-phase method and a computational program to help a hospital scheduling team to assign surgeries to be performed in a specific day to the operating rooms available are presented.In Phase I, the mathematical model of generalized assignment is solved to decide which surgeries will be performed in each room.In Phase II, the surgeries' sequence for each operating room is established.
All surgeries to be scheduled are known in advance, which is a common assumption for elective surgery scheduling problems, in contrast to urgent surgeries.The durations of surgeries are deterministic and cover both surgery times and setup times for the operating rooms (duration = surgery time + setup time).
The model used to assign surgeries to operating rooms is the generalized assignment model (Hillier and Lieberman, 2004).The proposed model maximizes doctors' room preferences, taking into account the availability of each operating room.Surgery sequencing is performed according to doctors' preference for performing surgeries at certain periods of the sequence during the day (earlier, intermediate, and later).The results are graphically represented through a Gantt chart.
On Section 2, a literature review on the mathematical models and methods proposed in literature for solving the problem of scheduling operating rooms in ambulatory surgical settings is made.On Section 3, the research methodology is introduced.This two-phase method proposed for operating room scheduling is presented in Session 4.An illustrative example of the proposed method is provided on Section 5. Tests on the proposed method based on data from an 8-month scheduling period of operating rooms were carried out at St. Lydia Hospital, in Ribeirão Preto, Brazil.Results of the computational tests are available on Section 6.On Section 7, it was present a discussion on the proposed method and the results of computational tests.The conclusion is available in Section 8.
St. Lydia Hospital is a city hospital founded in 1960.It was first designed to assist poor children due to the outbreak of polio and meningitis in the Ribeirão Preto area.Presently, it is a general hospital that provides several medical specialties for the population.The surgical center offers surgeries of high, medium and low complexity.To this end, it has four operating rooms and five recovery beds.
The computational program ORP (Operating Rooms Planning) corresponds to the proposed method and was written in Visual Basic for Microsoft Excel.In the program, the generalized assignment model is solved by means of Solver, an add-in for Microsoft Excel, with the preprogrammed branch-and-bound technique (Frontline Solvers, 2016).Solver was chosen due to the efficiency of the branch-and-bound technique (optimal solution), and the popularity and easy access of Microsoft-Excel.Problems with more than 200 decision variables can be solved optimally by OpenSolver for Excel (Mason, 2012), a free Solver version available on the internet (http://opensolver.org/)for bringing solutions for large problems.
The sequencing problem is solved by heuristic procedure in order to obtain an approximate solution, based on (I) doctors' time preference list and (II) surgery durations.The time available in each operating room is divided in three periods (earlier, intermediate, and later), and the sequencing is performed by a greedy algorithm based on a sorting multi-column procedure (Miles, 2006).

LITERATURE REVIEW
Problems of assignment and sequencing are NP-complete (Garey and Johnson, 1977).Due to the algorithmic complexity of the problems, it is not possible to obtain an optimal solution for large examples in reasonable computational time.Therefore, it is often found in literature the proposition of decomposition method and heuristics or approximate algorithms as a solution to the problem.Jebali et al. (2006) and Aringhieri et al. (2015) decompose the solution of the problem and exploit the inherent hierarchy between the two decision levels.Blake and Donald (2002), Essen et al. (2012), Zhaoxia and Xueping (2014), Dios et al. (2015) Aringhieri et al. (2015) propose a 0/1 programming formulation for assignment and scheduling.Heuristics and metaheuristics are used to solve integer models by Blake and Donald (2002), Dios et al. (2015) and Aringhieri et al. (2015).Marques et al. (2014) propose a genetic algorithm.M 'Hallah and Al-Roomi (2014) and Jebali and Diabat (2015) describe a stochastic approach for operating room planning.Zonderland et al. (2010) use queuing theory and Markov decision processes.Donald and Blake (2002), Marques et al. (2014), Zhang et al. (2014) and Dios et al. (2015) describe case studies, respectively, in hospitals of Canada, Portugal, China and Spain.A review of recent operational research methods for operating room planning and scheduling can be found in Cardoen et al. (2010) and Guerriero and Guido (2011).
A review on exact and approximate methods to solve the generalized assignment problem is proposed by Martello and Toth (1992), with different objective functions, transformations, and limits.The large number of methods developed based on branch-and-bound is pointed out in Cattrysse and Van Wassenhove (1992).An extensive and detailed study to compare the performance of heuristics is proposed by Amini and Racer (1994).Öncan (2007) reviews literature on metaheuristics and heuristics.Morales and Romeijn (2005) describe the state of the art.Tabu search metaheuristic is used by Swangnop and Chaovalitwongse (2014) and Mckendall et al. (2015).Quick heuristic algorithms the assignment problem are described by Srivastava and Bullo (2014), Yuan et al. (2014) and Topcuoglu et al. (2014).Lagrangian and dynamic programming are associated in the method proposed by Posta et al. (2012).Woodcock and Wilson (2010) propose branchand-bound combined with tabu search.

METHODOLOGY
This work is an applied research, with the goal of proposing a method and a computational program to help a hospital scheduling team in assigning surgeries to operating rooms.The real data used for the computational tests carried out with the proposed method were provided by Sta.Lydia Hospital, Ribeirão Preto, Brazil.
The proposed method uses a quantitative approach, since decision-making is determined by solving a mathematical model.The model has been solved by Microsoft-Excel-Solver, which was chosen to develop the computational program for the following reasons: (i) Excel is a popular and easy-touse computer platform, available on most microcomputers, which facilitates access and generates software savings; (ii) the real problems to be solved are small-and medium-sized, within the limit of Microsoft-Excel-Solver decision variables; (iii) Excel Solver has a preprogrammed branch-and-bound technique to solve integer and non-linear problems, able to solve optimally the generalized assignment problem; (iv) because it is a well-known interface, operator training can be facilitated; (v) the decision is presented graphically through the Gantt Chart, facilitating the interpretation of the results and the implementation.

METHOD
The proposed method for solving the problem of the daily surgery assignment to operating rooms is composed of two phases: Phase 1: Assignment of Surgeries; Phase II: Sequencing of Surgeries.A computational program corresponding to the proposed method was written in Microsoft-Excel with the aim of automating decision-making.

Phase I
In the phase assigning surgeries to operating rooms, a generalized assignment problem (Hillier and Lieberman, 2004) is solved.In this problem, there are m surgeries to be performed in n operating rooms, and m > n.The doctor's preference to perform surgery i in operating room j is equal to p ij .Performing surgery i in operating room j requires an amount of time a ij of the total time available b j in each room.Doctor's preferences for operating rooms (p ij ) are divided in three levels: higher preference, irrelevant, and undesirable, as shown below: aR if room j is of higher preference for doctor Let x ij be the binary 0/1 variable: The mathematical model of the generalized assignment problem can be written as follows (1-4): (1) Subject to: Objective function (1) maximizes the sum of doctors' preferences for operating rooms.Constraint (2) ensures that each surgery will be performed in a single operating room, and constraint (3) does not allow the total time available in each operating room to be exceeded.Constraint (4) establishes the type of variables as binary.

Phase II
In the sequencing phase there is a list of surgeries to be performed in each room that was obtained in the previous phase, and the order in which these surgeries will be performed will be set.The time available in each room is divided in three periods: earlier (beginning of the day), intermediate (middle of the day), and later (ending of the day).The doctors' preference q ij for these periods of the sequence is defined below: aP if period j is of higher preference for doctor i The scheduling is obtained by a greedy algorithm based on the sorting multi-column procedure (Miles, 2006).In contrast to the standard-sort methodology, which sort every data of the matrix using a unique column selected for sorting, the multi-column methodology assumes that each subsequent selected column is the next level of prioritization and thus further defines and refines the sorting.If doctors' preferences for periods of the sequence are the same, decision is made based on the duration of surgeries: the shortest surgeries are scheduled first.
The pseudocode below summarizes the main steps of the sequencing procedure.Firstly, a matrix M (with the solution obtained in the assignment phase) is sorted in a descending way using the column "earlier" as pivot.Then, surgeries are filtered and stored in a new partial matrix using doctors' preference q ij as criterion.This partial matrix is also sorted using surgeries' durations, and these surgeries are excluded from M. The same procedure is applied to the column "intermediate" and "later" as a pivot.Finally, all three partial matrixes are jointed in a new sorted matrix M.

EXAMPLE
To illustrate the proposed method, the following example is proposed: Five doctors have seven surgeries to be scheduled in two rooms, and there are 10 hours available in each room (600 minutes total).Table 1 presents doctor's preferences for rooms (aR = 100, bR = 50, cR = 0), doctors' preferences for periods (aP = 100, bP = 50, cP = 0) and average time for each surgery in minutes (a ij ).In Phase I, the generalized assignment model given below is solved: x C1 + x C2 = 1 x D1 + x D2 = 1 Results obtained on Microsoft Excel add-in Solver are: and the other variables are zero.Therefore, surgeries B and E will be assigned to room 1, and surgeries A, C, D, F and G will be assigned to room 2. The sum of preferences of the obtained assignment is equal to (100 + 100) + (100 + 100 + 100 + 100 + 100) = 700, which means the result meets each doctor's preferences at the maximum level possible.
In Phase II, surgeries are sequenced according to doctors' preferences for periods of the day.Figure 1 presents the numerical example solved by the sorti ng multi -column procedure for room 2. The step-by-step procedure for operati ng room 1 is not presented since only two surgeries have been assigned to this room.obtained for rooms 1 and 2 are presented in the Gantt chart shown in Figure 2. Figure 3 shows the main screen (interface) of the computati onal program (ORP) for two operati ng rooms.

ST. LYDIA HOSPITAL TEST
St. Lydia Hospital has provided 8-month data in order to create the database and perform computational tests.The number of surgeries performed by month is 216, 180, 78, 135, 172, 301, 308 and 238, respectively from January to August 2017.
The test shown below was performed on July 3 rd , 2017 (with the largest number of surgeries): We aimed to assign and schedule 21 surgeries to four operating rooms available.The model to solve the assignment problem has 21×4 = 84 binary 0/1 variables.In order to preserve data confidentiality, we do not mention types of surgeries or doctors' names in the paper.

Data
Table 2 shows St. Lydia Hospital database on July 3 rd : 21 surgeries, 8 doctors, surgery' durations, and doctors' preferences for operating rooms and for periods of the day.The St. Lydia Hospital Scheduling Team reported that: 1) Doctors' preferences for rooms are mainly related to operational aspects and the surgical equipment' position in the operating rooms.Then, doctors have to inform their preferences; 2) Surgery duration may be significantly longer or shorter, according to the doctor performing it.Then, surgery duration is provided individually for each doctor; 3) Doctors' preferences for periods may be different for each day of the week.Then, doctor' preferences for periods are provided separately.

Room preferences
There is a window in the program ORP to enter all data related to doctors, surgeries, and preferences for rooms and for times of day, which are stored on spreadsheets "Doctors", "Surgeries", "Preferences for Rooms" and "Preferences for Periods of the Day", respectively.The program displays results in a Gantt chart.If the problem is infeasible a message is presented warning the user.
The program ORP always takes less than five seconds to find results on all tests performed on St. Lydia Hospital database, on a computer with an Intel Core 2 Duo processor and 4GB of RAM.

Assignment
Results obtained on Microsoft Excel add-in Solver were: 1, and x Q4 = 1 and the other variables are zero.Therefore, surgeries H, M, N, O, P, T and U will be assigned to room 1; surgeries I, J, K, L, R and S will be assigned to room 2; surgery G will be assigned to room 3; and surgeries A, B, C, D, E, F and Q will be assigned to room 4. The sum of preferences of the assignment obtained is equal to 1900, which means the result meets each doctor's preferences as much as possible.The time available in each room was 600 minutes (10 hours), and there was only one room that presented idle time.Rooms 1, 2, 3 and 4 were assigned 600, 600, 60 and 600 minutes, respectively.

Sequencing
Sequencing is performed based on doctors' preferences for three periods of the day: earlier, intermediate, and later.In case of conflict between doctors' preferences, surgeries are sequenced according to their duration: Shorter surgeries are performed first.This decision criterion was established by the St. Lydia Hospital Scheduling Team.
Figures 4 (A-D) show Gantt charts corresponding to the solution obtained by ORP program (ORP solution).These results can be compared with the results obtained manually by the St. Lydia Hospital Scheduling Team (current solution).
Different from other contributions in the literature, Excel was used to develop the program because it is very popular and widespread software.The association between VBA language and Excel allowed presenting results in an intuitive way by Gantt chart, making the computational program very easy to use and decision making simpler.
Results obtained in computational tests performed always demanded less than five seconds.The assignment phase takes more computational time than the sequencing phase: In general, for each minute required in the assignment phase (solved by branch-and-bound technique), the sequencing phase requires only one second (solved by greedy algorithm).

CONCLUSION
In this paper we presented a two-phase method and a program to perform surgery scheduling for operating rooms in a hospital.The method consists of the following phases: (I) Assignment and (II) Sequencing.
In the Assignment phase a mathematical model in binary variables 0/1 based on the generalized assignment model was proposed to assign surgeries to operating rooms in a hospital.The model was solved by branch-and-bound technique in order to obtain the optimal solution for the problem and thus ensure the best possible use of the operating rooms.
In the Sequencing phase surgeries are scheduled in the rooms according to doctors' preferences for time of day: earlier, intermediate, and later.The procedure is greedy, using sorting prioritization.The result of the sequencing phase is presented on a Gantt chart, in which each bar is associated with one operating room.The duration of the surgery in operating rooms is given by its length in the bar on the Gantt chart.
The main contributions of this research are: (i) proposition of an original model for solving the assignment problem based on the classical model of generalized assignment; (ii) decomposition of the problem resolution in two phases: assignment and sequencing, which allows solving sub problems of reduced size in a very reasonable time; (iii) development of an Excel program, one of the most popular software in the history of computing.
The proposed method for surgery scheduling in operating rooms was tested at St. Lydia Hospital, Brazil.The hospital has provided us with data from an 8-month scheduling period for the operating rooms.The results obtained with the aid of the program have decreased, in average, by one (even

Table 1 .
Doctors' preference for operating rooms