EURO Conference 2015 - Automated Timetabling
-
Upload
jquant -
Category
Technology
-
view
94 -
download
0
Transcript of EURO Conference 2015 - Automated Timetabling
EURO2015
Automated TimetablingA case study with hybrid algorithms and GPU
parallelization
Dionisio Chiuratto [email protected]
Aeronautics Institute of Technology (ITA) – BrazilFounder/CEO J!Quant – Brazil
The problem
• Build a timetable– i.e. all tuples (professor, timeslot, room, subject,
students) such as hard constraints are satisfied and soft constraints are solved to (near)optimality
• Many variations depending on what is being solved– Post-Enrollment Class-Course– Faculty Assignment– Classroom assignment– …
My problem
• Design a system to be general enough to solve other instances of the problem without parameter fine-tuning.
• Timetabling-as-a-Service
• Create a product
Food for thought
• BARDADYM(1996)
• Critic/Myth: “My students can design a timetabling program within a month.”
• Ans: “Let them try.”• 20 years ago – still trueBARDADYM, V. Computer-aided school and university timetabling: The new wave.In: BURKE, E.; ROSS, P. (Ed.). Practice and Theory of Automated Timetabling. Springer Berlin Heidelberg, 1996, (Lecture Notes in Computer Science, v. 1153). p. 22–45.
Case Study I
• Brazilian Basic Education School• Build a full working optimized timetable to be used in the
next academic period• Some data:– 8 academic periods (years)– 147 subjects– 44 teachers– 222 teacher-subject relationships
Case Study I
teacher
subject
timeslot
class
if it is assigned
otherwise
Case Study I
Some subjects needed to be assigned on adjacent slots
Case Study ISome subjects needed to be assigned on the same
timeslots across different classes
Case Study ITeachers’ availability constraint (red is unavailable)
Case Study I
Objective Funcion: Weighted Penalties + Aux Variables
Case Study IAlso...
• Some subjects had fixed timeslots• No clashes of any kind were allowed• There were classes with multiple teachers (up to 4)• The same teacher needed to be assigned to every class of the same
subject of a course• There were different timeslots (overleaping) for different courses
Case Study IObj: Minimize Teachers’ “Lecture Windows”
How to solve it?Mathematical Programming
• It just works (doesn’t it?)• The modelling forces you to not cheat (overfitting)• You know where you are (bounds, performance, ...)• You have (very good) support from vendors• Easier to separate between modelling and computational issues
• Hard (complex) to model some constraints/objectives• Inflexible – it’s hard to make small changes• The solver vendor will be your partner forever ($$$)• Doesn’t scale well to bigger problems ($$$)• Hard to integrate with other problems
CONS
PROS
How to solve it?Metaheuristics
• Easy(er) to code• Flexible as your coding skills allows• Guidelines provided by frameworks• (might) Scale well• Open source, you are free to make changes
• No support. You are alone with your own code forever• (very) Easy to overfit a problems with “ifs” in the code• Easy to have a poor model that does not generalize• Hard to assess performance and make comparissons• No guarantees, no bounds, nothing...• Are you certain that you’re doing better than simple
hillclimbing/local search/blind random search/greedy ?
CONS
PROS
Hybridize!Let’s have the best of both worlds!
Hybridize!But...
How to hybridize effectively?
Hybridize!Worst-case (sometimes appealing) scenario
GA-SA-IP approach with LS, enhanced by a Master-Slave-ACO-Optimized-ANN
There is a large chance you don’t know anymore what the original problem was.
Hybridize!One way to avoid that:
What is your hybridization intended to achieve?
Does the new hybrid solution performs better as a problem solver or just exploits problem-specific features?
Hybridization applied in TimetablingTwo main reasons:
Simulated Annealing was inneficient to converge (taking too long)Results were poor - even with greedy initialization.
Careful study showed that:
Too many iterations spent on already-known impossible swaps
Very large neighbourhood good solutions often missed because obvious-but-specific moves never occurred by chance
I.P
Greedy
S.A.
L.S.
Initialization
Solution Proposed
Solution Proposed
• S.A. did a good job on the overall optimization scheme but was failing at easier subproblems
• Integer programming was applied as a first pre-processor– Set boundary conditions in which the greedy initialization and sa-permutations
(swaps) would apply– Check overall model feasibility– Very simple model – solved by open source solver (GLPK) in ms– Act as an automatic domain knowledge discovery for every timetable problem– Output: How many assignments of each subject (MAX) might be placed in
each day, for each academic class (year)
Solution Proposed
classes
subjects
days
Weekly assignment need for subject d
Main decision variable – how many assignments for each day, class and subject were allowed
(pre-processed) – Max assignment feasible for class t, day k, subject d
Solution Proposed
Constraints:
Objective:
Solution Proposed
• S.A. did a good job on the overall optimization scheme but was failing at making the “right” swaps
• Local Search applied as a neighbourhood enhancer– “Specialized” swaps intended to exploit common root causes of poor solutions– E.g. try to swap the class assignment without teacher assigned to it– E.g. try to swap the other class, that has the missing teacher assigned to it and
is in the conflicting timeslot
Case Study I - Results
Case Study I - Results
• All hard constraints satisfied• Multiple feasible timetables produced• 40% reduction in teachers’ lecture-windows
Case Study II
• One of the world’s largest university (publicly traded)• Faculty Assignment – classes pre-scheduled• Large instance• Some data:– 23 undergraduate courses– 218 teachers– 485 subjects– 1.197 classes
Case Study II
• Very large neighbourhood• Serial approaches were all very time-consuming• Answer: parallelization
GPGPU
• General Purpose Graphics Processing Unit• Using GPUs to make computations (NVIDIA CUDA /
OpenCL)• GPU recently found it’s “killer application” – Deep learning• But it is also capable of changing the way we do
optimization (Deep Optimization?)
GPU-Parallelism
• Massively parallel Simulated Annealing• 64x1024 annealing chains on a single consumer GPU
(3GB)• Solution-space exploration greatly expanded• Special data structures needed• Scalable to multiple GPUs and multiple nodes
GPU-Challenges
• Need to efficiently generate random numbers (offset from an unique seed)
• To communicate (within chains) or not?• Memory use• Data structures !!!– Sparse incompatibility matrix – efficient creation and update
routine– Evaluation function speedup
GPU-Challenges
• Remember: (simple) computations are cheap and memory traffic is expensive and limited
• Motto: keep the GPU busy• Know when to stop – gpu low-level optimizations might be
an infinite path with exponential code complexity
Model
Teacher p is assigned to class t, timeslot h
Use dummy teacher id to denote the null case;
Model
Simple objetive funcion – penalizing missing teachers and total cost
ModelConstraints:
• Follow the pre-scheduled classes• Respect teacher-subject relationships• Respect teacher availability• Minimize 0-credit assignments (firing...)• Respect 20% margin of workload change across semesters (!)• Respect titles (MSc, PhD, etc)
ModelTournament-wise communication between annealing chains
Must find good “depth” and “breadth”
Case Study II - Results
Number of classes without teachers assigned
Case Study II - Results
Average overall academic credit cost
Case Study II - Results
Thanks!Questions?
E-mail: [email protected]