Lecture 18: Service Scheduling & Timetabling © J. Christopher Beck 2008 1 Outline Introduction to Service Scheduling Characteristics of Service Scheduling Differences with Manufacturing UofT APSC Timetabling Reservations without Slack Example 9.2.1 IP formulation Algorithm 9.2.2 © J. Christopher Beck 2008 2 Readings P Ch 3 P Ch 9.6, 9.2 Questions I Like: 9.1, 9.2, 9.4, 9.6 © J. Christopher Beck 2008 3 Examples of Service Scheduling We will look at: Timetabling Sports Scheduling Classrooms ACC Basketball Workforce scheduling Workers in a call centre © J. Christopher Beck 2008 4 Example Classroom Scheduling Assign classes to rooms such that Rooms are big enough No two classes as in the same room at the same time No prof has to teach two classes at one time No students have to take two classes at one time © J. Christopher Beck 2008 5 Service Scheduling Characteristics: Resources Classroom, hotel, rental car, stadium, operating room, plane, ship, airport gate, dock, railroad track, person (nurse/pilot) Synchronization of resources may be important Need a plane and a pilot Classroom, AV equipment, prof, students © J. Christopher Beck 2008 6 Service Scheduling Characteristics: Resources Each resource may have its own characteristics Classroom: capacity, equipment, cost, accessibility Truck: capacity, refrigeration, speed Person: specialist (surgeon, nurse) with skills (languages) © J. Christopher Beck 2008 7 Service Scheduling Characteristics Activities may have Time windows Capacity requirements/constraints Resources may have Setup/transition time – runways! Operator/tooling requirements Workforce scheduling constraints Shift patterns, break requirements Union and safety rules © J. Christopher Beck 2008 8 Differences from Manufacturing Impossible to “store” goods Resource availability often varies If you don’t fill a hotel room you can’t “get back” the lost time May even be part of the objective function Saying “no” to a customer is common “No available seats on that flight” (even if there are some!) Beck Try2008to book a restaurant for 8 PM © J. Christopher 9 Classroom Timetabling APSC, U of T ’06-’07 4000 students, 1200 first year 7 departments, 9 degree programs 79 programs of study (programs/options and year) 219 faculty members, 12 buildings, 80 lab rooms 75% of the timetables are delivered to students conflict-free © J. Christopher Beck 2008 10 APSC Timetabling Process Data acquisition departments send data on courses, staffing, resources, enrollment limits, … time frame: months Decide roll-over strategy what can be kept from previous year? curriculum changes, staff changes, … were there problems with last year’s schedule? © J. Christopher Beck 2008 11 APSC Timetabling Process Schedule 1st year Separately for each department many shared courses but each course is “owned” by one department Usually leaves some Automated “first” schedule classes unscheduled Very iterative and mostly manual changes May be changed later (e.g., to fix a big problem in later year schedule) © J. Christopher Beck 2008 12 APSC Timetabling Process Schedule 2nd year automated schedule (with 1st year fixed) manual scheduling, rescheduling may make changed to 1st year Schedule 3rd & 4th year is similar Assign rooms Upload to ROSI © J. Christopher Beck 2008 13 APSC Timetabling Student Goals Conflict-free for 1 to 3 and for core 4th next best: minimize conflict, limit to tutorials and labs 4th year: minimize conflicts among popular courses Deliver required courses Meet student criteria © J. Christopher Beck 2008 14 APSC Timetabling Student Goals 9-5 with lunch between 12 and 2 Minimize number of gaps in a day next best: 9-6, then 9-7, lunch between 11 and 2 Existing gaps should be short Provide some study time All student groups should have equal access to resources © J. Christopher Beck 2008 15 APSC Timetabling Faculty Goals Meet staff criteria Professors should have one day per week with no teaching Conflict-free © J. Christopher Beck 2008 16 APSC Timetabling Process Data collection starts in January Schedule available in August But not completely finished until the course drop dates (i.e., mid-Sept) About 25 people involved About 3 full-time © J. Christopher Beck 2008 17 Classroom Timetabling UC Berkeley 30,000 students, 80 depts, 4000 classes, 250 rooms 3 schedulers and 1 supervisor Read about it in Ch 9.6 © J. Christopher Beck 2008 18 Reservation Systems Hotel rooms, car rentals, airline tickets (and classroom scheduling) You want to have the use of a resource for a given period of time With slack: pj < dj – rj Without slack pj = dj – rj May not be able to schedule all requests © J. Christopher Beck 2008 19 Objectives Maximize $$ Maximize resource usage Minimize number of rejected requests Minimize $$ of rejected requests © J. Christopher Beck 2008 20 Reservations without Slack n activities, m resources Weight is often equivalent to profit All activities and resources are independent pj = d j – rj Activities have weight wj or wij (see next slide) May have resource subsets You don’t want to rent any car, you want to rent an SUV Some substitutability of resources 21 © J. Christopher Beck 2008 Weights Can Get Complicated (Ex. 9.2.1) Car rental agency with 4 car types Customer j wants either a subcompact or midsize Customer k wants a subcompact but there are none left wij = (qj – ci) * pj Yield management qj is the price charged per day to customer j ci is the cost (to the rental agency) per day of a car in class i © J. Christopher Beck 2008 22 IP Formulation H slots xij: binary variable that is 1 if activity j is assigned to resource i Jt: set of activities that need a resource in slot t © J. Christopher Beck 2008 23 IP Formulation m maximize Does not represented resource subsets! n w x i 1 j 1 ij ij m xij 1, j 1,..., n i 1 x jJ t ij Every activity is assigned to at most one resource 1, i 1,..., n, t 1,..., H © J. Christopher Beck 2008 Each resource has only one activity per time slot 24 IP Formulation General problem is hard Special cases are easy All activities have duration of 1 – independent problem for each time slot See p. 209 All weights are 1, all resources in a single set, durations are arbitrary Maximize the number of scheduled activities © J. Christopher Beck 2008 25 Alg 9.2.2: Maximize # of Scheduled Activities All weights are 1, all resources in a single set, durations are arbitrary Order activities in ascending order of release date Let J be the set of already scheduled activities Step 1: J = {}, j = 1 © J. Christopher Beck 2008 26 Alg 9.2.2 Step 2: If a resource is available at rj, assign it to activity j, add activity j to J, and goto 4. Step 3: Let j* in J with max. completion time. If Cj > Cj*, then don’t schedule j. Else replace j* with j in J Step 4: If j = n, STOP. Else j = j +1 and goto Step 2. © J. Christopher Beck 2008 27 Exercise 9.1: 3 resources, 0 slack Use Alg 9.2.2 to find max # activities Find schedule that maximizes sum of durations of activities scheduled What is the minimum number of resources needed to do all activities? activities rj dj © J. Christopher Beck 2008 1 2 8 2 7 8 3 5 9 4 2 4 5 1 4 6 7 8 0 4 8 3 10 10 9 10 0 0 1 3 28