SlideShare a Scribd company logo
1 of 41
EURO2015
Automated Timetabling
A case study with hybrid algorithms and GPU
parallelization
Dionisio Chiuratto Agourakis
dionisio@jquant.com.br
Aeronautics Institute of Technology (ITA) – Brazil
Founder/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 true
BARDADYM, 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 I
Some subjects needed to be assigned on the same
timeslots across different classes
Case Study I
Teachers’ availability constraint (red is unavailable)
Case Study I
Objective Funcion: Weighted Penalties + Aux Variables
Case Study I
Also...
• 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 I
Obj: 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 Timetabling
Two 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
Model
Constraints:
• 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)
Model
Tournament-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: dionisio@jquant.com.br

More Related Content

Similar to EURO Conference 2015 - Automated Timetabling

OpenSubmit - How to grade 1200 code submissions
OpenSubmit - How to grade 1200 code submissionsOpenSubmit - How to grade 1200 code submissions
OpenSubmit - How to grade 1200 code submissionsPeter Tröger
 
lecture01_Introduction.pdf
lecture01_Introduction.pdflecture01_Introduction.pdf
lecture01_Introduction.pdfMarlonMagtibay2
 
Kylin Engineering Principles
Kylin Engineering PrinciplesKylin Engineering Principles
Kylin Engineering PrinciplesXu Jiang
 
DAA Mini Project.pptx
DAA Mini Project.pptxDAA Mini Project.pptx
DAA Mini Project.pptxAkashDudhane4
 
DAA Mini Project.pptx
DAA Mini Project.pptxDAA Mini Project.pptx
DAA Mini Project.pptxAkashDudhane4
 
Software tools to facilitate materials science research
Software tools to facilitate materials science researchSoftware tools to facilitate materials science research
Software tools to facilitate materials science researchAnubhav Jain
 
Lecture 1
Lecture 1Lecture 1
Lecture 1Mr SMAK
 
Data Structure and Algorithms
Data Structure and AlgorithmsData Structure and Algorithms
Data Structure and Algorithmsiqbalphy1
 
01 introduction to cpp
01   introduction to cpp01   introduction to cpp
01 introduction to cppManzoor ALam
 
Webinar: How We Evaluated MongoDB as a Relational Database Replacement
Webinar: How We Evaluated MongoDB as a Relational Database ReplacementWebinar: How We Evaluated MongoDB as a Relational Database Replacement
Webinar: How We Evaluated MongoDB as a Relational Database ReplacementMongoDB
 
Confessions of an Interdisciplinary Researcher: The Case of High Performance ...
Confessions of an Interdisciplinary Researcher: The Case of High Performance ...Confessions of an Interdisciplinary Researcher: The Case of High Performance ...
Confessions of an Interdisciplinary Researcher: The Case of High Performance ...tiberiusp
 
Capella Days 2021 | How much time does modeling take? Experiences from modeli...
Capella Days 2021 | How much time does modeling take? Experiences from modeli...Capella Days 2021 | How much time does modeling take? Experiences from modeli...
Capella Days 2021 | How much time does modeling take? Experiences from modeli...Obeo
 
Pi j1.0 workshop-introduction
Pi j1.0 workshop-introductionPi j1.0 workshop-introduction
Pi j1.0 workshop-introductionmcollison
 
2010 06-07-sto-2010-intelligent-resource-scheduling-for-reduced-turnaround-du...
2010 06-07-sto-2010-intelligent-resource-scheduling-for-reduced-turnaround-du...2010 06-07-sto-2010-intelligent-resource-scheduling-for-reduced-turnaround-du...
2010 06-07-sto-2010-intelligent-resource-scheduling-for-reduced-turnaround-du...Robert Richards, Ph.D.
 
Instructional software presentation ronen cohen
Instructional software presentation  ronen cohenInstructional software presentation  ronen cohen
Instructional software presentation ronen cohenroneninio
 

Similar to EURO Conference 2015 - Automated Timetabling (20)

OpenSubmit - How to grade 1200 code submissions
OpenSubmit - How to grade 1200 code submissionsOpenSubmit - How to grade 1200 code submissions
OpenSubmit - How to grade 1200 code submissions
 
lecture01_Introduction.pdf
lecture01_Introduction.pdflecture01_Introduction.pdf
lecture01_Introduction.pdf
 
Icml2017 overview
Icml2017 overviewIcml2017 overview
Icml2017 overview
 
BbWorld 2010 notes
BbWorld 2010 notesBbWorld 2010 notes
BbWorld 2010 notes
 
Kylin Engineering Principles
Kylin Engineering PrinciplesKylin Engineering Principles
Kylin Engineering Principles
 
Unit 4
Unit 4Unit 4
Unit 4
 
Lecture 1 (bce-7)
Lecture   1 (bce-7)Lecture   1 (bce-7)
Lecture 1 (bce-7)
 
DAA Mini Project.pptx
DAA Mini Project.pptxDAA Mini Project.pptx
DAA Mini Project.pptx
 
DAA Mini Project.pptx
DAA Mini Project.pptxDAA Mini Project.pptx
DAA Mini Project.pptx
 
Software tools to facilitate materials science research
Software tools to facilitate materials science researchSoftware tools to facilitate materials science research
Software tools to facilitate materials science research
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Data Structure and Algorithms
Data Structure and AlgorithmsData Structure and Algorithms
Data Structure and Algorithms
 
01 introduction to cpp
01   introduction to cpp01   introduction to cpp
01 introduction to cpp
 
