The vehicle routing problem generalizes the traveling salesperson problem. With a single vehicle, it is the puzzle of visiting every stop once and returning to the start by the shortest path. With a fleet, a solver must also decide which vehicle serves which stop and in what order. Delivery companies, waste collectors, school bus planners and field-service teams all face versions of it.

Common variants

  • Capacitated VRP (CVRP). Each vehicle can carry only so much, so a van cannot take every parcel.
  • VRP with time windows (VRPTW). Each stop must be served inside a stated interval.
  • Pickup and delivery. A load must be collected at one place and dropped at another by the same vehicle.

Why the objective matters

Minimizing total distance alone can produce an odd result: with no other limits, one vehicle can serve every stop. Google’s OR-Tools documentation suggests minimizing the length of the longest single route instead, which fits the goal of finishing all deliveries as soon as possible and balances work across drivers.

How it is solved

The number of possible stop orderings explodes as stops are added, so practical solvers use heuristics. A typical open-source solver builds a first plan with a rule such as repeatedly adding the cheapest next leg, then improves it by local search. The quality of the result depends heavily on the distance or travel-time matrix fed to it, which is often built from a mapping service.

Where AI fits

Machine learning usually improves the inputs, such as predicted travel times, service durations and demand forecasts, while a classical optimization solver builds the routes. Our worked explainer, how delivery routes are optimized, walks through an OR-Tools example, and our overview of AI in logistics and supply chains covers wider uses.

Sources: Google for Developers, “Vehicle Routing Problem” (OR-Tools); Wikipedia, “Vehicle routing problem”.