Optimizing Staff Scheduling by Monte-Carlo Simulation D. Scipione F. Sullivan V. Zavadsky T. Betlach X. Dong C. Coker L. Scipione J. Scipione J. Cook

Acme Express Inc, Cleveland, OH P. Scipione, Department of Anesthesiology Mercy Medical Center, Redding, CA R. C. Cork, Department of Anesthesiology, University of Arizona Health Sciences Center, Tucson, AZ by DOCS, we present in Table 1 an example comprising a group of five staff who must cover a single task every day for a thirty day scheduling penod. (Here, for simplicity, we ignore the daytype dimension, and assume that all days of the thirty day period are the same daytype.) Column 1 identifies the staff (A, B, C, D, E). Column 2 shows the relative obligation of each staffer: B, C and E have twice the obligation of A and D. Column 3 shows the work requirement (debit) in days; this is calculated by multiplying each staffer's relative obligation by the total number of days to be scheduled (30) and

ABSTRACT DOCS is a computer program which generates the staff schedule. An accounting framework is combined with an optimization technique that searchesfor a schedule in which all accounts are simultaneously in balance. The search is accomplished using a Monte-Carlo process which shuffles staff within the schedule. The shuffling is biased according to each staffer's account balance: the staffer who owes the most is most likely to be scheduled.

THE PROBLEM Staff scheduling is arduous and time consuming. The scheduler must: assign staff according to their relative obligations; apply often intricate rotation rules; distribute the burden of premium daytypes such as weekends and holidays; satisfy on/off requests; and provide an adequate accounting report.

_

