How to solve a VRP with AI
Why scheduling is a mathematical nightmare (and how AI finally solves it)
If you’ve ever tried to plan a day for a dozen technicians, you know the mental load is staggering. At first, you might think connecting people to visits is straightforward. You assign one job, which changes the next route, which then bumps into a time window, which then violates a labor law. The so-called "ripple effect." For a human, this is a recipe for decision fatigue. We are trying to solve a multi-dimensional puzzle in our heads that our brains simply aren't wired to calculate at scale.
1. The Search Space Problem
The difficulty of scheduling doesn't scale linearly but factorially. For a relatively small fleet of 10 vehicles and 70 visits, the number of possible permutations is approximately $10^{100}$ (a googol). To put that in perspective, there are an estimated $10^{80}$ atoms in the observable universe.
Because the search space is effectively infinite, an exhaustive search for the "perfect" solution is mathematically impossible in a production environment.
2. Why "Greedy" Logic and MIP Fail
Most initial attempts to automate scheduling fall into two traps:
- The Greedy Algorithm (Nearest Neighbor): This approach assigns the "next best" visit based on proximity. While fast, it is mathematically "short-sighted." It inevitably paints the schedule into a corner, leaving high-priority or highly specialized jobs unassigned because the necessary resources were "wasted" on easier, local tasks earlier in the calculation.
- Mixed Integer Programming (MIP): While MIP solvers are excellent for linear problems, they struggle with the non-linear constraints of real-world routing. In practice, MIP performance tends to degrade or hang once the problem exceeds 50 visits, even with GPU acceleration.
3. Defining "Scheduling AI" (It’s not an LLM)
In the context of Timefold, AI does not refer to Large Language Models (LLMs) or Generative AI. There is no training data or "hallucination" here. Instead, this is Metaheuristic Optimization.
The engine uses Incremental Heuristic Solvers. Rather than trying to calculate every possible route from scratch, these algorithms start with an initial solution and perform hundreds of thousands of "moves" (swaps, insertions, and re-sequences) per second. It evaluates the impact of each move against a multi-dimensional constraint model:
- Hard Constraints: (Must be met) Skill requirements, shift hours, vehicle capacity.
- Soft Constraints: (Optimized for) Drive time, fuel costs, SLA windows, and technician fairness.
4. Integration strategy: Solver vs. API
For the IT value chain, the decision to implement comes down to an architectural "Build vs. Buy" trade-off:
- The Solver (Core Engine): For teams with Operations Research (OR) expertise, an open-source solver (like Timefold Solver) provides the core logic. You define the constraints and handle the orchestration, map integrations, and data modeling.
- The REST API: For rapid deployment, the API model abstracts the mathematical complexity. You send a JSON payload of vehicles, visits, and constraints; the API returns a serialized, optimized schedule.
5. Verifiable ROI
Optimization isn't just about "neater" routes. Based on deployment data, moving from manual or greedy scheduling to heuristic optimization yields:
- 25% reduction in total drive time.
- Significant increase in "visits per day" throughput without adding headcount.
- OPEX reduction: In skilled trades, the efficiency gain averages $4,000 per technician, per year.
Watch the Technical Breakdown
If you want to see the JSON structures, the constraint modeling, and how these solvers iterate in real-time, you can view the full technical guide here:

When scheduling works, everything works.
Less waste. More control. Teams that trust the plan.








































