Building an Optimised Timetable Generator with Timefold Solver

As universities expand and academic offerings grow more complex, efficient scheduling has become a critical operational challenge. A recent project at UniFil highlights how data science can streamline this process, reducing timetable generation times from a month to just 12 hours using advanced optimisation techniques.

The Challenge of Academic Scheduling

Timetable creation is a classic optimisation problem, complicated by diverse constraints such as course requirements, staff availability, and room capacities. At UniFil, this challenge is further compounded by the absence of fixed workloads for professors, frequent schedule updates, and a wide variety of specialised teaching spaces. These factors make traditional scheduling tools like FET unsuitable for their needs.

Choosing the Right Optimisation Tool

To tackle this problem, the project turned to Timefold Solver (formerly OptaPlanner), a powerful, open-source constraint solver known for its flexibility in handling complex scheduling tasks. Timefold’s strengths lie in its ability to optimise large-scale, multi-variable problems, making it ideal for this highly variable academic environment.

Key Technical Innovations

Early iterations of the timetable generator revealed critical performance bottlenecks, prompting the intern to refine the underlying data structures. Shifting from list-based to set-based data structures significantly improved access speeds and computational efficiency, enhancing the solver’s capacity to manage the massive search space inherent in academic scheduling.

Additionally, the project incorporated advanced optimisation strategies, including score calculation adjustments and constraint refinement. By employing a dual execution strategy—separating hard and soft constraint processing—the system achieved faster convergence on viable solutions, dramatically reducing computation times.

Results and Future Development

The final implementation reduced timetable generation from approximately one month to just 12 hours, demonstrating a significant leap in efficiency. Further refinements, including hyper-heuristic approaches and more sophisticated constraint management, promise to improve both execution speed and solution quality in future versions.

This project underscores the importance of careful data structure selection, efficient constraint management, and iterative optimisation in solving complex real-world scheduling problems. It also highlights the value of robust documentation and community support when working with advanced optimisation tools like Timefold Solver.