Solver as a Service
Sign Up Now →Sign Up Now

Vehicle Routing

Vehicle Routing Problem (VRP) with capacity, time windows, and driver constraints

Previewproblem type vrpmanifest 2.0

Objectives#

What the solver optimizes. Enabled objectives are weighed together.

ObjectiveWhat it meansDirectionOn by defaultWeight
Minimize Total Time
minimize_time
Minimize aggregate route time across all vehicles (travel + service)Yes2.0
Minimize Total Distance
minimize_distance
Minimize the total distance traveled by all vehiclesYes1.0
Minimize Vehicles Used
minimize_vehicles
Minimize the number of vehicles requiredminimizeYes0.7

Problem inputs#

The setup values you send with a problem. The console renders them as form fields.

Problem Size#

InputNameTypeRequiredDefaultDescription
n_customersNumber of CustomersnumberYes50Delivery/pickup locations to visit
n_vehiclesNumber of VehiclesnumberYes5Available vehicles for routing

Vehicle Configuration#

InputNameTypeRequiredDefaultDescription
vehicle_capacityVehicle CapacitynumberNo100Maximum load capacity per vehicle

Geographic Settings#

InputNameTypeRequiredDefaultDescription
depot_latDepot LatitudenumberNo33.749Latitude of the depot/starting location
depot_lonDepot LongitudenumberNo-84.388Longitude of the depot/starting location
radius_milesRadius (miles)numberNo50Radius around depot for customer generation
distance_metricDistance MetricselectNohaversineHow 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#

InputNameTypeRequiredDefaultDescription
demand_distributionDemand DistributionselectNouniformHow customer demand is generated

Solver Settings#

InputNameTypeRequiredDefaultDescription
use_osrmUse Road Network (OSRM)booleanNoTrueUse real road distances and speed limits instead of straight-line estimates. Requires OSRM server.
speed_kmhAverage Speed (km/h)numberNo32.19Fallback average vehicle speed when OSRM is not available. Default is 20 mph city driving (32.19 km/h).
service_timeService Time (minutes)numberNo3Default service time per customer stop when not using per-customer dataset values.
service_time_per_customerUse Per-Customer Service TimebooleanNoTrueUse each customer's service_time value from dataset instead of the default.
vrp_solverVRP SolverselectNoautoRouting engine (sent as options.engine). 'auto' picks the best engine installed where the solve runs and names it in the result.
polish_tncTNC PolishbooleanNoApply 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.

ConstraintWhat it requiresKindOn by default
Vehicle Capacity
vehicle_capacity
Each vehicle cannot exceed its load capacityhardYes
Pickup & Delivery Capacity
pickup_delivery_capacity
Handle both pickup (adds to load) and delivery (removes from load)hardNo
Maximum Driver Hours
max_driver_hours
Maximum driving/working hours per routehardYes
Customer Time Windows
time_windows
Customers must be visited within specified time windowshardNo
Driver Breaks
driver_breaks
Mandatory break requirements during routessoftNo
Visit All Customers
visit_all_customers
All customers must be visited exactly oncehardYes
Return to Depot
return_to_depot
Vehicles must return to depot after completing routehardYes
Minimize Vehicles Used
minimize_vehicles_constraint
Use as few vehicles as possiblesoftYes
Vehicle Types
vehicle_types
Use different vehicle types with varying capacities and speedshardNo
Route Balance
route_balance
Balance workload across driverssoftNo
Driver-Customer Affinity
driver_affinity
Prefer assigning drivers to customers they've served beforesoftNo

Feasibility checks#

Checked before a solve, so an impossible problem is refused with the reason.

CheckWhat it testsOn failure
Fleet capacityTotal stop demand must fit inside n_vehicles x vehicle capacity.fail
Single-stop capacityNo single stop may demand more than one vehicle carries.fail
Time-window reachabilityEach 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 lengthEach stop's out-and-back trip (drive + service) must fit inside the longest vehicle shift.fail
Fleet shift hoursTotal service time must fit inside the fleet's summed shift hours.fail

Presets#

Named starting sets of constraints.

PresetUse it forConstraints
Basic VRP
basic
Simple capacity-constrained routingvehicle_capacity, visit_all_customers, return_to_depot, minimize_vehicles_constraint
Time-Constrained VRP
time_constrained
Routing with time windows and driver hour limitsvehicle_capacity, max_driver_hours, time_windows, visit_all_customers, return_to_depot
Commercial Delivery
commercial_delivery
Full-featured routing for commercial delivery operationsvehicle_capacity, max_driver_hours, time_windows, driver_breaks, visit_all_customers, return_to_depot, minimize_vehicles_constraint, driver_affinity