THE SOLUTION Doctors On-Call Schedule (DOCS) is a computer program which generates and optimizes the staff on-call and daily duty schedule. [1J DOCS is built around a framework of rigorous accounting principles. A ledger of accounts is created with one account for each staffer/ task/daytype combination. Every month, each account is assigned a debit according to the staffer's work requirement and receives a credit for days worked. The account balance, equal to debit minus credit, measures the amount of work owed by each staffer to each task for each daytype. A positive balance means a staffer has not worked enough days to fulfill his work requirement, while a negative balance means a staffer has worked more than enough days. The account balance is carried over from month to month, so that the ending balance for the prior month is the beginning balance for the next month. In order to illustrate the accounting framework used 0195-4210/92/$5.00 ©1993 AMIA, Inc.

678

3

4

MOVRK

DAYS WORKED

2

RBQUREMQr

5

(DEBMf)

(CREDrl)

ACCOUNT BALANCE

1.00

1 x 30/8

4

-0.25

B

2.00

2 x 30/8 =7.50

8

-0.50

C

2.00

2 x 30/8 =7.50

7

0.50

D

1.00

1 x 30/8 =3.75

4

-0.25

E

2.00

2 x

=7.50

30/8

7

0.50

T'OTAL

8.00

30

30

0.00

STAIT

RELATIVE OBUGATION

A

=3.75

Table 1. Illustration of the accounting framework used by DOCS for a simple example consisting of a group offive staff who must cover a single task every day for a single 30-day month.

tasks to form a new schedule. The new schedule is accepted and replaces the old one if it is better (i.e., if its objective function is smaller). Otherwise, it is rejected. This simple procedure is repeated for a large number of iterations, the objective function decreasing each time a new schedule is accepted, until an optimal or nearoptimal schedule is found. The initial schedule which serves as starting point for the Monte-Carlo process is generated as shown in Figure 2. The schedule is filled one day at a time, first scheduling all weekends (selected at random), then randomly filling in the weekdays.

dividing by the total relative obligation (8). Column 4 shows the numberof days actually worked (credit) during the month. Column 5 shows the month-end account balance, equal to debit minus credit (Column 3 minus Column 4). The individual account balances total to zero, as they must. This accounting framework is combined with an optimization procedure that attempts to find a schedule for which all accounts are simultaneously in balance. This is done by searching for a schedule which minimizes an objective function, defined as the sum over all individual accounts (i.e. over all staffer/task/daytype combinations) of the magnitudes of the individual account balances, divided by the number of accounts. This function has a minimumpossible value of zero, attainable if all of the individual accounts are exactly in balance. It is greater than zero if any of the individual accounts are out of balance, becoming more positive as the individual accounts get more out ofbalance. The objective function is also equal to the average number of days by which the individual staffer/task/daytype accounts are out of balance. The value of the objective function for the example of Table 1 is: (0.25 + 0.50 + 0.50 + 0.25 + 0.50) /5 = .40. In general, the objective function will always be greater than zero, because work requirement is most often in fractional days whereas work performed is in whole number of days. DOCS searches for a schedule which minimizes the objective function by employing a Monte-Carlo technique as illustrated in Figure 1. The Monte-Carlo process begins with an initial (non-optimal) schedule which is perturbed by randomly moving staff among

Figure 1. 7he Monte-Carlo process.

Figure 2. Cetion of the initial sdedue. Weekens are scheduledfirst, thae weekdas.

Figure 3 shows how a day's tasks are assigned. Tasks are selected for scheduling in order of a userdefined task priority which ensures that the most important tasks get scheduled when staff is sparse. Available staff are scheduled for a particular task on a probabilistic basis according to the account balance, i.e. according to the amount of work each staffer owes to the task for the particular daytype in question. Here the term "available" means that assigning the staffer will not violate any of a number of user-defined rules and constraints. These rules and constraints fall into the following four classes: (1) ON/OFF requests. (2) Rotation Rules: certain tasks must be assigned together while certain other tasks must never be assigned together. For example, staff assigned to First Call may not take Call on consecutive days, except on the weekends, when First Call Saturday does Second Call Sunday; or, staff

679

assigned to the ICU must work there for an entire week, but not for two consecutive weeks. (3) Expertise Groups: certain tasks may be assigned only to staffwith particular areas of expertise; or, at least one of the staff assigned to a group of tasks must be qualified in a certain area of expertise. (4) Same Day Assignments: certain tasks may be assigned to a staffer who is responsible for other

Figure 3. Sdiedule al tasklfor theday. Each day's talks are schduled in a prioritized onrer.

simultaneous tasks; or, a morning task may be combined with an afternoon task. The probabilistic method of task assignment is the fairest method, in our opinion. With this method, the staffer who owes the most is most likely to be scheduled, the staffer who owes the least is least likely to be scheduled, and staffwho owe equal amounts of work are equally likely to be scheduled. We have found that the initial schedule generated as described in the proceeding paragraph is reasonably good. It will not, however, be optimal, because the procedure used to generate it considers each day and task separately, in isolation from other

days and tasks. The Monte-Carlo process remedies this deficiency, generally achieving a significant improvement over the initial schedule. The schedule is repeatedly perturbed dunrng many iterations of the Monte-Carlo process. A day is randomly selected. The current assignments for the day are temporarily removed and new assignments are generated by the procedure of Figure 3. The new assignments are different because of the probabilistic nature of making assignments and because the account balances have changed since the time the assignments were last made. If the objective function improves, the new assignments are accepted. Thus, the algorithm tends to replace staff assignments for accounts which are most out of balance. At the same time, because of its probabilistic character, the algorithm samples the set of all possible replacements; this broadens the search and prevents it from becoming too narrowly focused at an early stage. Under the action of the Monte-Carlo process, the schedule continually evolves in the direction of a decreasing value of the objective function; that is, the accounts come more and more into balance. The process is halted when convergence is reached, i.e., when the objective function stops decreasing.

EVALUATION OF PERFORMANCE Figure 4 demonstrates the performance of a DOCS installation for a medical group of 22 staff and 18 tasks. The figure corresponds to the generation of a thirty day schedule by DOCS, running on a 20 MHz IBM PS/2 Model 80. It shows the dependence of the objective function on elapsed time in the computer run. The leftmost point on the curve corresponds to the initial schedule and shows that DOCS took 28 seconds to generate the initial schedule. The rest of the curve shows how the objective function evolves toward a minimum value as the Monte-Carlo process unfolds. The value of the objective function for the initial schedule is 0.63, which means that the average account is out of balance by 0.63 days. The asymptotic value of the objective function is the value after which the objective function no longer changes with additional iterations of the Monte-Carlo process. It is equal to 0.41 in the example of Figure 4 and is approached increasingly slowly as time progresses, being finally reached after approximately 175 seconds. We identify this asymptotic value as the optimum value, based on our experience with simple examples in which the optimum can be found by exhaustive enumeration of all possible schedules. Note that the objective function reaches a value within ten percent of optimum after 78 seconds. This point serves as a convenient fiduciary point for measuring the optimization time of the Monte-Carlo process.

680

Initial Schedule

.63

I.

c

I.

v .45

.4 1 O

while the straight line is a best fit in the sense of least squares. It is apparent that optimization time is a roughly linear function of complexity. This result is of interest because it indicates that optimization time does not increase catastrophically (e.g. exponentially) with increasing complexity.

DISCUSSION

_

X>

10 %Above Optimum

-I

--=1_

*

o

|

Optimum

78

28

Elapsed Time (sec) Figure 4. DOCS objectivefunction versus elapsed time for a group of twenty-two staff and eighteen tasks.

The general features of this example are typical: (1) DOCS optimization time is short--only a few minutes. (2) The initial schedule is reasonably good, thereby validating the procedure used to generate it. (3) The Monte-Carlo process yields a substantial improvement over the initial schedule, achieving a final schedule which we believe to be optimal in the sense that it minimizes the objective function, i.e., the average amount by which the accounts are out of balance. Figure 5 shows how optimization time (the time required to achieve an objective function within 10% of optimum) varies with the complexity of the problem. Complexity, in the present context, is measured by the number of staff times the number of tasks. Each point in the figure corresponds to an actual DOCS installation,

The two-stage algorithm employed by DOCS is well-suited for scheduling medical staff and indeed appears always to find a schedule that is optimal or nearly optimal in the sense that it minimizes our objective function. The first stage of the algorithm -- generation of the "initial" schedule -- is essentially the same sort of procedure that a rational human scheduler might use, but executed at computer speed, rather than at paper-andpencil speed. It does not, however, produce an optimal schedule, because it does not consider the entire scheduling period and the entire collection of tasks as a whole. The second stage of the algorithm remedies this deficiency. It is an iterative Monte-Carlo search in which staff are randomly moved among tasks until an optimal schedule is found. Both stages ofthe algorithm automatically reject schedules which violate any of a wide variety of user-specified rules and constraints. Originally developed for an academic anesthesia department, DOCS is now used by hospitals and private practice groups for a wide range of specialties including radiology, ambulatory surgery, orthopedics and internal medicine. DOCS can schedule multiple "departments", each with a maximum capacity of forty-five staff and twenty-seven tasks. The package runs on any IBM AT or PS/2 or compatible computer with 640KB of RAM and a hard disk, and any Macintosh computer running the PC emulation software package 'SoftPC."

References 1. P. Scipione, D. Scipione, R. Cork, T. Betlach, Doctors On Call Schedule (DOCS), Scientific Exhibit, American Society of Anesthesiologists Annual Meeting, 1988.

200

0

e

100

0

500

1000

Complexity (staff-tasks) Figure 5. DOCS optimization time as a function of complexity of the scheduling problem.

681

Optimizing staff scheduling by Monte-Carlo simulation.

DOCS is a computer program which generates the staff schedule. An accounting framework is combined with an optimization technique that searches for a ...
556KB Sizes 0 Downloads 0 Views