🚐 REDUCES DELIVERY COST 18%

🚐 Last-Mile
Delivery Optimizer

🚚 Logistics Python Nearest-Neighbour Heuristic Berlin Geodata

Python routing optimizer using Berlin district geodata. Calculates optimal delivery sequences for a fleet of 5 vans across 50 daily stops β€” reducing total distance by 18%, cutting fuel costs by €1,240/month, and increasing on-time delivery probability from 71% to 94%.

18% Delivery Cost Reduction
312 km Distance Saved Daily
€1,240 Monthly Fuel Saving
94% On-Time Delivery Rate
Berlin Delivery Network β€” Optimized vs Manual Routes
Show: Click a van below to highlight its route
Optimized routes
Manual routes
Delivery stops
Depot (Wedding)
Per-Van Route Savings Breakdown
πŸ“Š Distance Saved per Van β€” manual vs optimized (km/day)
⏱ On-Time Delivery Rate β€” before vs after optimization (%)
β›½ Fuel Cost per Day β€” 4-week trend (€)
πŸ“¦ Stops per Hour β€” efficiency gain
πŸ—Ί Delivery by District β€” stop volume
β–Ά Problem
  • Last-mile delivery accounted for 53% of total logistics costs β€” yet route planning was done manually each morning by dispatchers using intuition, taking 45–60 minutes per day.
  • Drivers frequently criss-crossed districts rather than following geographically efficient sequences β€” adding 60–90 km of unnecessary driving per van per day.
  • On-time delivery rate of 71% triggered 3–5 customer complaint calls daily and put SLA agreements with key accounts at risk.
  • No visibility into route performance by driver, district, or time of day β€” making it impossible to identify where the most time was being lost.
β–Ά Solution
  • Python implementation of nearest-neighbour heuristic applied to 50 daily delivery stops across 12 Berlin districts β€” using OpenStreetMap coordinate data for each delivery address.
  • Algorithm assigns stops to 5 vans by district cluster (k-means grouping), then sequences each van's stops using nearest-neighbour from the depot in Wedding, Mitte.
  • Model outputs optimal stop sequence per van, total distance, estimated drive time, fuel cost (at €0.18/km), and on-time probability based on historical window compliance data.
  • Daily run takes 4 seconds. Output is a CSV dispatch sheet handed to drivers each morning β€” zero change to existing workflow, maximum adoption.
β–Ά Key Findings
  • Total daily fleet distance reduced from 1,728 km to 1,416 km β€” a saving of 312 km/day, equating to €1,240/month in fuel at current diesel rates in Berlin.
  • Van 3 (NeukΓΆlln / Tempelhof route) showed the highest inefficiency in the manual plan β€” crossing between districts 7 times per day. Optimized route eliminates all cross-district backtracking.
  • On-time delivery rate improved from 71% to 94% within 2 weeks of implementation β€” driven purely by earlier arrival at first stop and reduced mid-route delays.
  • Spandau and Reinickendorf deliveries are most time-sensitive β€” both districts have narrow delivery windows (08:00–12:00). Sequencing these first in the van assignment produced the largest OTD improvement.
  • A full VRP (Vehicle Routing Problem) solver would yield an additional 4–6% distance reduction beyond nearest-neighbour β€” worth commissioning if fleet scales to 10+ vans.
πŸ“ˆ Monthly Fuel Cost Savings Projection
β›½ Cumulative Fuel Cost Saving β€” solid = realised Β· dashed = projected (€)
Base scenario (5 vans): Projected cumulative fuel saving reaches €14,880 within 12 months of deployment β€” a direct bottom-line impact with zero capital expenditure required. Scale to 8 vans: If the fleet grows to 8 vans (planned for Q3 2026), optimized routing delivers €23,800 annual saving β€” making the business case for a dedicated route planning tool compelling at that scale. Fuel price +15% scenario: A diesel price increase of 15% (from €1.75 to €2.01/litre in Berlin) would make the current saving worth €17,100 annually β€” the optimization becomes more valuable as fuel costs rise, not less.
πŸ“Š Raw Dataset

Real data used in this analysis β€” 50 rows shown. Download full dataset below.

Stop IDDistrictVan IDWindow StartWindow End Weight (kg)Seq ManualSeq Optimized Dist. Saved (km)Time Saved (min)
πŸ’‘ Advice for Companies with Similar Challenges
πŸ’‘ Practical Recommendations
  • Start with a simple nearest-neighbour algorithm before investing in expensive route optimisation SaaS. A Python script using OpenStreetMap coordinate data can deliver 15–20% distance savings within days of deployment, at near-zero cost. The ROI is immediate and measurable.
  • Cluster your stops by district before sequencing. Assign each van a geographic zone first, then optimise the sequence within that zone. This two-step approach outperforms single-pass optimisation for multi-van fleets and is far simpler to explain to drivers and dispatchers.
  • Prioritise time-sensitive stops at the start of each route. Stops with narrow delivery windows (e.g. 08:00–11:00) should always be sequenced first β€” even if this adds marginal distance. The cost of a missed delivery window is almost always higher than the cost of extra kilometres.
  • Track your baseline before you optimise. You cannot prove value without a before/after comparison. Log manual route distances and on-time rates for 2 weeks before deploying the optimizer β€” the data will justify the investment and build internal support for the tool.
⚑ Key Takeaway

Last-mile is where most logistics budgets leak, and it is also where a simple Python script delivers the most immediate, visible return. You do not need a €50,000 SaaS platform to reclaim 15–20% of your delivery costs. You need clean stop data, a coordinate lookup, and a nearest-neighbour loop. Total build time: one day.