Vehicle Routing
Vehicle Routing Problem (VRP) with capacity, time windows, and driver constraints
Preview problem type vrp manifest 2.0
Objectives#
What the solver optimizes. Enabled objectives are weighed together.
Objective What it means Direction On by default Weight
Minimize Total Time minimize_timeMinimize aggregate route time across all vehicles (travel + service) Yes 2.0 Minimize Total Distance minimize_distanceMinimize the total distance traveled by all vehicles Yes 1.0 Minimize Vehicles Used minimize_vehiclesMinimize the number of vehicles required minimize Yes 0.7
The setup values you send with a problem. The console renders them as form fields.
Problem Size#
Input Name Type Required Default Description
n_customersNumber of Customers number Yes 50 Delivery/pickup locations to visit n_vehiclesNumber of Vehicles number Yes 5 Available vehicles for routing
Vehicle Configuration#
Input Name Type Required Default Description
vehicle_capacityVehicle Capacity number No 100 Maximum load capacity per vehicle
Geographic Settings#
Input Name Type Required Default Description
depot_latDepot Latitude number No 33.749 Latitude of the depot/starting location depot_lonDepot Longitude number No -84.388 Longitude of the depot/starting location radius_milesRadius (miles) number No 50 Radius around depot for customer generation distance_metricDistance Metric select No haversine How distances between coordinates are measured. 'haversine' reads [lat, lon] in km; 'euclidean' reads planar [x, y]; 'euclidean_rounded' rounds each leg to an integer, the convention of published capacitated-routing benchmarks. With a planar metric, speed_kmh is coordinate units per hour.
Demand Configuration#
Input Name Type Required Default Description
demand_distributionDemand Distribution select No uniform How customer demand is generated
Solver Settings#
Input Name Type Required Default Description
use_osrmUse Road Network (OSRM) boolean No True Use real road distances and speed limits instead of straight-line estimates. Requires OSRM server. speed_kmhAverage Speed (km/h) number No 32.19 Fallback average vehicle speed when OSRM is not available. Default is 20 mph city driving (32.19 km/h). service_timeService Time (minutes) number No 3 Default service time per customer stop when not using per-customer dataset values. service_time_per_customerUse Per-Customer Service Time boolean No True Use each customer's service_time value from dataset instead of the default. vrp_solverVRP Solver select No auto Routing engine (sent as options.engine). 'auto' picks the best engine installed where the solve runs and names it in the result. polish_tncTNC Polish boolean No Apply 7-operator TNC steepest descent after main solver for extra refinement.
Constraints#
A hard constraint must hold or the problem is infeasible; a soft one adds a penalty when broken.
Constraint What it requires Kind On by default
Vehicle Capacity vehicle_capacityEach vehicle cannot exceed its load capacity hard Yes Pickup & Delivery Capacity pickup_delivery_capacityHandle both pickup (adds to load) and delivery (removes from load) hard No Maximum Driver Hours max_driver_hoursMaximum driving/working hours per route hard Yes Customer Time Windows time_windowsCustomers must be visited within specified time windows hard No Driver Breaks driver_breaksMandatory break requirements during routes soft No Visit All Customers visit_all_customersAll customers must be visited exactly once hard Yes Return to Depot return_to_depotVehicles must return to depot after completing route hard Yes Minimize Vehicles Used minimize_vehicles_constraintUse as few vehicles as possible soft Yes Vehicle Types vehicle_typesUse different vehicle types with varying capacities and speeds hard No Route Balance route_balanceBalance workload across drivers soft No Driver-Customer Affinity driver_affinityPrefer assigning drivers to customers they've served before soft No
Feasibility checks#
Checked before a solve, so an impossible problem is refused with the reason.
Check What it tests On failure
Fleet capacity Total stop demand must fit inside n_vehicles x vehicle capacity. fail Single-stop capacity No single stop may demand more than one vehicle carries. fail Time-window reachability Each stop's window must be reachable on a direct trip from the depot, and the vehicle must be able to return before the depot closes. fail Shift length Each stop's out-and-back trip (drive + service) must fit inside the longest vehicle shift. fail Fleet shift hours Total service time must fit inside the fleet's summed shift hours. fail
Presets#
Named starting sets of constraints.
Preset Use it for Constraints
Basic VRP basicSimple capacity-constrained routing vehicle_capacity, visit_all_customers, return_to_depot, minimize_vehicles_constraintTime-Constrained VRP time_constrainedRouting with time windows and driver hour limits vehicle_capacity, max_driver_hours, time_windows, visit_all_customers, return_to_depotCommercial Delivery commercial_deliveryFull-featured routing for commercial delivery operations vehicle_capacity, max_driver_hours, time_windows, driver_breaks, visit_all_customers, return_to_depot, minimize_vehicles_constraint, driver_affinity
On this page