Automated University Timetabling
Author:
Alexandre Pinto
Summary
Outline
• Introduction
• Problem Formulation
• State of the Art
• Architecture
• Timetabling Algorithm
Automated University Timetabling Alexandre Pinto 2
Introduction - What is Timetabling?
Scheduling of:
• a set of teachers
• a set of classes
Placing them in:
• a timeslot from a set of timeslots
• a room from a set of rooms
Subject to:
• Unary/Binary constraints
• Capacity constraints
• Event spread constraints
• Agent constraints
Automated University Timetabling Alexandre Pinto 3
Introduction - What is Timetabling?
Scheduling of:
• a set of teachers
• a set of classes
Placing them in:
• a timeslot from a set of timeslots
• a room from a set of rooms
Subject to:
• Unary/Binary constraints
• Capacity constraints
• Event spread constraints
• Agent constraints
Automated University Timetabling Alexandre Pinto 3
Introduction - What is Timetabling?
Scheduling of:
• a set of teachers
• a set of classes
Placing them in:
• a timeslot from a set of timeslots
• a room from a set of rooms
Subject to:
• Unary/Binary constraints
• Capacity constraints
• Event spread constraints
• Agent constraints
Automated University Timetabling Alexandre Pinto 3
Introduction - An example
08:00 - 09:00
09:00 - 10:00
10:00 - 11:00
11:00 - 12:00
12:00 - 13:00
13:00 - 14:00
14:00 - 15:00
15:00 - 16:00
16:00 - 17:00
17:00 - 18:00
18:00 - 19:00
19:00 - 20:00
Monday Tuesday Wednesday Thursday Friday
u
u
u
u
COMP (PL3)
P. Correia G.4.3
u
u
u
u
COMP (T1)
C. Fonseca B1
u
u
u
u
COMP (TP1)
L. Macedo B2
u
u
u
u
C.G (T1)
J. Henriques B1
u
u
u
u
C.G (TP1)
J. Henriques B1
u
u
u
u
C.G (PL4)
J. Arrais G.4.3
u
u
u
u
I.S (T1)
P. Cunha Anf. A
u
u
u
u
I.S (TP1)
P. Cunha C.5.2
u
u
u
u
A.P.L. (PL1)
L. Paquete E.4.5
u
u
u
u
A.P.L. (T1)
L. Paquete B1
u
u
u
u
I.A.I. (T1)
F. Machado Anf. A
u
u
u
u
I.A.I. (TP1)
F. Machado BAnf. A
u
u
u
u
I.A.I. (PL1)
F. Machado E.4.5
Figure: An example timetable
Automated University Timetabling Alexandre Pinto 4
Problem Formulation - Fundamental Concepts
Concepts:
• Class - A class is an event that gathers a set of students
having the same subject at the same time.
• Event - An event is the basic unit to be scheduled.
Automated University Timetabling Alexandre Pinto 5
Problem Formulation - Fundamental Concepts
Concepts:
• Class - A class is an event that gathers a set of students
having the same subject at the same time.
• Event - An event is the basic unit to be scheduled.
Automated University Timetabling Alexandre Pinto 5
Problem Formulation - Fundamental Concepts
Concepts:
• Hard Constraint - A rule that must be respected.
• Soft Constraint - A rule that should be respected as much as
possible.
• Feasible Timetable - A timetable is considered feasible when
all events are scheduled and no hard constraint is violated.
Automated University Timetabling Alexandre Pinto 6
Problem Formulation - Fundamental Concepts
Concepts:
• Hard Constraint - A rule that must be respected.
• Soft Constraint - A rule that should be respected as much as
possible.
• Feasible Timetable - A timetable is considered feasible when
all events are scheduled and no hard constraint is violated.
Automated University Timetabling Alexandre Pinto 6
Problem Formulation - Fundamental Concepts
Concepts:
• Hard Constraint - A rule that must be respected.
• Soft Constraint - A rule that should be respected as much as
possible.
• Feasible Timetable - A timetable is considered feasible when
all events are scheduled and no hard constraint is violated.
Automated University Timetabling Alexandre Pinto 6
Problem Formulation - Fundamental Concepts
Three main categories:
Figure: The University Curricular Structure in Portugal
Automated University Timetabling Alexandre Pinto 7
Problem Formulation - Fundamental Concepts
Figure: University Curricular Structure
Class-teacher problem!
Automated University Timetabling Alexandre Pinto 8
State of the Art - Scientific View
Figure: Techniques Applied to the University Timetabling Problem
Automated University Timetabling Alexandre Pinto 9
State of the Art - Scientific View
One-Stage Optimization
Algorithms
Figure: One stage algorithms
Automated University Timetabling Alexandre Pinto 10
State of the Art - Scientific View
Two-Stage Optimization
Algorithms
Figure: Two stage algorithms
Automated University Timetabling Alexandre Pinto 11
State of the Art - Technological View
XXXXXXXXXXXFeature
System
Leeds Purdue Bullet THOR
Distributed
Timetabling
On-line
Timetabling Diamant
Timetabling
Engine
Persistent Database        
User Interface        
Solver        
Interactive Changes        
Input Validation        
Flexibility in Preferences        
Distinction of Roles        
Table: Summary of the features of commercial/non-commercial solutions
Automated University Timetabling Alexandre Pinto 12
Architecture - Evaluation Function
One of the main operations of the timetabling algorithms is to
check constraint violations.
There are two ways of analyzing violations:
• Check entire solution - The solution is analyzed considering all
of the events, i.e, the entire solution.
• Check only the differences - Applicable to the computation of
the difference between an old solution and a new one.
Automated University Timetabling Alexandre Pinto 13
Architecture - Evaluation Function
One of the main operations of the timetabling algorithms is to
check constraint violations.
There are two ways of analyzing violations:
• Check entire solution - The solution is analyzed considering all
of the events, i.e, the entire solution.
• Check only the differences - Applicable to the computation of
the difference between an old solution and a new one.
Automated University Timetabling Alexandre Pinto 13
Architecture - Evaluation Function
One of the main operations of the timetabling algorithms is to
check constraint violations.
There are two ways of analyzing violations:
• Check entire solution - The solution is analyzed considering all
of the events, i.e, the entire solution.
• Check only the differences - Applicable to the computation of
the difference between an old solution and a new one.
Automated University Timetabling Alexandre Pinto 13
Architecture - Evaluation Function
f (s) =
SC
i=1
wi (s) · Ci (s)
Figure: s - A solution in the search space
Ci - Number of times that the constraint is violated
wi - Weight of the constraint
SC - Number of soft constraints
The objective of the search algorithm will be to find a solution s
that minimizes the value of f (s).
Automated University Timetabling Alexandre Pinto 14
Architecture - Main Data Structure
Rooms
Timeslots
0
1
2
3
4
5
6
7
8 8
9
10
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
0
1
2
3
4
5
6
7
8
9
Figure: Solution representation
Automated University Timetabling Alexandre Pinto 15
Architecture - Complexity Analysis
Constraint - Order of typologies
must/should be respected
Worst-Case Analysis
Entire Solution Incremental Approach
O(P · E) O(E)
Table: P - Number of teachers, E -
Number of events
2 5 /
3 7 11 10 /
1 4 /
6 9 8 /
2 5 1 /
1
2
3
4
5
Figure: Current order of teacher
events
Automated University Timetabling Alexandre Pinto 16
Architecture - Complexity Analysis
Constraint - All distances
between events must be
respected
Worst-Case Analysis
Entire Solution Incremental Approach
O(E2) O(E)
Table: E - Number of events
Events
Events
2
2
5
5
4
4
3
3
0 1 2 3 4 5 6 7 8 9
0
1
2
3
4
5
6
7
8
9
Figure: Distance matrix
Automated University Timetabling Alexandre Pinto 17
Architecture - Complexity Analysis
Constraint - Events in the last
slot of the day should be avoided
Worst-Case Analysis
Entire Solution Incremental Approach
O(D · PC) O(E)
Table: D - Number of days, PC -
Number of curricular plans, E -
Number of events
Figure: Generic structure to keep
track of events
Automated University Timetabling Alexandre Pinto 18
Timetabling algorithm - A possibility
First phase - Feasibility achieved
through a constructive heuristic
Questions to be solved:
• How to choose the next
event?
• How to choose the time slot
and the room?
• How to deal with unassigned
events with no feasible
place?
Rooms
Timeslots
0 0 0 0
1 1 1 1
2 2 2
3 3 3 3
4 4 4
5 5 5 5
6 6 6 6
7 7 7
8 8 8
9 9 9 10 10 10 10
11 11 11
12 12 12 12
13 13 13
14 14 14 14
0 1 2 3 4 5 6 7 8 9 10 11 12 13
0
1
2
3
4
5
6
7
8
9
Figure: Initial Feasible Solution
Automated University Timetabling Alexandre Pinto 19
Timetabling algorithm - A possibility
First phase - Feasibility achieved
through a constructive heuristic
Questions to be solved:
• How to choose the next
event?
• How to choose the time slot
and the room?
• How to deal with unassigned
events with no feasible
place?
Rooms
Timeslots
0 0 0 0
1 1 1 1
2 2 2
3 3 3 3
4 4 4
5 5 5 5
6 6 6 6
7 7 7
8 8 8
9 9 9 10 10 10 10
11 11 11
12 12 12 12
13 13 13
14 14 14 14
0 1 2 3 4 5 6 7 8 9 10 11 12 13
0
1
2
3
4
5
6
7
8
9
Figure: Initial Feasible Solution
Automated University Timetabling Alexandre Pinto 19
Timetabling algorithm - A possibility
Second phase - Optimization
using a search mechanism
Questions to be solved:
• How to perform a local
search in each solution?
• How to perturb the
solutions?
• How to define the
acceptance criterion?
Figure: Neighborhood search
Automated University Timetabling Alexandre Pinto 20
Timetabling algorithm - A possibility
Second phase - Optimization
using a search mechanism
Questions to be solved:
• How to perform a local
search in each solution?
• How to perturb the
solutions?
• How to define the
acceptance criterion?
Figure: Neighborhood search
Automated University Timetabling Alexandre Pinto 20
Automated University Timetabling
Author:
Alexandre Pinto

