© j. christopher beck 20051 lecture 17: introduction to timetabling

19
© J. Christopher Beck 2005 1 Lecture 17: Introduction to Timetabling

Upload: dale-doyle

Post on 14-Jan-2016

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 1

Lecture 17: Introduction to Timetabling

Page 2: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 2

Outline Introduction to Timetabling

UC Berkeley Classroom Assignment Reservations without Slack

Example 9.2.1 IP formulation Algorithm 9.2.2

Page 3: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 3

Classroom Timetabling

UC Berkeley 30,000 students, 80 depts, 4000 classes,

250 rooms 3 schedulers and 1 supervisor

For each section of each course, the departments supply Estimated enrollment Requested meeting time Special requirements (e.g., A/V equipment)

Page 4: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 4

Develop an Objective

Some obvious components One class at a time in a given room,

for a given prof, for a given student Usually minimize the number of students

who can’t take the courses they want Room should be big enough Special equipment should be present

Page 5: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 5

Develop an Objective

Some non-obvious components Profs want rooms close to their offices Students want consecutive classes to

be close together Profs get one day with no classes (Departments want classes in rooms

they “own”) (Everyone wants no classes on Friday)

Page 6: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 6

Develop an Objective

How do you balance the components? Is a room within 100 m of a

prof’s office worth not being able to accommodate all students?

“You can have a Friday afternoon class with A/V equipment or a Friday morning class without.”

Page 7: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 7

Berkeley Guidelines

Standard “calendar” 9-hour day, starting at 8

AM 9 1-hour blocks overlap

with 6 1.5-hour blocks “Prime time” blocks

One dept can only request 60% of its classes during prime time

Page 8: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 8

Berkeley Solution

Large IP 0.5M variables, 30K constraints Very high penalty for not scheduling a

class at all Other objective components: distance,

over-utilized facilities, empty seats Solved heuristically

See Alg. 9.6.1, p 222You should understand

Alg 9.6.1

Page 9: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 9

ReservationSystems Hotel rooms, car rentals,

airline tickets (andclassroom 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

Page 10: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 10

Objectives

Maximize $$ Maximize resource usage Minimize number of rejected

requests Minimize $$ of rejected requests

Page 11: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 11

Objectives

Page 12: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 12

Reservations without Slack

n activities, m resources All activities and resources are

independent pj = dj – rj

Activities have weight wj or wij

May have resource subsets You don’t want to rent any car, you want

to rent an SUV Some substitutability of resources

Weight is often

equivalentto profit

Page 13: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 13

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

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

Yield management

Page 14: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 14

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

Page 15: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 15

IP Formulation

Htnix

njx

xw

tJjij

m

iij

m

i

n

jijij

,...,1,,...,1,1

,...,1,11

1 1

maximize

Every activity is assigned toat most one resource

Does not representedresource subsets!

Each resource hasonly one activity

per time slot

Page 16: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 16

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

Page 17: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 17

Alg 9.2.2

Order activities in ascending order of release date

Let J be the set of already scheduled activities

Step 1: J = {}, j = 1

Page 18: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 18

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.

Page 19: © J. Christopher Beck 20051 Lecture 17: Introduction to Timetabling

© J. Christopher Beck 2005 19

Exercise 9.1:3 resources, 0 slack

activities

1 2 3 4 5 6 7 8 9 10

rj 2 7 5 2 1 0 4 8 0 0

dj 8 8 9 4 4 3 10

10

1 3

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?