Theory and practice of the shift design problem WOLFGANG SLANY Institut f¨ ur Informationssysteme Technische Universit¨at Wien Favoritenstr. 9–11, A-1040 Wien AUSTRIA wsi@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/staff/slany/ Abstract: Generating high-quality schedules for a rotating workforce is a critical task in all situations where a certain staffing level must be guaranteed, such as in industrial plants, hospitals, or airline companies. Shift scheduling comprises several problems, one of primordial importance being the shift design problem which is concerned with finding optimal starting times and lengths of shifts. This problem presents an interesting challenge both from practical as well as theoretical points of view. We describe our results in both areas, stressing in particular how our quest for complexity results lead to improved practical algorithms which are now part of a successful commercial package. In the shift design problem we are given a col- lection of shift templates and workforce require- ments for a certain cycle time (usually one week). We look for an optimal selection of the shift tem- plates together with an optimal assignment of workers to these shifts such that the overall devi- ation from the requirements is small, with a num- ber of additional constraints: The shift templates are potential shifts under legal, ergonomic, and operating constraints. Over- and underhead can be differently weighted. The number of selected shifts should be small. Workers should come to work 4–5 times per week on average. Some other constraints varying from case to case, e.g. there should be little variation in the selection of shifts between weekdays. Example: Shift templates = all possible shifts (typical temporal resolution: 15 minutes). Example: Workforce requirements: How many persons should ideally be present at each time of the week. Characteristics of the solution of Table 3: Number of shifts used: 5 (out of the 384) Underhead: each day from 10h–11h 2 work- ers Overhead: Wednesday 9h–10h 2 workers Average number of times workers have to commute per week: 4 (assuming 21 workers will work for 40h/week) Another solution, found with a very fast min cost max flow algorithm: 2 worker-hours less, but the solution features a total of 18 shifts to achieve this better fitting of the requirements. It is possible to model the shift design prob- lem as a network flow problem, namely as the cyclic multi-commodity capacitated fixed-charge min cost max flow problem (following ideas from [1]). Basic idea: A matrix A with consecutive ones property (in the columns, corresponding to shift tem- plates). A vector b of positive integers (corresponds to workforce requirements). E.g., A = 1 1 1 0 0 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 1 0 1 , b = (2, 3, 5, 4, 2, 1)