Workforce Scheduling 1. Days-Off Scheduling 2. Shift Scheduling 3. Cyclic Staffing Problem (& extensions) 4. Crew Scheduling Operational Research & Management Operations Scheduling Topic 1 Days-Off Scheduling Not Off-Days Scheduling: “Scheduling workers who fall asleep on the job is not easy.” Operational Research & Management Operations Scheduling Days-Off Scheduling Number of workers assigned to each day Fixed size of workforce Problem: find minimum number of employees to cover a weeks operation Operational Research & Management Operations Scheduling 3 Constraints Demand per day nj, j = 1,2,…,7 k1 out of every k2 weekends (day 1 & 7) off Work 5 out of 7 days Work no more than 6 consecutive days Operational Research & Management Operations Scheduling 4 Optimal Schedule Algorithm for one week Repeat for next week Cyclic schedule when repeat Operational Research & Management Operations Scheduling 5 Lower Bounds on Minimum Workforce W Weekend constraint k2 max n1 , n7 W B1 k2 k1 1 7 W n j B2 5 j 1 Total demand constraint Maximum daily demand constraint Operational Research & Management W max n1 , n2 ,..., n7 B3 Operations Scheduling 6 Optimal Schedule Define W max B1 , B2 , B3 n max n1 , n7 W n j uj n nj Surplus when all workers present First schedule weekends off (cyclic) 7 j 2,...,6 j 1,7 Work both days! Furthermore, u j 1 j 2n Idea: Give W workers 2n days off during the week Operational Research & Management Operations Scheduling 7 Algorithm Schedule weekends off Determine additional off days (in pairs) Categorize employees Assign off-day pairs Operational Research & Management Operations Scheduling 8 Example - analysis Data n(j) Sun Mon Tues Wed Thu 1 0 3 3 3 Fri 3 Sat 2 Bounds: – – – max(n1,...,n7) = 3, then 1 7 15 n j 3 , so 5 j1 5 W >= 3 W >= 3 3 x 2 3 n = max(n1, n7) = 2, k1 = 1 and k2 = 3, so W 2 Operational Research & Management Operations Scheduling 9 Example - solution Weekends off (one worker per weekend) week 1 S S M X X X X X X 1 2 3 T W T T W T F week 3 S S M X X X X X X T W T F week 4 S S M X X X X X X T W T F Calculate 2n surplus days (in pairs) surplus F week 2 S S M X X X X X X Sun Mon Tues Wed Thu 1 3 0 0 0 Fri 0 Sat 0 (Sun, Mon) and (Mon, Mon) Weekly: assign pairs to worker (or to pair of workers) Operational Research & Management Week 1 1: off / on 2: on / off 3: on / on 1 1 2 Operations Scheduling 10 Topic 2 Shift Scheduling Operational Research & Management Operations Scheduling Shift Scheduling Fixed cycle of length m periods Have bi people assigned to ith period Have n shift patterns: Cost cj of assigning a person to shift j Integer decision variable: xj = # people assigned to j min s.t. n j 1 n (a1 j , a2 j ,..., amj ) cj xj a x j bi i 1 ij xj 0 Operational Research & Management min cx Ax b x0 Operations Scheduling 12 Solution NP-hard in general Special structure in shift pattern matrix Solve LP relaxation – Solution always integer when each column contains a contiguous set of ones Operational Research & Management 1 1 1 1 A 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 1 1 1 1 1 1 0 0 Operations Scheduling 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 13 Topic 3 Cyclic Staffing (& extensions) Operational Research & Management Operations Scheduling Call center agents 24 23 22 1 2 60 42 110 34 21 116 4 6 130 20 3 3 #24 of agents needed 3 6 3 18 6 124 4 2 20 19 6 140 The outer ring shows the average arriving intensity at that hour. 7 5 2 24 3 6 18 The inner ring shows the number of centralists necessary for that particular arriving intensity. 6 130 6 17 4 4 110 7 58 6 16 50 102 5 5 80 5 5 100 5 15 5 5 90 96 98 72 14 9 96 10 13 Operational Research & Management 8 12 11 Operations Scheduling 15 Cyclic Staffing Problem An m-period cyclic schedule (e.g. 24 hours a day) Minimize cost Constraint bi for ith period Each worker works for k consecutive periods and is free for the next m-k Example: (5, 7)-cyclic staffing problem Operational Research & Management Operations Scheduling 16 Integer Program Formulation Shift patterns (5, 7) example: 7 different patterns 1 1 1 A 1 1 0 0 Operational Research & Management 0 0 1 1 1 1 1 0 0 1 1 1 1 1 0 0 1 1 1 1 1 0 0 1 1 1 1 1 0 0 1 1 1 1 1 0 0 1 1 1 1 1 Operations Scheduling 17 Solution Solution to LP relaxation ‘almost right’ STEP 1: Solve LP relaxation to get x1' , x '2 ,..., xn' if integer STOP; otherwise continue STEP 2: Formulate two new LPs with x1 x2 ... xn x1' x '2 ... xn' x1 x2 ... xn x1' x '2 ... xn' The best integer solution is optimal Operational Research & Management Operations Scheduling 18 Example (3,5)-cyclic staffing problem 1 1 A 1 0 0 Step 1: 0 1 1 1 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 3 4 b 6 4 7 x ' (1.5, 0, 4.5, 0, 2.5) Operational Research & Management Operations Scheduling 19 Solution Add together: 1.5 0 4.5 0 2.5 8.5 Step 2a: Add constraint: – x1 x2 x3 x4 x5 8 No feasible solution Step 2b: Add constraint: Solution: x1 x2 x3 x4 x5 9 x ( 2, 0, 4, 1, 2) Operational Research & Management Optimal Operations Scheduling 20 Extension 1: Days-Off Scheduling We can represent our days-off scheduling problem as a cyclic staffing problem as long as we can determine all the shift patterns Difficulty 1: unknown cycle length Difficulty 2: many patterns larger problem Operational Research & Management Operations Scheduling 21 Example Two days off in a week + no more than 6 consecutive workdays 0 0 1 1 1 1 1 A 1 0 1 1 1 1 0 Operational Research & Management 0 0 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 0 0 0 1 1 Operations Scheduling 22 Extension 2: Cyclic Staffing with Overtime 24-hour operation 8-hour shifts with up to 8 hour overtime 0 0\1 1 A 0\1 1 0 0 0\1 1 0 0 0 0 0 \ 1 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 3 shifts without overtime + 8 shifts with overtime Operational Research & Management Operations Scheduling 23 Topic 44 Crew Scheduling Operational Research & Management Operations Scheduling Crew Scheduling Have m jobs, say flight legs Have n feasible combination of jobs a crew is permitted to do m6 2 1 5 3 4 6 Operational Research & Management Set partitioning problem Operations Scheduling 25 Notation Cost cj of round trip j Define 1 if leg i is part of round trip j aij otherwise 0 1 if round trip j is selected xj otherwise 0 Operational Research & Management Operations Scheduling 26 Integer Program Minimize Subject to c1 x1 c2 x2 ... cn xn a11 x1 a12 x2 ... a1n xn 1 a21 x1 a22 x2 ... a2 n xn 1 am1 x1 am 2 x2 ... amn xn 1 x j 0,1 Operational Research & Management Operations Scheduling 27 Set Partitioning Constraints called partitioning equations The positive variables in a feasible solution called a partition NP-Hard Well studied like TSP, graph-coloring, bin-packing, etc. J l { j : xlj 1} Operational Research & Management Operations Scheduling 28 Row Prices Say that l ( 1l , 2l ,..., ml ) is a set of feasible row prices if for jJl m Cost of covering a job Operational Research & Management l i aij c j i 1 Operations Scheduling 29 Change Partition Let Z1 (Z2) denote the objective value of partition 1 (2) Z Z i1aij c j m Then 2 1 jJ 2 i 1 j i1aij c j m Potential savings of including column j is i 1 If all negative then optimal Operational Research & Management Operations Scheduling 30 Heuristic Start with some partition Construct a new partition as follows: – Find the column with highest potential savings – Include this column in new partition – If all jobs covered stop; otherwise repeat Operational Research & Management Operations Scheduling 31 Helpdesk (KPN) 18 employees (= 15 in DH + 3 in G) 6 required at desk (= 5 in DH + 1 in G) 5 in DH (= 2 early + 3 late shift) Wishes (soft constraints) – holiday – other duties – preference for early shif – preference for late shift determine schedule for the next 8 weeks: – that is fair – satisfies all wishes as much as possible Operational Research & Management Operations Scheduling 32 Helpdesk model Groningen bit: person i is available at day t (no holiday) rit: person i has other duties at day t xit: person i has desk duty at day t B(i,t) A B C 1 1 1 1 2 1 1 1 3 1 1 1 4 1 1 1 5 1 1 1 6 1 1 1 7 1 1 1 8 1 1 1 9 1 1 1 10 11 12 13 14 15 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 R(i,t) A B C 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 5 1 0 0 6 0 0 0 7 0 0 0 8 0 0 0 9 0 0 0 10 11 12 13 14 15 1 0 0 0 0 1 0 1 1 1 1 1 0 0 0 0 0 0 Operational Research & Management Operations Scheduling 33 Schedules that satisfy all wishes X(i,t) 1 A 1 B C 2 1 X(i,t) 1 A 1 B C 2 1 X(i,t) 1 A B 1 C 2 1 3 1 4 1 5 6 1 7 1 8 1 9 1 10 11 12 13 14 15 1 1 1 1 1 1 6 1 7 8 9 10 11 12 13 14 15 1 3 1 4 1 5 1 1 1 1 1 1 3 4 1 5 1 1 Operational Research & Management 6 1 7 8 1 1 9 1 1 1 1 1 10 11 12 13 14 15 1 1 1 1 1 1 Operations Scheduling 12 2 1 5 5 5 5 5 5 34 More wishes, more constraints X Mi i All have same number of desk duties May conflict with other wishes, e.g. request for duty free days Holidays may not lead to relatively more desk duties t Bit Mi i t Bit t Dt t it i Desk duties evenly spaced in time Operational Research & Management Operations Scheduling 35 Helpdesk model Leidschendam bit: person i is available at day t (no holiday) rit: person i has other duties at day t wij: person i prefers shift j xijt: person i has desk duty at day t and shift j min z i t rit j X ijt i j wij t X ijt s.t. X X j i ijt ijt Bit it dj jt X ijt 0 of 1 additional constraints to create a fair schedule Operational Research & Management Operations Scheduling 36