February 16, 2026
05:20
min

How to solve a VRP with AI

Keep up with Timefold
Product updates, optimization insights, and stories from the builders behind PlanningAI.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Share

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:

Related videos
Optimize the Vehicle Routing Problem (VRP)
January 30, 2025
03:59
min

Optimize the Vehicle Routing Problem (VRP)

Optimize employee shift scheduling
January 30, 2025
03:55
min

Optimize employee shift scheduling

Maintenance scheduling optimization
January 30, 2025
05:36
min

Maintenance scheduling optimization

VRP constraints: shift length, service time and lunch breaks
January 30, 2025
03:22
min

VRP constraints: shift length, service time and lunch breaks

Code the Capacitated Vehicle Routing Problem (CVRP) in Java
January 30, 2025

Code the Capacitated Vehicle Routing Problem (CVRP) in Java

Code the Vehicle Routing Problem with Time Windows (VRPTW) in Java
January 30, 2025

Code the Vehicle Routing Problem with Time Windows (VRPTW) in Java

Maximizing Factory Production Line Efficiency
January 30, 2025

Maximizing Factory Production Line Efficiency

Order fulfillment routing
January 30, 2025

Order fulfillment routing

January 30, 2025

Optimize the world for fun and profit By Geoffrey De Smet, Lukáš Petrovický

What do our employees say about Timefold Solver?
January 30, 2025

What do our employees say about Timefold Solver?

Unlocking the Power of Timefold: Community, Enterprise, Orbit
January 30, 2025

Unlocking the Power of Timefold: Community, Enterprise, Orbit

Master Employee Shift Scheduling with AI: A Technical Guide to Timefold Software
January 30, 2025

Master Employee Shift Scheduling with AI: A Technical Guide to Timefold Software

January 30, 2025

Mobile Workforce Planning AI - Dispatch field service technicians

Timefold Team Days (fall 2023)
January 30, 2025

Timefold Team Days (fall 2023)

Code automated maintenance scheduling in Java with Timefold
January 30, 2025

Code automated maintenance scheduling in Java with Timefold

Build an AI-powered scheduling app with Spring Boot and Timefold
January 30, 2025

Build an AI-powered scheduling app with Spring Boot and Timefold

Code planning automation AI in Kotlin Notebooks
January 30, 2025

Code planning automation AI in Kotlin Notebooks

Build an AI-powered scheduling app with Quarkus and Timefold
January 30, 2025

Build an AI-powered scheduling app with Quarkus and Timefold

Solve the Capacitated Vehicle Routing Problem (CVRP) in Kotlin
January 30, 2025

Solve the Capacitated Vehicle Routing Problem (CVRP) in Kotlin

January 30, 2025

Timefold Case Study - Ecoprogram Flotte

Timefold AMA March 19 2024
January 30, 2025

Timefold AMA March 19 2024

Time Windows for Vehicle Routing
January 30, 2025

Time Windows for Vehicle Routing

Quarkus Insights #162: What is Timefold AI?
January 30, 2025

Quarkus Insights #162: What is Timefold AI?

Shift hours and overtime for the Vehicle Routing Problem
January 30, 2025
03:48
min

Shift hours and overtime for the Vehicle Routing Problem

Upgrade from OptaPlanner to Timefold in less than 1 minute
January 30, 2025

Upgrade from OptaPlanner to Timefold in less than 1 minute

January 30, 2025

Field Service Routing - Dealing with Timezones and Daylight Saving Time

Employee Shift Scheduling AI in Python
January 30, 2025

Employee Shift Scheduling AI in Python

Task dependencies for vehicle routing
January 30, 2025

Task dependencies for vehicle routing

The secret formula for fair scheduling AI
January 30, 2025

The secret formula for fair scheduling AI

PlanningAI: Solving what GenAI can't
January 30, 2025

PlanningAI: Solving what GenAI can't

January 30, 2025

CEO interview: Inside Timefold’s €6M funding & PlanningAI platform launch

Inside PlanningAI: Geoffrey De Smet on revolutionizing planning optimization
January 30, 2025

Inside PlanningAI: Geoffrey De Smet on revolutionizing planning optimization

July 3, 2025

The past, present and future of Timefold Solver

February 16, 2026
05:20
min

How to solve a VRP with AI

Building Smarter Planning & Scheduling UIs with Timefold and Bryntum
February 17, 2026

Building Smarter Planning & Scheduling UIs with Timefold and Bryntum

April 10, 2026

Solve a Vehicle Routing Problem with AI

Employee Shift Scheduling: Skills and Risk Factors
April 13, 2026

Employee Shift Scheduling: Skills and Risk Factors

Employee Shift Scheduling: Time Off
April 13, 2026

Employee Shift Scheduling: Time Off

April 17, 2026

Employee Shift Scheduling Priorities: Who Comes First

April 20, 2026
01:57
min

Employee Shift Scheduling: Travel Time and Location Constraints

April 20, 2026

Employee Shift Scheduling: Mandatory vs Optional Shifts

Alternative Shifts Explained: One Job, Multiple Time Windows
April 20, 2026

Alternative Shifts Explained: One Job, Multiple Time Windows

When scheduling works, everything works.

Less waste. More control. Teams that trust the plan.