An educational tool for solving a class of VRPs incorporating single and multi depots, homogeneous and mixed fleets, delivery time windows, and open routes. Upload a spreadsheet, pick a solver, and compare heuristic vs exact solutions on an interactive map.
Hard limits keep every run interactive, so a solver comparison fits inside a single lecture.
Flip solverType between heuristic and exact and re-run the same instance. The comparison is the lesson.
OptimizationResponse either way: summary, per-vehicle routes with timed steps, encoded polyline geometry, and any unassigned deliveries.Inside the heuristic
The heuristic solver is not a black box. The solver for the corresponding VRP variant combines three phases (construction, improvement, and refinement) that run in order, and each one is documented in the source.
Each phase is a separate mixin with a single entry point, so you can run one, two, or all three and diff the results. The pipeline calls them in sequence: build a feasible solution, shake it hard and repair it thousands of times, then polish what is left.
A complete VRP lab, not just a solver
All VRP features are available on every request, including single/multiple depots, homogeneous/mixed fleets, delivery time windows, alternative return locations for routes, and a choice of distance model.
Post an instance, get routes
A FastAPI service with automatic OpenAPI docs at /docs. Three endpoints are all you need.
mapType, solverType, and a timeout. Returns a status of success, partial, or infeasible with the full solution.{
"deliveries": [
{
"id": "delivery_1",
"amount": 12,
"start": {
"latitude": 41.0082,
"longitude": 28.9784,
"timeWindow": [28800, 43200]
},
"end": {
"latitude": 41.0082,
"longitude": 28.9784
},
"setup": 60,
"service": 300
}
],
"vehicles": [
{
"id": "vehicle_1",
"capacity": 100,
"start": {
"latitude": 41.0255,
"longitude": 28.9744
},
"end": {
"latitude": 41.0255,
"longitude": 28.9744
},
"cost": {
"distance": 1,
"time": 1,
"fixed": 50
},
"constraints": {
"maxTime": 28800,
"maxDelivery": 20
}
}
],
"mapType": "geographic",
"solverType": "heuristic",
"timeout": 60
}
{
"status": "success",
"summary": {
"cost": 1842.6,
"distance": 31204.0,
"duration": 5460,
"setup": 120,
"service": 900,
"routes": 2
},
"routes": [
{
"vehicle": "vehicle_1",
"amount": 34,
"cost": 921.3,
"distance": 15602.0,
"duration": 2730,
"steps": [
{
"type": "start",
"arrival": 28800,
"load": 0
},
{
"type": "delivery",
"delivery": "delivery_1",
"arrival": 29460,
"distance": 4120.0,
"load": 12
},
{
"type": "end",
"arrival": 31530,
"load": 0
}
],
"geometry": "e{~vFvskeE…"
}
],
"unassigned": []
}
Three ways in
Bring your own instance or start from one of the bundled datasets.
Download the Excel workbook, fill in the Deliveries and Vehicles sheets — amounts, coordinates, time windows, costs, and caps — then drag it into the app.
Euclidean, Istanbul, and Türkiye instances are built in. Pick one from the upload dialog to see a solved run immediately.
Post JSON to /optimizer/solve from a notebook or script. Interactive OpenAPI docs are generated automatically.
See the solution, not just the objective value
Routes render as real driving polylines on a Leaflet map, or as an SVG plot for Euclidean instances. Hover any stop for its arrival time, cumulative load, and distance travelled.