Click canvas: add customer · click dot: remove · drag depot to move
Depot Route 1 Route 2 Route 3+ Unrouted (capacity exceeded)

Vehicle Routing Problem: Nearest-Neighbor + 2-opt Simulator

This simulator solves a real Capacitated Vehicle Routing Problem (CVRP) in your browser: a depot ships to a set of customer points, each with its own demand, using a fleet whose vehicles each carry a fixed capacity. A nearest-neighbor construction heuristic builds an initial set of routes greedily, then a genuine 2-opt local search repeatedly tests reversing pairs of route edges and keeps only the reversals that strictly shorten total Euclidean travel distance, converging toward a local optimum the way production routing engines do. Add or remove customers, drag the depot, and tune vehicle capacity and fleet size to see how the constructed routes, their total length, and the number of vehicles needed all change in response — with a live before/after comparison of nearest-neighbor distance versus the 2-opt-improved distance.