Experimental

Builds capacity-constrained multi-depot delivery routes with heterogeneous fleet controls, objective modes, and optional local optimization.

vector network routing optimization

## Parameters

Name | Description | Required | Default
--- | --- | --- | ---
`network` | Input line network layer (validated for contract parity). | Required | `network.gpkg`
`depot_points` | Depot point layer; each point can contribute one or more vehicles. | Required | `depots.gpkg`
`stop_points` | Delivery stop point layer. | Required | `stops.gpkg`
`demand_field` | Numeric demand field in stop_points (default: demand). | Optional | `demand`
`priority_field` | Optional stop priority field using values like required/high/normal/low or numeric ranks. | Optional | `priority`
`allowed_vehicle_profiles_field` | Optional stop field listing compatible vehicle profiles (comma/semicolon/pipe-delimited). | Optional | —
`allowed_route_classes_field` | Optional alias of allowed_vehicle_profiles_field for route-class compatibility rules. | Optional | —
`depot_id_field` | Optional depot ID field used in route/assignment outputs. | Optional | —
`vehicle_count_field` | Optional depot field for number of vehicles spawned at each depot. | Optional | —
`vehicle_capacity_field` | Optional depot field overriding vehicle_capacity per depot/vehicle template. | Optional | —
`vehicle_fixed_cost_field` | Optional depot field overriding vehicle_fixed_cost per depot/vehicle template. | Optional | —
`travel_speed_field` | Optional depot field overriding travel_speed per depot/vehicle template. | Optional | —
`max_route_distance_field` | Optional depot field overriding max_route_distance per depot/vehicle template. | Optional | —
`max_route_time_field` | Optional depot field overriding max_route_time per depot/vehicle template. | Optional | —
`vehicle_profile_field` | Optional depot field defining vehicle profile/category token used for stop compatibility. | Optional | —
`vehicle_route_class_field` | Optional alias of vehicle_profile_field for route-class compatibility rules. | Optional | —
`vehicle_capacity` | Per-vehicle capacity (> 0). | Required | `100.0`
`vehicle_fixed_cost` | Optional fixed cost charged per dispatched vehicle/route (default: 0). | Optional | `0.0`
`max_vehicles` | Optional maximum number of vehicles/routes to construct. | Optional | —
`max_route_distance` | Optional maximum travel distance per route, including return to depot. | Optional | —
`travel_speed` | Travel speed in coordinate-units per time unit (default: 1). | Optional | —
`max_route_time` | Optional maximum route duration in model time units, including return to depot. | Optional | —
`max_stops_per_vehicle` | Optional maximum number of stops assigned to each vehicle route. | Optional | —
`objective_mode` | Route-construction objective: minimize_distance, minimize_vehicles, or minimize_cost. | Optional | `minimize_distance`
`apply_local_optimization` | When true, applies a deterministic 2-opt local improvement pass to each constructed route (default: true). | Optional | `True`
`apply_simulated_annealing` | When true, applies a seeded simulated annealing refinement pass per route after greedy/local optimization (default: false). | Optional | `False`
`sa_iterations` | Maximum simulated annealing iterations per route when apply_simulated_annealing=true (default: 1500). | Optional | `1500`
`sa_initial_temperature` | Initial simulated annealing temperature (> 0, default: 1.0). | Optional | `1.0`
`sa_cooling_rate` | Simulated annealing cooling multiplier in (0, 1); default 0.995. | Optional | `0.995`
`sa_seed` | Optional deterministic random seed for simulated annealing (default: 42). | Optional | `42`
`output` | Output route line vector path. | Required | —
`assignment_output` | Optional stop assignment point output with visit order/load diagnostics. | Optional | —

## Examples

Builds CVRP routes and writes route lines with deterministic local optimization and optional simulated annealing controls.

    wbe.vehicle_routing_cvrp(apply_local_optimization=True, apply_simulated_annealing=False, demand_field='demand', depot_points='depots.gpkg', network='network.gpkg', objective_mode='minimize_distance', output='cvrp_routes.gpkg', priority_field='priority', sa_cooling_rate=0.995, sa_initial_temperature=1.0, sa_iterations=1500, sa_seed=42, stop_points='stops.gpkg', vehicle_capacity=100.0, vehicle_fixed_cost=0.0)

## Project Links

WbW Homepage User Manual Support WbW