530 likes | 598 Views
The School Course Timetabling Problem or How the Messiness of Real Life Can Obscure a Nice Model. Presentation by Liam Merlot joint work with Natashia Boland, Barry Hughes and Peter Stuckey. First Some Terminology. Session Subject Content, Year Level, Capacity, No. Classes, No. Lessons
E N D
The School Course Timetabling ProblemorHow the Messiness of Real Life Can Obscure a Nice Model Presentation by Liam Merlot joint work with Natashia Boland, Barry Hughes and Peter Stuckey
First Some Terminology • Session • Subject • Content, Year Level, Capacity, No. Classes, No. Lessons • Class • Union of Subject, Teacher and Students • Lesson • Each individual meeting of a class
Problem Description (1) • Create a timetable for a School • find sessions for all lessons of all classes of all subjects • Initial data: • student subject choices • teacher subject allocations • all information about subjects (capacity, no. classes, no. lessons)
Problem Description (2) • Some subjects have multiple classes • What English class is Fred in? • Who is teaching Fred English? • 2 Sub-Problems: • The Student Population Problem • The Class Timetabling Problem • Both problems combined: The Population and Class Timetabling Problem (PCTP)
Blocking Decomposition • Class Blocking and Population Problem (CBPP): • Students are allocated to classes • Classes are allocated to blocks • Block Timetabling Problem (BTP): • Blocks allocated to sessions What are Blocks? • Sets of classes for which all lessons will be allocated to the same set of sessions in the timetable.
Hist Eng 1 Phys Eng 2 Mat 1 Eng 3 Mat 2 Geog Mat 3 Cook Chem Art Bio Lit Psyc Phil Blocking Example:
Blocking Example: Block 1 Hist Eng 1 Hist Mat 3 Lit Phys Eng 2 Mat 1 Eng 3 Mat 2 Geog Mat 3 Cook Chem Art Bio Lit Psyc Phil
Blocking Example: Block 1 Hist Eng 1 Hist Mat 3 Lit Phys Eng 2 Block 2 Mat 1 Eng 3 Mat 1 Eng 2 Cook Art Mat 2 Geog Mat 3 Cook Chem Art Bio Lit Psyc Phil
Blocking Example: Block 1 Hist Eng 1 Hist Mat 3 Lit Phys Eng 2 Block 2 Mat 1 Eng 3 Mat 1 Eng 2 Cook Art Mat 2 Geog Block 3 Mat 3 Cook Phys Mat 2 Phil Chem Art Bio Lit Psyc Phil
Blocking Example: Block 1 Hist Eng 1 Hist Mat 3 Lit Phys Eng 2 Block 2 Mat 1 Eng 3 Mat 1 Eng 2 Cook Art Mat 2 Geog Block 3 Mat 3 Cook Phys Mat 2 Phil Chem Art Block 4 Bio Lit Bio Geog Chem Psyc Phil
Blocking Example: Block 1 Hist Eng 1 Hist Mat 3 Lit Phys Eng 2 Block 2 Mat 1 Eng 3 Mat 1 Eng 2 Cook Art Mat 2 Geog Block 3 Mat 3 Cook Phys Mat 2 Phil Chem Art Block 4 Bio Lit Bio Geog Chem Psyc Phil Block 5 Psyc Eng 1 Eng 3
Blocking Example: Block 1 Hist Mat 3 Lit Block 2 Mat 1 Eng 2 Cook Art Block 3 Phys Mat 2 Phil Block 4 Bio Geog Chem Block 5 Psyc Eng 1 Eng 3
M T W T F Blocking Example: Block 1 Timetable Hist Mat 3 Lit Block 2 Mat 1 Eng 2 Cook Art Block 3 Phys Mat 2 Phil Block 4 Bio Geog Chem Block 5 Psyc Eng 1 Eng 3
Blocking Example: Block 1 Hist Mat 3 Lit Block 2 Mat 1 Eng 2 Cook Art Block 3 Phys Mat 2 Phil Block 4 Bio Geog Chem Block 5 Psyc Eng 1 Eng 3
Blocking Example: Student 25 Block 1 Lit Hist Mat 3 Lit Block 2 Mat Mat 1 Eng 2 Cook Art Block 3 Phys Phys Mat 2 Phil Block 4 Chem Bio Geog Chem Block 5 Eng Psyc Eng 1 Eng 3
Advantages and Disadvantages • Allows some information from timetabling to be used in student allocation • Greatly reduced search space • Problem becomes difficult across year levels • Doesn’t work if teacher’s have significant time restrictions
PCTP Literature • Very few papers: • School problems normally solved with blocking (CBPP, BTP) • University problems normally a different decomposition (CTP, SPP) • CBPP is further decomposed (non-linear model)
Pure Blocking • All students do the same number of subjects • All subjects require the same number of lessons (classes can be allocated to any block) • All classes must be blocked • The number of blocks is equal to the number of subjects that each student is taking
Innovations in Our Model • Students with the same set of subjects (program) are combined • CBPP is solved in one step
Pure Blocking Model • Multiple related Network Models: • One for the Subjects • One for each discrete student program • One for each teacher • Classes of subjects are allocated to blocks • Students and teachers are allocated to take subjects in blocks
1 2 3 4 5 6 Pure Blocking Model • Subject Network Model: Subjects A B C D E F G H I J K L Blocks
1 2 3 4 5 6 1 3 Pure Blocking Model • Subject Network Model: No. Classes 1 4 1 1 6 1 2 1 3 1 1 2 Subjects A B C D E F G H I J K L Blocks
1 2 3 4 5 6 Pure Blocking Model • Network Models for each discrete program and teacher. • For example: program 7 taken by 4 students: Subjects A B C D E F Blocks
1 2 3 4 5 6 3 2 4 2 1 4 1 4 1 2 Pure Blocking Model • Network Models for each discrete program and teacher. • For example: program 7 taken by 4 students: 4 4 4 4 4 4 Subjects A B C D E F Blocks 4 4 4 4 4 4 Total capacity for each Subject-Block combination dependent on Subject-Block allocation
Model Data • p P - discrete student programs • t T - teachers • s S - subjects • b B - blocks • s - number of classes of subject s • s - capacity of each class of subject s • p - number of students taking discrete program p • ts - number of classes of subject s taken by teacher t
Model Variables • xsb -integer variable: number of classes of s allocated to b • wp – integer variable: number of students taking p with a ‘full allocation’ • ypsb - integer variable: number of students studying p allocated to take subject s in block b • ztsb - binary variable whether teacher t takes subject s in block b
Model 1 Max p wp + t s b ztsb Subject to: bB xsb = s, s S wp p, p P bB ypsb = wp, s p, p P sp ypsb = wp, b B, p P pP ypsb sxsb, b B, s P bB ztsb ts, s t, t T st ztsb 1, b B, t T tT zpsb xsb, b B, s T
Model 2 Max p s b ypsb + t s b ztsb Subject to: bB xsb = s, s S bB ypsb p, s p, p P sp ypsb p, b B, p P pP ypsb sxsb, b B, s P bB ztsb ts, s t, t T st ztsb 1, b B, t T tT zpsb xsb, b B, s T
Integrality • Network (and other) problems often have integrality property • Student and teacher variables do NOT have the integrality property (although network-like) • Will this matter? • Will we be lucky?
Xavier College Senior School • 4 Year Levels • 68 Sessions (7 per day) • 922 students • 571 programs • 91 subjects • 242 classes • 112 teachers
Types of Subject • Elective: • students choose a specified number with no restrictions, classes need to be populated, same number of sessions required • Streamed: • students already allocated to classes, all lessons of all classes held in same set of sessions • Core: • students already allocated to classes (same sets for each subject in each year level)
Applying Pure Blocking • Works well for the elective subjects for each year level • Problems arise over multiple year levels • Subjects do not all require same number of lessons
Adapting Pure Blocking • Temporarily ignore core subjects • One complex blocking scheme for years 11 and 12 • One simple blocking scheme for each of years 9 and 10 • Allow the three blocking schemes to overlap
RE Blocks for Year 11 and 12 Year 12 Blocks: Block 1 Block 2 Block 3 Block 4 Block 5 Block 6
RE Blocks for Year 11 and 12 Year 12 Blocks: Block 1 Block 2 Block 3 Block 4 Block 5 Block 6 Year 11 Blocks (Ideal Case): Block 1 Block 2 Block 3 Block 4 Block 5 Block 6 RE
RE Blocks for Year 11 and 12 Year 12 Blocks: Block 1 Block 2 Block 3 Block 4 Block 5 Block 6 Year 11 Blocks (Real case): Block 1 Block 2 Block 3 Block 4 Bl 5 R.E. Block 6 R.E. Bl 5
K A B C D E I J F G Blocks for Year 11 and 12 Year 12 Blocks: A B C D E H Year 11 Blocks (Real case): Dummy subjects for year 12 added to blocks F, G, I, J Dummy subjects for year 11 added to blocks H, K, (E, F), (G, I) Constraints added to prevent teachers from taking classes in blocks which overlap
Years 9 and 10 • Streamed subjects allocated in year 11 and 12 blocking scheme • Year 10 Maths: one block • Year 10 Science: two blocks • Year 9 Maths: two blocks • Elective subjects: • 3 block model for each year level • Variables determine overlap between blocking scheme
Year 9 and 10 Blocking Scheme Year 10 Blocks: Block 1 Block 2 Block 3 Year 9 Blocks: Block 1 Block 2 Block 3
RE Overlap Areas Year 11 and 12 Blocks: Block 1 Block 2 Block 3 Block 4 Block 5 Block 6 Block 1 Block 2 Block 3 Block 4 Bl 5 R.E. Block 6 R.E. Bl 5 Overlap Areas: 1 2 3 4 5 6 7 8 9 1 0 Overlap variables specify the number of sessions each lower year block has in common with each overlap area
RE Blocks for Year 9 and 10 Year 11 and 12 Blocks: Block 1 Block 2 Block 3 Block 4 Block 5 Block 6 Block 1 Block 2 Block 3 Block 4 Bl 5 R.E. Block 6 R.E. Bl 5 Year 10: Maths Sci 1 El1 Sci 2 El2 El3 Year 9: El1 El 2 Maths 1 2 El3 Maths 2
Results for Blocking • Years 9 to 12 from a Victorian secondary school • 922 students, 571 programs • 91 subjects, 242 classes • 112 teachers • Modeled in AMPL • Solves in ~24 hours (8 hours with non-integer variables) • Takes 2 months to solve by hand currently
New Overlap Areas (15): But we are only half done …. • Need to allocate blocks to sessions • First construct new overlap areas:
Allocate overlap areas to sessions • One idea for BTP is to allocate overlap areas to sessions:
Model • a A - sessions • o O - overlap areas • b B - blocks • xoa - binary variable if overlap area o allocated to session a • xba - binary variable if block b is allocated to session a • o - number of lessons required by overlap area o • b - number of lessons required by block b • Fo - set of blocks in overlap area o
Model Max aA oO xoa aA xoa o , o O oO xoa 1, a A aA xba b , b B xoa xba , b Fo, o O • xba variables allow the model to keep track of blocks to allow constraints for doubles, weekly balance, etc. • Solutions produced in about 10 minutes
But what about the Core Subjects? • A third timetabling problem is solved after the other two problems have been solved. • Core classes are allocated to sessions which are not used by Year 9 or 10 blocked subjects • Clashing constraints are required • Data: 130 classes for 474 students
Model • a A - sessions • c C - classes of core subjects • b B - blocks • xca - binary variable if class c is allocated to session a • c - number of lessons required by class c • c1c2 - binary parameter, 1 if classes c1, c2 have a student or teacher in common • bc - binary parameter, 1 if class c and block b have a student or teacher in common • ba - binary parameter, 1 if block b was allocated to session a