Automated University Timetabling

  • 1.
  • 2.
    Summary Outline • Introduction • ProblemFormulation • State of the Art • Architecture • Timetabling Algorithm Automated University Timetabling Alexandre Pinto 2
  • 3.
    Introduction - Whatis Timetabling? Scheduling of: • a set of teachers • a set of classes Placing them in: • a timeslot from a set of timeslots • a room from a set of rooms Subject to: • Unary/Binary constraints • Capacity constraints • Event spread constraints • Agent constraints Automated University Timetabling Alexandre Pinto 3
  • 4.
    Introduction - Whatis Timetabling? Scheduling of: • a set of teachers • a set of classes Placing them in: • a timeslot from a set of timeslots • a room from a set of rooms Subject to: • Unary/Binary constraints • Capacity constraints • Event spread constraints • Agent constraints Automated University Timetabling Alexandre Pinto 3
  • 5.
    Introduction - Whatis Timetabling? Scheduling of: • a set of teachers • a set of classes Placing them in: • a timeslot from a set of timeslots • a room from a set of rooms Subject to: • Unary/Binary constraints • Capacity constraints • Event spread constraints • Agent constraints Automated University Timetabling Alexandre Pinto 3
  • 6.
    Introduction - Anexample 08:00 - 09:00 09:00 - 10:00 10:00 - 11:00 11:00 - 12:00 12:00 - 13:00 13:00 - 14:00 14:00 - 15:00 15:00 - 16:00 16:00 - 17:00 17:00 - 18:00 18:00 - 19:00 19:00 - 20:00 Monday Tuesday Wednesday Thursday Friday u u u u COMP (PL3) P. Correia G.4.3 u u u u COMP (T1) C. Fonseca B1 u u u u COMP (TP1) L. Macedo B2 u u u u C.G (T1) J. Henriques B1 u u u u C.G (TP1) J. Henriques B1 u u u u C.G (PL4) J. Arrais G.4.3 u u u u I.S (T1) P. Cunha Anf. A u u u u I.S (TP1) P. Cunha C.5.2 u u u u A.P.L. (PL1) L. Paquete E.4.5 u u u u A.P.L. (T1) L. Paquete B1 u u u u I.A.I. (T1) F. Machado Anf. A u u u u I.A.I. (TP1) F. Machado BAnf. A u u u u I.A.I. (PL1) F. Machado E.4.5 Figure: An example timetable Automated University Timetabling Alexandre Pinto 4
  • 7.
    Problem Formulation -Fundamental Concepts Concepts: • Class - A class is an event that gathers a set of students having the same subject at the same time. • Event - An event is the basic unit to be scheduled. Automated University Timetabling Alexandre Pinto 5
  • 8.
    Problem Formulation -Fundamental Concepts Concepts: • Class - A class is an event that gathers a set of students having the same subject at the same time. • Event - An event is the basic unit to be scheduled. Automated University Timetabling Alexandre Pinto 5
  • 9.
    Problem Formulation -Fundamental Concepts Concepts: • Hard Constraint - A rule that must be respected. • Soft Constraint - A rule that should be respected as much as possible. • Feasible Timetable - A timetable is considered feasible when all events are scheduled and no hard constraint is violated. Automated University Timetabling Alexandre Pinto 6
  • 10.
    Problem Formulation -Fundamental Concepts Concepts: • Hard Constraint - A rule that must be respected. • Soft Constraint - A rule that should be respected as much as possible. • Feasible Timetable - A timetable is considered feasible when all events are scheduled and no hard constraint is violated. Automated University Timetabling Alexandre Pinto 6
  • 11.
    Problem Formulation -Fundamental Concepts Concepts: • Hard Constraint - A rule that must be respected. • Soft Constraint - A rule that should be respected as much as possible. • Feasible Timetable - A timetable is considered feasible when all events are scheduled and no hard constraint is violated. Automated University Timetabling Alexandre Pinto 6
  • 12.
    Problem Formulation -Fundamental Concepts Three main categories: Figure: The University Curricular Structure in Portugal Automated University Timetabling Alexandre Pinto 7
  • 13.
    Problem Formulation -Fundamental Concepts Figure: University Curricular Structure Class-teacher problem! Automated University Timetabling Alexandre Pinto 8
  • 14.
    State of theArt - Scientific View Figure: Techniques Applied to the University Timetabling Problem Automated University Timetabling Alexandre Pinto 9
  • 15.
    State of theArt - Scientific View One-Stage Optimization Algorithms Figure: One stage algorithms Automated University Timetabling Alexandre Pinto 10
  • 16.
    State of theArt - Scientific View Two-Stage Optimization Algorithms Figure: Two stage algorithms Automated University Timetabling Alexandre Pinto 11
  • 17.
    State of theArt - Technological View XXXXXXXXXXXFeature System Leeds Purdue Bullet THOR Distributed Timetabling On-line Timetabling Diamant Timetabling Engine Persistent Database User Interface Solver Interactive Changes Input Validation Flexibility in Preferences Distinction of Roles Table: Summary of the features of commercial/non-commercial solutions Automated University Timetabling Alexandre Pinto 12
  • 18.
    Architecture - EvaluationFunction One of the main operations of the timetabling algorithms is to check constraint violations. There are two ways of analyzing violations: • Check entire solution - The solution is analyzed considering all of the events, i.e, the entire solution. • Check only the differences - Applicable to the computation of the difference between an old solution and a new one. Automated University Timetabling Alexandre Pinto 13
  • 19.
    Architecture - EvaluationFunction One of the main operations of the timetabling algorithms is to check constraint violations. There are two ways of analyzing violations: • Check entire solution - The solution is analyzed considering all of the events, i.e, the entire solution. • Check only the differences - Applicable to the computation of the difference between an old solution and a new one. Automated University Timetabling Alexandre Pinto 13
  • 20.
    Architecture - EvaluationFunction One of the main operations of the timetabling algorithms is to check constraint violations. There are two ways of analyzing violations: • Check entire solution - The solution is analyzed considering all of the events, i.e, the entire solution. • Check only the differences - Applicable to the computation of the difference between an old solution and a new one. Automated University Timetabling Alexandre Pinto 13
  • 21.
    Architecture - EvaluationFunction f (s) = SC i=1 wi (s) · Ci (s) Figure: s - A solution in the search space Ci - Number of times that the constraint is violated wi - Weight of the constraint SC - Number of soft constraints The objective of the search algorithm will be to find a solution s that minimizes the value of f (s). Automated University Timetabling Alexandre Pinto 14
  • 22.
    Architecture - MainData Structure Rooms Timeslots 0 1 2 3 4 5 6 7 8 8 9 10 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 0 1 2 3 4 5 6 7 8 9 Figure: Solution representation Automated University Timetabling Alexandre Pinto 15
  • 23.
    Architecture - ComplexityAnalysis Constraint - Order of typologies must/should be respected Worst-Case Analysis Entire Solution Incremental Approach O(P · E) O(E) Table: P - Number of teachers, E - Number of events 2 5 / 3 7 11 10 / 1 4 / 6 9 8 / 2 5 1 / 1 2 3 4 5 Figure: Current order of teacher events Automated University Timetabling Alexandre Pinto 16
  • 24.
    Architecture - ComplexityAnalysis Constraint - All distances between events must be respected Worst-Case Analysis Entire Solution Incremental Approach O(E2) O(E) Table: E - Number of events Events Events 2 2 5 5 4 4 3 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 Figure: Distance matrix Automated University Timetabling Alexandre Pinto 17
  • 25.
    Architecture - ComplexityAnalysis Constraint - Events in the last slot of the day should be avoided Worst-Case Analysis Entire Solution Incremental Approach O(D · PC) O(E) Table: D - Number of days, PC - Number of curricular plans, E - Number of events Figure: Generic structure to keep track of events Automated University Timetabling Alexandre Pinto 18
  • 26.
    Timetabling algorithm -A possibility First phase - Feasibility achieved through a constructive heuristic Questions to be solved: • How to choose the next event? • How to choose the time slot and the room? • How to deal with unassigned events with no feasible place? Rooms Timeslots 0 0 0 0 1 1 1 1 2 2 2 3 3 3 3 4 4 4 5 5 5 5 6 6 6 6 7 7 7 8 8 8 9 9 9 10 10 10 10 11 11 11 12 12 12 12 13 13 13 14 14 14 14 0 1 2 3 4 5 6 7 8 9 10 11 12 13 0 1 2 3 4 5 6 7 8 9 Figure: Initial Feasible Solution Automated University Timetabling Alexandre Pinto 19
  • 27.
    Timetabling algorithm -A possibility First phase - Feasibility achieved through a constructive heuristic Questions to be solved: • How to choose the next event? • How to choose the time slot and the room? • How to deal with unassigned events with no feasible place? Rooms Timeslots 0 0 0 0 1 1 1 1 2 2 2 3 3 3 3 4 4 4 5 5 5 5 6 6 6 6 7 7 7 8 8 8 9 9 9 10 10 10 10 11 11 11 12 12 12 12 13 13 13 14 14 14 14 0 1 2 3 4 5 6 7 8 9 10 11 12 13 0 1 2 3 4 5 6 7 8 9 Figure: Initial Feasible Solution Automated University Timetabling Alexandre Pinto 19
  • 28.
    Timetabling algorithm -A possibility Second phase - Optimization using a search mechanism Questions to be solved: • How to perform a local search in each solution? • How to perturb the solutions? • How to define the acceptance criterion? Figure: Neighborhood search Automated University Timetabling Alexandre Pinto 20
  • 29.
    Timetabling algorithm -A possibility Second phase - Optimization using a search mechanism Questions to be solved: • How to perform a local search in each solution? • How to perturb the solutions? • How to define the acceptance criterion? Figure: Neighborhood search Automated University Timetabling Alexandre Pinto 20
  • 30.