📋 KEY INSIGHTS
- Logistics and last-mile delivery represent one of the richest domains for applied data science: every parcel shipment generates a trail of GPS traces, scan events, weather exposures, carrier assignments, and delivery outcomes that, at the scale of a major carrier (UPS, FedEx, Amazon Logistics), amounts to petabyte-scale time series data with complex spatial, temporal, and combinatorial structure. The three highest-value ML applications in logistics are: ETA (Estimated Time of Arrival) prediction for customer experience and operations planning, route optimisation for cost and emissions reduction, and demand forecasting for hub and sortation facility planning. Each application requires a different modelling paradigm — ETA is a sequence-to-scalar regression problem, route optimisation is a combinatorial optimisation problem where ML supplements classical OR solvers, and demand forecasting is a spatiotemporal time series problem with hierarchical structure.
- Vehicle Routing Problem (VRP) is the generalisation of the Travelling Salesman Problem to multiple vehicles: given a depot, N delivery locations, K vehicles with capacity constraints, and time window constraints, find the minimum-cost set of routes for the K vehicles. VRP is NP-hard — no polynomial-time exact algorithm is known for the general case — and commercial logistics operations solve approximate versions using metaheuristic solvers (OR-Tools, LKH3, HGS for CVRP). ML approaches to VRP fall into two paradigms: (1) construction heuristics learned end-to-end (Attention Model / POMO, Graph Transformer policies trained with RL that construct routes by sequentially selecting next stops) and (2) improvement heuristics (learning which 2-opt and 3-opt moves to apply to an existing solution). Neural construction heuristics (POMO, Sym-NCO) trained with REINFORCE achieve near-optimal solutions on CVRP with 100-200 stops in milliseconds, competitive with OR-Tools at small scale but outpacing it at very large scale where OR-Tools’ branch-and-bound becomes slow.
- ETA prediction (delivery time prediction) is the most direct ML impact on customer experience: accurate ETAs reduce customer anxiety, enable last-mile appointment scheduling, and improve driver workload forecasting. The modelling challenge: ETA is affected by route sequence (how many stops remain and their order), traffic conditions (time-of-day, day-of-week, weather, incidents), stop-level variability (apartment buildings take longer than suburban houses, businesses have access constraints), and driver behaviour (some drivers are systematically faster). The state-of-the-art approach: a hierarchical model combining a spatiotemporal traffic model (gradient boosting or Transformer on road segment traversal times from GPS traces) with a stop-level service time model (gradient boosting on stop features: address type, package count, floor, historical service time) and a route-level aggregation model. DeepETA (DoorDash) and GoodETA (Lyft) model route-level ETA with Graph Neural Networks over the route graph (stops as nodes, sequential order as edges), combined with real-time traffic features, achieving 10-15% RMSE reduction over baseline models.
- Demand forecasting for logistics networks predicts parcel volumes by origin-destination (OD) pair, hub, and time horizon (1-day ahead for sortation planning, 7-day for capacity, 30-day for staffing). The hierarchical structure — total network volume, hub volumes, OD pair volumes — requires hierarchical forecasting methods that maintain coherence (hub-level forecasts must sum to network-level forecasts). Temporal Fusion Transformer (TFT) with static covariates encoding hub features (capacity, location, carrier mix) and dynamic covariates (weather, promotions, macroeconomic indicators) achieves state-of-the-art on logistics demand forecasting benchmarks. The connection to our time series deep learning guide is direct: TFT’s multi-horizon, hierarchical forecasting capability is exactly the design requirement for logistics demand forecasting — the guide’s coverage of temporal attention, known future inputs (promotion calendar), and static covariates (hub features) maps directly to this application.
- Parcel sorting optimisation uses ML to assign parcels to sort lanes and carriers in automated sortation facilities. The key problem: given a parcel’s destination zip code, weight, and dimensions, assign it to the optimal sort lane (carrier, service level, hub connection) in real time (100ms latency) to minimise cost and maximise on-time delivery probability. Features: carrier rate cards, hub capacity utilisation forecasts, historical on-time delivery rates by carrier and lane, and destination-specific delivery constraints. The model: a multi-objective gradient boosting model or a learned sort rule tree that maximises a combination of cost, on-time probability, and load balance. Dynamic lane balancing uses a contextual bandit (Thompson Sampling, our multi-armed bandits guide) to adaptively re-route parcel flows when a lane approaches capacity, treating each time slot as a bandit round with reward proportional to cost savings and delivery performance.
- Carbon-aware routing is an emerging application that minimises CO2 emissions rather than just cost or time, using ML to estimate per-route emissions (from fuel consumption models) and optimise the carbon-cost tradeoff. Electric vehicle (EV) fleet routing extends VRP with charging constraints: EV range anxiety requires routing that ensures each vehicle can reach its destination without running out of battery, with charging stops inserted as additional depot visits. The connection to our data science for energy guide is direct: carbon-aware logistics routing uses the same energy consumption and carbon intensity models described there — specifically, the grid carbon intensity forecasts and EV battery degradation models that enable optimisation of when and where to charge fleet vehicles to minimise total lifecycle carbon emissions.
Logistics is one of the most data-intensive industries in the world: a parcel’s journey from sender to recipient generates dozens of scan events, GPS traces, carrier assignments, weather exposures, and delivery outcomes — and a single major carrier processes over 25 million packages per day. The economic stakes of marginal improvements are enormous: a 1% improvement in route efficiency across a fleet of 100,000 vehicles saves tens of millions of dollars per year in fuel and labour costs. This guide covers the full logistics data science stack: ETA prediction with spatiotemporal models, Vehicle Routing Problem (VRP) solvers and neural construction heuristics, demand forecasting for hub network planning, real-time parcel sorting optimisation, driver behaviour modelling, and carbon-aware fleet routing.
VRP, Neural Route Optimisation and ETA Prediction
Classical VRP solvers (OR-Tools, HGS, LKH3) use branch-and-bound exact methods for small instances and metaheuristics (Large Neighbourhood Search, guided ejection chains) for large instances. HGS (Hybrid Genetic Search, Vidal 2022) holds the state-of-the-art on CVRP benchmarks: it maintains a population of solutions, applies educate (improvement heuristics: 2-opt*, Or-opt) and diversify (crossover operators) operations, and achieves optimal or near-optimal solutions on instances up to 1000 stops in minutes. For real logistics operations (10,000-100,000 stops per day, re-optimised dynamically as new orders arrive), ML-based approaches provide sub-second solution quality competitive with 10-minute OR-Tools runs. The Attention Model (Kool et al., ICLR 2019) is the foundational neural construction heuristic for VRP: a Transformer encoder processes all stop locations and their features, and an autoregressive decoder sequentially selects the next stop to visit by computing attention over unvisited stops. Trained with REINFORCE (policy gradient RL), the Attention Model learns a probabilistic policy that generalises to unseen instances at inference time. POMO (Policy Optimisation with Multiple Optima, Kwon et al., NeurIPS 2020) extends the Attention Model by training with multiple starting points (each vehicle starts at a different depot assignment) and exploiting the symmetry of VRP solutions (the same route can be represented starting from any stop) to generate diverse high-quality solutions, achieving state-of-the-art on CVRP-100 and CVRP-200 benchmarks. The connection to our RL for real-world applications guide is direct: POMO’s REINFORCE training is a direct application of the policy gradient algorithms described there — the VRP construction policy is a stochastic policy whose expected reward (negative route length) is maximised by gradient ascent on the policy parameters, using the same REINFORCE estimator used for combinatorial optimisation described in that guide. ETA prediction pipeline at Amazon Logistics: (1) road segment traversal time model — gradient boosting trained on GPS trace data from millions of past deliveries, predicting traversal time for each road segment as a function of time-of-day, day-of-week, weather, and historical segment speed; (2) service time model — predicting dwell time at each stop (time from van arrival to departure) using features: address type (residential vs. commercial), floor number, number of packages, historical service time at that address; (3) route-level aggregation — summing predicted segment traversal times and service times along the planned route, with uncertainty propagation (prediction intervals widen for later stops due to uncertainty accumulation). The GNN-based DeepETA model (DoorDash 2022) represents the route as a graph and applies message passing to allow early-stop delays to propagate to downstream stop ETA estimates — if a driver is running late at stop 3, stops 4-10 should all receive later ETA estimates. The connection to our streaming ML guide is direct: ETA models in production must update continuously as GPS signals arrive — the online learning and real-time feature serving approaches described there (Kafka for event streaming, Flink for real-time feature computation, online gradient descent for continuous model updates) are the infrastructure for production ETA systems at carrier scale.
| Application | Method | Key Features | Latency | Impact |
|---|---|---|---|---|
| VRP route optimisation | HGS (classical) / POMO (neural) | Stop locations, capacity, time windows | Seconds (classical); ms (neural) | 5-15% distance reduction |
| ETA prediction | GBM + GNN + route aggregation | GPS traces, weather, address type | <100ms | RMSE 10-20% improvement |
| Hub demand forecasting | TFT hierarchical | Promotions, weather, macro | Batch daily | Forecast bias <3% |
| Parcel sort assignment | GBM multi-objective | Zip, weight, carrier rates, capacity | <50ms | Cost per parcel ↓5% |
| Carbon-aware routing | Multi-objective VRP + RL | EV range, charging stations, grid CI | Minutes (re-opt) | CO2 ↓10-25% |
Demand Forecasting, Sorting Optimisation and Driver Behaviour
Hierarchical demand forecasting for logistics networks must reconcile forecasts at multiple levels: total shipment volume (network level), hub inbound/outbound volume (hub level), and origin-destination pair volumes (OD level). Coherence constraints require that the sum of hub-level forecasts equals the network-level forecast, and that the sum of OD-pair forecasts for all pairs routed through a hub equals the hub forecast. Bottom-up reconciliation (forecast at the OD level, sum up) is the most granular but accumulates errors; top-down allocation (forecast at network level, allocate to hubs using historical mix) is smooth but misses local events; optimal reconciliation (MinT, Wickramasuriya et al., 2019) minimises the total forecast variance across the hierarchy subject to coherence. The connection to our probabilistic forecasting guide is direct: logistics demand forecasting requires prediction intervals (not just point forecasts) for capacity planning — a hub needs to plan for peak volume, not average volume, requiring the quantile regression and conformal prediction interval methods described there. Driver behaviour modelling identifies which drivers are systematically slower or faster than predicted, which drivers take non-standard routes (potentially indicating navigation issues or deliberate detours), and which drivers have high package exception rates (failed deliveries requiring re-attempts). Clustering driver GPS traces (using DBSCAN from our clustering guide) identifies common route variants and reveals divergence from planned routes. Survival analysis (from our survival analysis guide) models time-to-delivery as a hazard model: the hazard function captures how the probability of delivery in the next 15 minutes changes as a function of time since dispatch, stop sequence position, and time-of-day — enabling personalised ETA adjustments for specific drivers and routes. The connection to our MLOps CI/CD guide is direct: logistics ML models in production face significant distribution shift — new service areas, seasonal demand patterns, carrier network changes, and driver turnover all cause the data distribution to change over time. Continuous monitoring (from our ML monitoring guide) with drift detectors triggers retraining when ETA RMSE or demand forecast bias exceeds thresholds, and shadow deployment tests new model versions on a fraction of live traffic before full rollout.
✦ SUMMARIZE THIS ARTICLE WITH AI
Time series deep learning (TFT for hub demand forecasting) is in our Time Series Deep Learning guide. RL for real-world applications (REINFORCE training for POMO route optimisation) is in our RL guide. Streaming ML (real-time ETA feature serving and online learning) is in our Streaming ML guide. Multi-armed bandits (Thompson Sampling for dynamic lane balancing) are in our Bandits guide. Data science for energy (EV routing with grid carbon intensity) is in our Energy guide. Probabilistic forecasting (prediction intervals for hub capacity planning) is in our Probabilistic Forecasting guide. Data science for supply chain (inventory and demand planning connecting to hub optimisation) is in our Supply Chain guide.


