Electric-van delivery routing

48 pharmacies. 6 electric vans. 14 chargers. One plan that never runs a battery flat.

EV routing plans one delivery day around Bergamo: which van serves each pharmacy, in what order, and where it stops to charge, with capacity, delivery windows, real road travel, and battery range held together in one score.

48 Pharmacies
6 Electric vans
14 Chargers
5 Constraints
4 / 1 Hard / soft split
30 s Search budget

An electric delivery route is only valid if the van can actually drive it. A route that fits capacity and every delivery window can still run below the battery reserve halfway through, and adding a charging stop moves every later arrival. Visit order, charging, and lateness have to be decided together.

Charging stops are derived rather than searched: after every route change an exact dynamic program places the stops that minimise range shortfall and then added time, so the list variable holds only pharmacies and the stock Clarke-Wright and k-opt construction works unchanged. The app keeps the route map, the van cards, the schedule, the input tables, score analysis, and the retained job on one surface.

Battery range No route runs below the van's reserve after its best charging plan.
Van capacity Crates loaded stay within each van's capacity.
Delivery windows Every delivery finishes before its window closes, charging delays included.
Road reachability Every leg is connected on the OpenStreetMap road network.
Travel time Driving, charger detours, and charging time stay a soft cost.
Retained workflow Status, snapshots, score analysis, road geometry, and lifecycle actions stay on the stock contract.
Runtime walkthrough Watch the routes form on Bergamo's roads with their charging stops, then read the plan van by van. Narrated walkthrough (1:32): the unsolved day, the solve on the road network, the van cards, score analysis, the schedule, the data tables, and the REST API.
Unsolved day The unsolved baseline states the day before any route exists: 48 pharmacies, 6 vans at the Stezzano hub, and 14 chargers on the map.
  1. The fleet figures start at zero: distance, driving, charging stops, shortfall, lateness.
  2. Hub, pharmacies, and public chargers are placed on the real road map.
Mid-solve Mid-solve, every pharmacy is already routed on real roads while the search keeps improving the plan.
  1. The retained job is still solving; Pause and Stop stay available.
  2. Routes follow the road network; legs to and from a charger are dashed.
Route plan The finished plan is one inspectable surface: a card per van and its route on the map, coloured the same.
  1. Each card states load, distance, charging stops, lowest charge, and return time.
  2. Pharmacies take their van's colour; used chargers are coloured too.
Score analysis Score analysis shows four hard rules at zero and travel time as the only cost the search trades against.
  1. Battery shortfall is a hard rule, measured in metres below the reserve.
  2. Total travel time carries the soft cost: driving plus charging.
Schedule The schedule turns the same plan into time: one lane per van, deliveries in green, charging in amber.
  1. Charging stops sit in the timeline where the route places them.
  2. Each lane is one van, with its stop and charge counts.
Plan data The data tab shows the inputs behind the plan: each van's capacity, range, charge at departure, and reserve, and each pharmacy's crates and window.
  1. Vans differ in capacity, range, starting charge, and recharge time.
  2. Pharmacies carry crates, a delivery window, and an unloading time.