How bug1857/waybill-complete works
Waybill is a courier-route optimization system whose Python engine is canonical; the preserved Google UI is explicitly a reference, not a deployed solver. The main workflow accepts stops and a distance/time matrix, builds an instance, solves and independently checks routes, then returns typed reports and map-ready data through the local API and static workbench. The graph preserves the documented TSP exact and heuristic methods, CVRPTW construction, road/place integrations, and evidence/reporting capabilities. Edges are limited to README and indexed source relationships; unsampled UI wiring is not inferred.
Main entry points: server.py Local solve API · nearest_neighbor.py Nearest neighbour · instance.py Routing instance · solver.py Solver contract and budget
Components 24
Inputs and routing
- Places and stops
adapters/places.py - Road distance adapters
adapters/distance/osrm.py - Offline distance adapter
adapters/distance/haversine.py
Problem model
- Cost matrix
core/distance/matrix.py - Routing instance
core/model/instance.py - Coordinates
core/model/geometry.py - Stops and constraints
core/model/stop.py - Vehicles
core/model/vehicle.py - Route solution
core/model/solution.py
Route solving
- Solver contract and budget
core/solver.py - Nearest neighbour
core/construct/nearest_neighbor.py - Clarke-Wright construction
core/construct/savings.py - Exact TSP solvers
core/exact/branch_and_bound.py - Held-Karp cross-check
core/exact/held_karp.py - Local search and annealing
core/local
Validation and results
- Objective scoring
core/eval/objective.py - Independent feasibility
core/eval/feasibility.py - Typed solve report
core/reporting/report.py - Claim and stop status
core/reporting/status.py
API and workbench
- Local solve API
api/server.py - Static workbench and map
web/app.js - Evidence viewer
web/evidence.js - Live route replay
web/live.js
Other components
- Courier/operator
Connections 34
- Courier/operator → Local solve API: submits solve
- Local solve API → Places and stops: queries places
api/server.py - Local solve API → Road distance adapters: requests road matrix
api/server.py - Local solve API → Offline distance adapter: requests estimate
api/server.py - Road distance adapters → Cost matrix: builds matrix
adapters/distance/osrm.py - Offline distance adapter → Cost matrix: builds matrix
adapters/distance/haversine.py - Local solve API → Routing instance: creates instance
api/server.py - Routing instance → Cost matrix: uses costs
core/model/instance.py - Routing instance → Stops and constraints: contains stops
core/model/instance.py - Routing instance → Vehicles: contains vehicles
core/model/instance.py - Stops and constraints → Coordinates: uses coordinates
core/model/stop.py - Local solve API → Solver contract and budget: dispatches solve
api/server.py - Solver contract and budget → Nearest neighbour: defines solver interface
core/solver.py - Solver contract and budget → Exact TSP solvers: defines solver interface
core/solver.py - Solver contract and budget → Held-Karp cross-check: defines solver interface
core/solver.py - Local solve API → Clarke-Wright construction: dispatches fleet construction
api/server.py - Exact TSP solvers → Nearest neighbour: seeds incumbent
core/exact/branch_and_bound.py - Nearest neighbour → Independent feasibility: checks candidate
core/construct/nearest_neighbor.py - Nearest neighbour → Objective scoring: scores candidate
core/construct/nearest_neighbor.py - Clarke-Wright construction → Independent feasibility: checks plan
core/construct/savings.py - Clarke-Wright construction → Objective scoring: scores plan
core/construct/savings.py - Local search and annealing → Independent feasibility: checks moves
core/local/improve.py - Local search and annealing → Objective scoring: scores moves
core/local/improve.py - Local solve API → Independent feasibility: independently validates
api/server.py - Local solve API → Objective scoring: computes result cost
api/server.py - Nearest neighbour → Route solution: creates route
core/construct/nearest_neighbor.py - Exact TSP solvers → Route solution: returns incumbent
core/exact/branch_and_bound.py - Local solve API → Typed solve report: returns report
api/server.py - Typed solve report → Claim and stop status: enforces claims
core/reporting/report.py - Local solve API → Static workbench and map: serves workbench
- Static workbench and map → Local solve API: posts solve request
- Static workbench and map → Evidence viewer: shows generated evidence
- Static workbench and map → Live route replay: offers route replay
- Local solve API → Typed solve report: includes schedules and hashes