Home / Insights / AI and Machine Learning

AI and Machine Learning

Route Optimisation: When OR Solvers, Machine Learning and LLM Agents Each Fit

Route optimisation vendors now pitch solvers, machine learning and AI agents, sometimes in the same sentence. They solve different parts of the problem. This guide separates them, shows where each earns its place, and sets out a hybrid architecture and evaluation method for delivery, field service and fleet operators.

TopicsAI and Machine LearningBusiness Operations and Integration

Key takeaways

  • Operations research solvers remain the right engine for building feasible, constrained routes; neither machine learning nor LLMs replace them for that job today.
  • Machine learning adds most value upstream of the solver, by predicting travel times, service durations, demand and no-show risk more accurately than static assumptions.
  • LLM agents are useful around the solver: translating requests into constraints, explaining plans, handling exceptions and drafting changes for a dispatcher to approve.
  • Define the objective and constraints in business terms first; an optimiser that minimises distance when you care about on-time arrival will produce confident, wrong plans.
  • Evaluate against your current plans with backtests and controlled pilots, measuring cost, punctuality and dispatcher overrides rather than solver scores alone.

Route planning is one of the oldest problems in applied computing, and one of the most marketed. Operations leaders now hear that machine learning will learn better routes, that AI agents will plan the day autonomously, and that classical optimisation is outdated. In practice, the teams that get measurable gains use these techniques for different jobs and connect them carefully.

This article is for operations directors, CTOs and product owners at delivery companies, field service businesses, fleet operators and logistics platforms. It explains what each technique does well, offers a decision table, describes a hybrid architecture, and sets out how to evaluate a routing change before you trust it with your fleet. It draws on our logistics software work, which includes dispatch and route planning tools and route optimisation tested against each client’s own constraints, and on our experience building an e-scooter hire platform with a Singapore team, where real-time location and fleet management were central.

What routing problem are you actually solving?

Before choosing a technique, write down the problem precisely. Most real operations are variants of the vehicle routing problem (VRP). Google’s OR-Tools VRP guide defines it as finding good routes for several vehicles that together visit a set of locations, and notes that with a single vehicle it reduces to the travelling salesperson problem. Real operations add constraints quickly.

Common constraints

  • Capacity: weight, volume, pallet spaces or number of jobs per vehicle.
  • Time windows: customer delivery slots, site opening hours, appointment times.
  • Driver rules: shift length, breaks, skills, licences and home locations.
  • Pickup and delivery pairs: an item collected at one stop must be delivered later on the same route.
  • Vehicle compatibility: refrigerated loads, tail lifts, access restrictions in city centres.

Choose the objective deliberately

The objective is a business decision, not a technical one. OR-Tools makes the point that minimising total distance alone can be a poor objective, because without other constraints it can collapse into one vehicle doing all the work; its example instead minimises the longest single route. Your objective might be fewer vehicles, fewer late arrivals, lower overtime or balanced workloads, usually as a weighted combination. Google’s Route Optimization API reflects the same reality, exposing cost per kilometre, cost per hour and penalties for missed deliveries so the trade-offs are explicit.

Static, dynamic or both

A static problem plans tomorrow’s routes overnight. A dynamic problem replans during the day as orders arrive, vehicles break down or traffic changes. Dynamic replanning raises requirements for solve time, data freshness and how changes are communicated to drivers.

Action: write a one-page problem statement listing objective weights, hard constraints, soft constraints and replanning frequency. Every later technical choice should trace back to it.

What does each approach do well, and where does it fall short?

Operations research solvers and heuristics

Solvers and metaheuristics construct routes that respect hard constraints and optimise a defined objective. Libraries such as OR-Tools and managed services such as Google’s Route Optimization API take shipments, vehicles, time windows, capacities and costs, and return visit sequences, assignments, estimated times and route metrics. Their strengths are feasibility, explainable trade-offs and decades of algorithmic refinement. Their weakness is that they are only as good as their inputs: if travel times or service durations are wrong, the plan is precisely optimised around wrong numbers.

Machine learning

Machine learning helps in two distinct ways. The first, and in our view the most valuable for most businesses, is prediction: estimating travel time by time of day, service duration by customer and job type, likely order volumes, and the probability that a customer is not home. These predictions replace static assumptions in the solver’s inputs.

The second is learned heuristics, where a model learns to construct routes directly. Research such as Kool, van Hoof and Welling’s attention-based model for routing problems showed close to optimal results for travelling salesperson instances of up to 100 nodes and competitive results on VRP variants. This line of work is promising for very fast solving of many similar problems, but production deployments still typically pair learned methods with classical search and constraint checking, especially for large, heavily constrained instances.

LLM agents

Large language models do not, on their own, produce reliable optimal routes for real fleets. Where they help is around the solver. The OptiMUS research from Stanford (AhmadiTeshnizi, Gao and Udell, 2024) illustrates the productive pattern: the LLM formulates a mixed-integer model from a natural-language description, writes solver code, and checks and revises it, while a standard solver computes the answer. In operations, the equivalent uses are translating a dispatcher’s request (“keep Van 4 out of the city centre after 3pm”) into constraints, explaining why a plan looks the way it does, triaging exceptions and drafting replans for approval.

