cotalks.dev

LLMs can't optimize schedules, but AI can! by Tom Cools

(link)
Channel: Devoxx

Summary

Tom Cools argues that **LLMs and generative AI are not well-suited to optimization-heavy planning problems** such as nurse rostering, vehicle routing, airline crew scheduling, and conference scheduling. He demonstrates how a ChatGPT-generated schedule can look plausible while still violating hard constraints like skills and availability, then explains why scheduling is a combinatorial optimization problem rather than a simple next-token prediction task. The talk then broadens the definition of AI beyond GenAI, showing where **mathematical optimization** fits in the larger AI landscape. Cools introduces **Timefold Solver**, an open-source JVM/Java framework that models planning problems with domain objects, planning variables, and business constraints, then uses metaheuristics and local search to find better solutions over time. He also shows how LLMs can still help indirectly by generating Java code, modeling domains, producing UML, and assisting with optimization workflows.

Key Takeaways

  • LLMs can generate plausible-looking schedules, but they often fail at hard constraints such as availability, required skills, and shift conflicts.
  • Scheduling is a combinatorial optimization problem with an enormous search space, so next-token prediction is the wrong tool for the job.
  • AI is broader than GenAI: machine learning and mathematical optimization are still important for planning and decision problems.
  • Timefold Solver lets developers model planning problems in Java with annotations, constraints, and reproducible optimization runs.
  • Hard constraints and soft constraints let planners separate impossible violations from preferences that should be optimized when possible.
  • LLMs are still useful around optimization workflows: generating code, creating UML-based domain models, and assisting with iterative solution design.

Sections

Why LLMs struggle with scheduling

Cools starts with a nurse rostering example and shows how a chat-based model can produce a complete-looking schedule that still assigns people to unavailable shifts or to roles they are not qualified for. The issue is not that the model cannot output structured data; it is that scheduling requires coordinated decisions across many variables, where a later choice can invalidate earlier ones.

Scheduling as a combinatorial optimization problem

The talk explains scheduling through small examples, such as three shifts that must be rearranged when a constraint is violated. Cools then scales that intuition up to a realistic roster, showing how the number of possible assignments grows explosively. This large search space makes it impractical for an LLM to solve scheduling by reasoning step by step the way a human would.

AI is bigger than GenAI

Cools distinguishes generative AI from the wider AI field. He notes that machine learning works well when there is a lot of labeled data, such as sign language recognition, but scheduling data is often fragmented across Excel files or even paper notes. Planning problems also require deterministic correctness for hard constraints, not probabilistic guesses.

Timefold Solver in Java

The core technical demo uses **Timefold Solver**, an open-source, JVM-based optimization framework. Employees and shifts are modeled as ordinary Java objects, with one field marked as a planning variable. Constraints are then expressed in a business-readable way to penalize invalid assignments such as missing required skills, overlapping shifts, or unavailable employees.

Hard constraints, soft constraints, and metaheuristics

The talk shows how Timefold separates impossible violations from preferences. Hard constraints protect correctness, while soft constraints capture desirables such as preferred days off. Cools describes the solver’s metaheuristic approach: generate an initial solution, then use local search to keep moving assignments around and improve the score over time, sometimes at tens of thousands of moves per second.

Real-world impact and related use cases

Cools highlights other optimization domains where the same approach applies, including vehicle routing, school timetabling, order picking, and conference scheduling. He argues that better schedules can reduce cost and emissions significantly, citing examples where optimization lowered driving time and produced major operational savings.

How LLMs can complement optimization

Rather than replacing optimization, the talk shows how LLMs can support it. Examples include using LLMs to generate Timefold code, using a Timefold-specific GPT built from documentation, building an agent pipeline that turns a text problem into PlantUML and then Java code, and using open-source tools like OpenEvolve to iteratively improve code with LLM feedback.

Takeaway

The conclusion is that GenAI is powerful, but not universal. For planning and scheduling, developers should choose the right tool: use LLMs where language, code generation, and assistance fit, and use mathematical optimization when the problem demands exact, constraint-aware decision-making.

Keywords: llm scheduling limitations, ai scheduling optimization, timefold solver, java optimization framework, nurse rostering, vehicle routing problem, conference scheduling, school timetabling, mathematical optimization, metaheuristics, local search optimization, hard constraints soft constraints, planning problem solving, reproducible optimization, plantuml code generation, langchain4j agents, openevolve, excel scheduling, crew scheduling, combinatorial optimization

note