Lec 01 introduction
Lec 01   introductionLec 01   introduction
Lec 01 introduction
 
Webinar: How We Evaluated MongoDB as a Relational Database Replacement
Webinar: How We Evaluated MongoDB as a Relational Database ReplacementWebinar: How We Evaluated MongoDB as a Relational Database Replacement
Webinar: How We Evaluated MongoDB as a Relational Database Replacement
 
Confessions of an Interdisciplinary Researcher: The Case of High Performance ...
Confessions of an Interdisciplinary Researcher: The Case of High Performance ...Confessions of an Interdisciplinary Researcher: The Case of High Performance ...
Confessions of an Interdisciplinary Researcher: The Case of High Performance ...
 
Capella Days 2021 | How much time does modeling take? Experiences from modeli...
Capella Days 2021 | How much time does modeling take? Experiences from modeli...Capella Days 2021 | How much time does modeling take? Experiences from modeli...
Capella Days 2021 | How much time does modeling take? Experiences from modeli...
 
Pi j1.0 workshop-introduction
Pi j1.0 workshop-introductionPi j1.0 workshop-introduction
Pi j1.0 workshop-introduction
 
2010 06-07-sto-2010-intelligent-resource-scheduling-for-reduced-turnaround-du...
2010 06-07-sto-2010-intelligent-resource-scheduling-for-reduced-turnaround-du...2010 06-07-sto-2010-intelligent-resource-scheduling-for-reduced-turnaround-du...
2010 06-07-sto-2010-intelligent-resource-scheduling-for-reduced-turnaround-du...
 
Instructional software presentation ronen cohen
Instructional software presentation  ronen cohenInstructional software presentation  ronen cohen
Instructional software presentation ronen cohen
 

More from Dionisio Chiuratto Agourakis

More from Dionisio Chiuratto Agourakis (9)

Inteligência Artificial Aplicada - Software, Hardware e Resultados
Inteligência Artificial Aplicada - Software, Hardware e ResultadosInteligência Artificial Aplicada - Software, Hardware e Resultados
Inteligência Artificial Aplicada - Software, Hardware e Resultados
 
J!Quant - GPU Technology Conference 2016
J!Quant - GPU Technology Conference 2016J!Quant - GPU Technology Conference 2016
J!Quant - GPU Technology Conference 2016
 
Apresentação J!Quant
Apresentação J!QuantApresentação J!Quant
Apresentação J!Quant
 
Machine Learning - Introdução e Aplicações
Machine Learning - Introdução e AplicaçõesMachine Learning - Introdução e Aplicações
Machine Learning - Introdução e Aplicações
 
Otimalidade Algoritmo A*
Otimalidade Algoritmo A*Otimalidade Algoritmo A*
Otimalidade Algoritmo A*
 
Fazendo acontecer com Scrum e a Filosofia Ágil.
Fazendo acontecer com Scrum e a Filosofia Ágil.Fazendo acontecer com Scrum e a Filosofia Ágil.
Fazendo acontecer com Scrum e a Filosofia Ágil.
 
Educação e Carreira
Educação e CarreiraEducação e Carreira
Educação e Carreira
 
Secular Technological Tailwinds
Secular Technological TailwindsSecular Technological Tailwinds
Secular Technological Tailwinds
 
Web Semântica e Internet das Coisas - GDG Sorocaba 2014
Web Semântica e Internet das Coisas - GDG Sorocaba 2014Web Semântica e Internet das Coisas - GDG Sorocaba 2014
Web Semântica e Internet das Coisas - GDG Sorocaba 2014
 

Recently uploaded

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 

EURO Conference 2015 - Automated Timetabling

  • 2. Automated Timetabling A case study with hybrid algorithms and GPU parallelization Dionisio Chiuratto Agourakis dionisio@jquant.com.br Aeronautics Institute of Technology (ITA) – Brazil Founder/CEO J!Quant – Brazil
  • 3. 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 – …
  • 4. 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
  • 5. 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 true BARDADYM, 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.
  • 6. 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
  • 8. Case Study I Some subjects needed to be assigned on adjacent slots
  • 9. Case Study I Some subjects needed to be assigned on the same timeslots across different classes
  • 10. Case Study I Teachers’ availability constraint (red is unavailable)
  • 11. Case Study I Objective Funcion: Weighted Penalties + Aux Variables
  • 12. Case Study I Also... • 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
  • 13. Case Study I Obj: Minimize Teachers’ “Lecture Windows”
  • 14. 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
  • 15. 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
  • 16. Hybridize! Let’s have the best of both worlds!
  • 18. 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.
  • 19. 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?
  • 20. Hybridization applied in Timetabling Two 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
  • 22. 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)
  • 23. 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
  • 25. 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
  • 26. Case Study I - Results
  • 27. Case Study I - Results • All hard constraints satisfied • Multiple feasible timetables produced • 40% reduction in teachers’ lecture-windows
  • 28. 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
  • 29. Case Study II • Very large neighbourhood • Serial approaches were all very time-consuming • Answer: parallelization
  • 30. 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?)
  • 31. 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
  • 32. 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
  • 33. 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
  • 34. Model Teacher p is assigned to class t, timeslot h Use dummy teacher id to denote the null case;
  • 35. Model Simple objetive funcion – penalizing missing teachers and total cost
  • 36. Model Constraints: • 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)
  • 37. Model Tournament-wise communication between annealing chains Must find good “depth” and “breadth”
  • 38. Case Study II - Results Number of classes without teachers assigned
  • 39. Case Study II - Results Average overall academic credit cost
  • 40. Case Study II - Results