ApproachBest atNot suited toData neededMaturity in production
OR solver or metaheuristicFeasible, constrained routes against an explicit objectiveEstimating uncertain inputsLocations, constraints, travel-time matrixHigh
ML predictionTravel and service times, demand, failure riskGuaranteeing feasibilityHistorical GPS, job and order recordsHigh where data exists
ML learned heuristicsVery fast solving of many similar instancesHeavily constrained, unusual instancesLarge sets of training instancesEmerging
LLM agentInterpreting requests, explaining plans, exception handlingComputing optimal routes itselfPlans, constraints, policies, event logsEarly, with human approval

Action: label each part of your current planning process as “construct”, “predict” or “interpret”. That labelling maps directly onto solver, ML and LLM respectively.

How should you decide which approach to invest in?

Start where your plans are most wrong, not where the technology is most exciting. If planned routes look good on paper but drivers are consistently late, your inputs are the problem and ML prediction is the lever. If planners spend hours building routes by hand, a solver is the lever. If dispatchers drown in phone calls and changes, an LLM-assisted exception workflow may help most.

Situation (illustrative)Primary leverSecondary lever
Planners build routes manually in spreadsheets or mapsOR solver or routing APISimple historical travel-time adjustments
Solver in place, but arrival estimates are routinely wrongML prediction of travel and service timesFeedback loop from driver app timestamps
Frequent same-day changes and high dispatcher workloadDynamic replanning with a solverLLM assistant to interpret changes and draft replans
Thousands of near-identical small routing problems per hourFast heuristics, possibly learnedSolver fallback for hard cases
Operations team distrusts plans and overrides them oftenBetter constraints and objectives in the solverLLM-generated plan explanations

Build, buy or use an API

  • Routing SaaS suits standard delivery and field service with common constraints.
  • Routing APIs such as Google’s Route Optimization API suit platforms that want optimisation embedded in their own product without maintaining solver code.
  • Open-source solvers such as OR-Tools suit unusual constraints, high volumes where per-request fees add up, or data that must stay in-house.

Our article on warehouse slotting and pick-path optimisation reaches a similar conclusion inside the warehouse: classic optimisation often wins on the core problem, with machine learning improving its inputs.

Action: quantify where plans fail today (late arrivals, overtime, manual planning hours, overrides) and invest in the lever that addresses the largest of those numbers.

What does a hybrid routing architecture look like?

The most robust designs we see layer the three approaches, with clear responsibility boundaries and a person in the loop.

Layers

  1. Data layer: orders, customer locations, time windows, vehicle and driver master data, historical GPS traces and job timestamps from driver apps.
  2. Prediction layer (ML): models for travel time by segment and time of day, service duration by job type and site, and optionally demand or failed-delivery risk. Outputs feed the solver as inputs, with confidence ranges.
  3. Optimisation layer (solver): builds and repairs routes against the agreed objective and constraints. It is the only component allowed to declare a plan feasible.
  4. Interaction layer (LLM agent): converts dispatcher requests into structured constraint changes, explains plans and proposes replans. It calls the solver as a tool rather than inventing routes.
  5. Execution layer: driver apps, customer notifications and telemetry that close the loop with actual times.

Guardrails for the agent layer

  • The agent proposes; the solver validates feasibility; a dispatcher approves changes that affect customers or drivers.
  • Constraint changes are written as structured data with an audit trail, never as free text passed into the solver.
  • The agent has read access to plans and policies and limited, logged write access to proposals only.

Our article on AI agents for logistics exception handling describes a safe first pilot for this kind of agent, including the approval boundaries we recommend.

Worked example (illustrative)

For example, a same-day courier with 40 vans might keep its existing solver but replace fixed 10-minute service times with predicted durations by customer and building type, learned from driver app timestamps. Dispatchers then use an assistant that turns messages such as “customer at stop 18 can only receive after 2pm” into a time-window change, reruns the solver for the affected routes, and shows the knock-on effect before anyone confirms it. Each layer does the job it is suited to.

Action: draw your current planning flow and mark which layer each step belongs to. Gaps in the prediction or execution layers usually explain more lost performance than solver choice.

How do you evaluate a routing change before trusting it?

Routing improvements are easy to overstate. A solver score or a demo on clean data says little about performance on a wet Monday with three drivers off sick.

Metrics that matter

  • Cost: distance, drive time, vehicles used, overtime hours.
  • Service: on-time arrival rate within the promised window, failed deliveries.
  • Plan quality: difference between planned and actual times, a direct test of your predictions.
  • Adoption: share of routes dispatchers override, and why.
  • Workload balance: spread of hours and stops across drivers.

