Cyclic Nurse Scheduling
Cyclic Nurse Scheduling
North-Holland
Abstract: This paper presents an algorithm for scheduling nurses in a hospital. The resulting schedules are
cyclic and optimal. The advantage of this algorithm is that it can be implemented easily on a microcom-
puter.
Since virtually all labour restrictions concern from further consideration. Similarly any schedule
weekly schedules it is usually most convenient to that cannot be a second week of a two week
use 7-tuples. Allowing Monday to be the first day pattern is also eliminated. This second process of
of the week and Sunday the last, the 7-tuple elimination schedules is called dynamic elimina-
1100111 would represent a schedule where a nurse tion.
works Monday, Tuesday, Friday, Saturday, and A formalization of dynamic elimination proce-
Sunday. There is of course a total of 2’ or 128 dure is given as follows:
possible weekly schedules. Step I. Construct an s by s matrix where s is the
These n-day schedules then go through a number of schedules that survive static elimina-
screening process called static elimination. In static tion. A ‘1’ in the (i, j)-th entry indicates that
elimination, all n-day schedules are eliminated schedule i in the first week and schedule j in the
which violate any of the labour constraints. Typi- second week is a valid work pattern. A ‘0’ would
cal constraints are: a minimum and maximum indicate that it is not. This is accomplished by
number of consecutive work days, a minimum testing the following conditions (a-f) for each
number of consecutive days off, a minimum and entry (i, j) and inserting a ‘1’ if all the conditions
maximum number of days worked per scheduling are true and a ‘0’ if at least one condition is false:
period, the number of weeks in the scheduling (a) The sum of the consecutive work days at
period, the number of weekends off per scheduling the end of the first week and the consecutive work
period and whether or not split weekends are days from the start of the second week, should be
allowed (working Saturday and having Sunday less than, or equal to, the maximum required work
off, or vice versa). As an example consider a fairly stretch.
typical contract with the following restrictions: (b) Similarly the same sum, from (a) above,
1. The planning period is 2 weeks should be greater or equal to, the minimum re-
2. Nurses are required to work exactly 10 days quired work stretch.
in each period. (c) The sum of consecutive days off from the
3. Consecutive work days must not exceed 6 end of the first week, and the consecutive days off
days. from the start of the second week, should be
4. Consecutive work days must not be less than greater than, or equal to, the minimum required
3 days. days off.
5. Split weekends are not allowed. (d) The total work days in the first week, plus
6. One out of weekends must be off. the total work days in the second week, should be
7. The are no restrictions on the number of less than, or equal to, the maximum required work
consecutive days off (the minimum number of days per period.
consecutive days off is therefore 1). (e) Similarly this same sum, from (d) above,
With these restrictions only the following 22 of the should be greater than, or equal to the minimum
128 schedules are eligible: required work days per period.
(f) Either the first week provides a weekend
1110000 0111000 1111000 0011100 off, while the second does not, or vice versa.
1011100 0111100 1111100 1000011 Step 2. Examine each row of the filled matrix. If a
1100011 1110011 0111011 1111011 row does not contain at least one ‘l’, eliminate
0000111 1000111 1100111 1110111
that row and its corresponding column, thereby
0001111 1001111 1101111 0011111
1011111 0111111 removing that schedule from the possible list of
schedules.
However, not all of these one week schedules Step 3. Examine each row of the filled matrix. If a
can be part of a cyclic work pattern. Consider the column does not contain at least one ‘1’ eliminate
schedule 1110000. Note that any two week work that column and its corresponding row; thereby
pattern that begins with schedule 1110000 and removing the schedule from the possible list of
continues with any of the 22 schedules again, solutions.
would violate at least one of the restrictions of the Step 4. Repeat steps 2 and 3 until all rows and
collective agreement. Since schedule 1110000 can- columns contain at least one ‘1’.
not be part of a cyclic work pattern, it is eliminated The resulting matrix A = (aij) is an incidence
E.S. Rosenbloont, N. F. Goerrzen / Cyclic nurse scheduling 21
1 J
011000
001000
schedules each day. The surplus is defined for
each day to be the number of nurses actually
scheduled less the minimum requirement. This
Stage 2 maximum surplus Y is given by:
In this stage the incidence matrix A, and the
minimum daily requirements are used to for- i-l
gSik(J&)-Rk
I (k=1,...,7).
mulate an integer linear program. For each ‘1’ in (3)
22 ES. Rosenbloom, N. F. Goertzetl / Cyclic nurse schedulitrg
The resulting linear program will therefore be: 2 nurses work 0111100 --f 1110111 + repeat
schedule 3 schedule 5
min Y,
2 nurses work 1111011 + 1011100 + repeat
subject to schedule 4 schedule 2
m Inl \ 2 nurses work 1110111 + 0111100 -+ repeat
(k=1,...,7), schedule 5 schedule 3
gorithm was first implemented on a 8 bit, 64 K to complete. The original implementation was done
computer. in BASIC with subsequent development in PASCAL.
There were two difficult steps which a com- Another advantage of the algorithm was its
puter was able to simplify. The first required inherent flexibility. The schedules for a ward can
specialized programs to be written while the sec- be generated under any labour restrictions. This
ond was merely the solution of the integer linear allows both the hospital administration and the
program. Since the generation of the original 128 nurses to consider the effect of various labour
schedules demonstrates some fairly basic string constraints on the quality of the schedules.
constructions, it was the first program written. By
supplying the number of days in a schedule, all
possible work patterns would be produced and References
loaded into an array. Then, by making measures
of all the schedules and comparing these to the PI Baker, K.R., “Scheduling a full-time workforce to meet
problem restrictions, many rows (schedules) could cyclic staffing requirements”, MuItugemefrr Science 20
(1974) 1561-1575.
be removed (static elimination). Once static
PI Bums, R.N., “Manpower scheduling with variable de-
elimination was complete, another square array mands and alternate weekends off”, INFOR 16 (1978)
was constructed and then dynamic elimination 101-111.
was carried out by concatenating pairs of sched- [31 Orlin, J.B., Bartholdi, J.J., and Ratliff, D.H., “Cyclic
ules, measuring certain features of the combined scheduling via integer programs with circular ones”, Oper-
ations Research 28 (1980) 1074-1085.
pattern, and finally deciding whether or not to
141 Smith, L.D., “The application of an interactive algorithm
allow that particular matching. After perhaps to develop cyclical rotational schedules for nursing person-
hundreds of hypothetical matchings and subse- nel”, INFOR 14 (1976) 53-70.
quent acceptance or rejection, the remaining array (51 Warner, D.M., “Scheduling nursing personnel according to
would consist only of ones or zero. This array nursing preferences: A mathematical programming ap-
proach”, Opercifions Research 24 (1976) 842-856.
represents the incidence matrix.
161Warner, D.M., and Pmwda, J., “A mathematical program-
In spite of the description, actual execution of ming model for scheduling nursing personnel in a hospital”,
this program typically requires less than a minute Munagenrenr Science 19 (1972) 411-422.