Eleftherios Platis
Machine learningMSc Thesis · Urbantz · July 202601 / 06

Predicting driver route deviations

Delivery drivers reorder 72.5% of their planned routes. I built a machine learning framework that predicts where they’ll deviate and adjusts routes to fit how drivers actually drive.

ContextMSc Thesis · Urbantz · July 2026
AreaMachine learning
ToolsPython, pandas, XGBoost
8.5/10thesis grade

01 — Abstract

Last-mile delivery drivers routinely deviate from algorithmically optimised route sequences, drawing on tacit knowledge and real-time situational judgement to reorder their stops. This gap between planned and executed routes represents a persistent source of operational uncertainty that traditional vehicle routing models largely ignore. This study investigates driver route deviations across three dimensions: quantifying them, explaining them through predictive modelling, and using the resulting risk signals to refine optimised routes. Using synthetic route data provided by Urbantz, a leading European last-mile delivery management platform, the study develops a three-phase machine learning framework. Phase A trains a route-level XGBoost classifier to predict whether a route will be deviated from, achieving AUC scores between 0.73 and 0.87 across three customers on time-based test sets. Phase B extends this to the edge level, predicting which specific stop-to-stop transitions are most likely to be skipped, with AUC values ranging from 0.66 to 0.73. Phase C applies a greedy local search guided by both models to reorder stops within high-risk routes, reducing mean predicted deviation risk on 96.5% of candidate routes through small, targeted stop-swaps that preserve the solver's global structure. Key findings indicate that deviation is widespread, systematic, and structurally driven by route size, time-window flexibility, and driver-recipient interaction history rather than random. Counterintuitively, non-deviated routes exhibit higher time-window violation rates, suggesting that reordering is partly a proactive compliance strategy. The framework positions deviation-aware models as a risk-reduction layer on top of existing routing infrastructure, contributing empirical grounding to emerging literature on adherence-aware optimisation in operational settings.

02 — The Problem

Route optimisers assume drivers follow the plan. They don't. In last-mile delivery, drivers constantly reorder their stops based on local knowledge: a road they avoid at school-run time, a building where the recipient is only in after 10, a cluster of nearby drops they'd rather knock out in one go. In the data I worked with, 72.5% of routes were reordered by the driver. Standard routing models treat this as noise, so the gap between the planned route and the driven route stays unexplained and unmanaged.

03 — What I built

In my MSc thesis with Urbantz, a European last-mile delivery platform, I built a three-phase machine learning framework that treats deviation as a signal rather than noise:

  • Phase A, route-level risk: an XGBoost classifier that flags which routes are likely to be reordered, using only information available at dispatch (AUC 0.73–0.87 across three customers, evaluated on time-based splits).
  • Phase B, edge-level risk: a second model that pinpoints which specific stop-to-stop transitions drivers are most likely to skip (AUC 0.66–0.73).
  • Phase C, route refinement: a greedy local search, guided by both models, that swaps stops within high-risk routes to lower predicted deviation risk. It leaves the solver's overall route structure intact.

04 — What changed

Phase C reduced predicted deviation risk on 96.5% of candidate routes. It did this with an average of three or four small, targeted swaps per route, not by redesigning the routes. The analysis also showed that deviation is systematic. It is driven by route size, time-window flexibility, and recurring driver–recipient patterns. One finding ran against intuition: routes that drivers didn't reorder had more time-window violations (35% vs 22%). This suggests drivers often deviate in order to stay on time. The outcome is a lightweight "human-compatibility layer" that could sit on top of existing routing software. It shows that driver behaviour can be learned and designed around without replacing the solver.

Presentation

Predicting driver route deviations — slide 1 of 22
01 / 22

Photos

Links

Talk to me about this project↗
← PreviousGenerative AI in UI designNext →Friends Across the Divide