An evaluation sequence

  1. Establish the baseline. Record current metrics for at least several representative weeks, including peaks.
  2. Backtest. Replay historical days through the new approach using only information available at planning time, and compare planned and actual outcomes.
  3. Shadow run. Generate plans in parallel with live operations without executing them; ask dispatchers to review differences.
  4. Controlled pilot. Run the new approach in one depot or region while another continues as before, and compare over the same period.
  5. Roll out with monitoring. Track the same metrics continuously, and alert on drift in prediction accuracy.

Be careful with backtests that use actual travel times the planner could not have known in advance; they flatter every method. And treat dispatcher overrides as data: frequent overrides usually reveal a missing constraint rather than stubborn staff.

Action: agree the pilot’s success criteria (for example, no drop in on-time rate and a measurable reduction in drive time) with operations and finance before it starts.

What are the risks and costs to plan for?

RiskHow it shows upMitigation
Wrong objectivePlans minimise distance while late arrivals riseWeighted objectives agreed with the business, reviewed after pilot
Poor input dataGeocoding errors, unrealistic service timesAddress validation, ML or historical estimates, driver feedback
Over-trusting LLM outputAgent suggests infeasible or non-compliant changesSolver validation and dispatcher approval for every change
Model driftPrediction accuracy falls after a network or seasonal changeMonitor planned versus actual; scheduled retraining
Driver rejectionRoutes ignored or modified on the roadInvolve drivers early, respect local knowledge, show reasons
Cost creep from APIsPer-request fees rise with dynamic replanningModel request volumes; batch or self-host where volumes justify

Where the effort goes

The solver integration is usually the smaller task. Data cleaning, constraint discovery with planners and drivers, driver app changes to capture actual times, evaluation and change management take most of the effort. Budget for them explicitly. Our article on AI in logistics software outlines the data requirements behind many of these use cases.

Action: include constraint-discovery workshops with planners and drivers in the first phase; missing constraints are the most common reason optimised plans are rejected.

Checklist: are you ready to improve route optimisation?

  1. The objective is written down with agreed weights for cost, punctuality and balance.
  2. Hard and soft constraints are documented and validated with planners and drivers.
  3. Actual arrival and service times are captured reliably from the field.
  4. Baseline metrics exist for representative weeks, including peaks.
  5. The solver is the only component allowed to declare a plan feasible.
  6. ML predictions feed the solver as inputs and are monitored for drift.
  7. Any LLM agent proposes changes through structured constraints, with dispatcher approval.
  8. Backtests use only information available at planning time.
  9. Pilot success criteria are agreed before the pilot starts.
  10. Dispatcher overrides are logged with reasons and reviewed weekly.

Action: work through the list with your operations lead; the first unticked item is the next piece of work, regardless of which technology it involves.

Frequently asked questions

Can an LLM plan our delivery routes on its own?

Not reliably for real fleets with capacities, time windows and driver rules. LLMs are useful for interpreting requests, explaining plans and drafting changes, but a constraint solver should compute and validate the routes, with a dispatcher approving changes that affect customers or drivers.

Is machine learning better than a traditional route optimiser?

They do different jobs. The biggest gains from machine learning usually come from better predictions of travel times, service durations and demand, which make the optimiser’s plans more realistic. Learned routing heuristics are an active research area but are typically combined with classical methods in production.

Should we use a routing API or build on an open-source solver?

Routing APIs are quick to integrate and remove solver maintenance. Open-source solvers such as OR-Tools suit unusual constraints, very high request volumes where per-request fees add up, or data that must remain in-house. Model your request volumes and constraint needs before choosing.

How long does it take to see results from route optimisation?

With clean location data and documented constraints, a solver pilot can run within a few months. Prediction models need enough historical GPS and job data; if you are not capturing actual times today, start there, because it limits every other improvement.

What data do we need before starting?

Accurate customer locations, time windows, vehicle and driver details, and historical records of planned versus actual times. Driver app timestamps for arrival and departure at each stop are particularly valuable for both evaluation and machine learning.

Sources and methodology

Guidance reflects PoliteTech delivery experience. The external references below informed specific points in this article.

  1. Google OR-Tools: Vehicle Routing Problem — accessed 10 November 2026. VRP definition, capacity and time-window variants, and the point that minimising total distance can be a poor objective.
  2. Google Maps Platform: Route Optimization API overview — accessed 10 November 2026. Inputs, cost parameters, constraints and outputs of a managed routing optimisation service.
  3. Kool, van Hoof and Welling: Attention, Learn to Solve Routing Problems! (arXiv) — accessed 10 November 2026. Learned routing heuristics with close to optimal results on TSP instances of up to 100 nodes.
  4. AhmadiTeshnizi, Gao and Udell: OptiMUS (arXiv, February 2024) — accessed 10 November 2026. Pattern of LLMs formulating optimisation models and solver code while a standard solver computes the answer.

Are your routes optimised around the wrong numbers?

Share how you plan routes today and where plans break down. We will suggest whether a solver, better predictions or an assistant for dispatchers should come first.