PRO Production

Workflow-grade Pro analysis with audit-ready outputs.

workflow pro

## Workflow Narrative

Fleet Routing and Dispatch Optimization

### Who It Is For

- Logistics dispatch teams planning daily vehicle assignments.
- Municipal waste and field-maintenance operations with constrained fleet capacity/time.
- Courier and distribution operations requiring transparent route exceptions.

### Primary User

Logistics operations leaders, municipal service planners, and fleet-dispatch platform teams.

### What It Does

- Optimizes vehicle dispatch plans across depots and stops for logistics and field operations.
- Builds feasible routes under capacity and shift-time constraints.
- Produces assignment, KPI, and exception outputs for operations review.
- Supports objective mode selection (`minimize_distance`, `minimize_time`, `minimize_cost`, `balanced`).

### How It Works

- Parses depot and stop layers plus fleet specifications from `vehicles_csv`.
- Harmonizes depot/stop CRS to the network CRS when EPSG metadata is available and validates projected CRS for distance/time calculations.
- Filters infeasible stops where demand exceeds max vehicle capacity.
- Applies objective-aware greedy nearest-feasible stop construction for initial route assignment (`distance`, `time`, `cost`, `balanced`).
- Applies optional edge restrictions from CSV (`from_x,from_y,to_x,to_y,closed,penalty_factor`) as closures or impedance penalties.
- Runs local 2-opt sequence refinement for incremental route improvement.
- Computes per-route and fleet KPIs and emits exceptions with reason codes.

## Inputs

Parameter | Type | Required | Description
--- | --- | --- | ---
`network` | LineVector path | Required | Street/network layer used by routing workflow
`depots` | PointVector path | Required | Depot or start/end locations for vehicles
`stops` | PointVector path | Required | Stops/tasks to assign to routes
`vehicles_csv` | path | Required | Fleet specs (vehicle_id, capacity, available_time_minutes, cost_per_minute, cost_per_km, depot_id)
`objective` | string | Optional | Objective mode: `minimize_distance`, `minimize_time`, `minimize_cost`, `balanced`
`restrictions` | path | Optional | Optional restrictions CSV (`from_x,from_y,to_x,to_y[,closed][,penalty_factor]`) used for edge closures or impedance penalties
`routes_output` | vector path | Required | Output route vector path
`assignment_csv_output` | path | Required | Output stop-to-route assignment CSV
`route_kpis_csv_output` | path | Required | Output per-route/fleet KPI CSV
`exceptions_csv_output` | path | Required | Output infeasible stop diagnostics CSV

## Outputs

Output | Type | Contents
--- | --- | ---
`routes_output` | Vector | Route geometries and route-level summaries by vehicle
`assignment_csv_output` | CSV | stop_id, route_id, vehicle_id, sequence_order, arrival/departure times
`route_kpis_csv_output` | CSV | Per-route metrics and fleet roll-up summary
`exceptions_csv_output` | CSV | stop_id with reason code (`demand_exceeds_max_vehicle_capacity`, `no_feasible_route`)

## Python Example

    env = WbEnvironment(license_tier="pro")

    result = env.run_tool("fleet_routing_and_dispatch_optimizer",
        network="city_network.gpkg",
        depots="depots.gpkg",
        stops="daily_stops.gpkg",
        vehicles_csv="fleet_specs.csv",
        objective="minimize_cost",
        routes_output="output/routes.gpkg",
        assignment_csv_output="output/assignments.csv",
        route_kpis_csv_output="output/route_kpis.csv",
        exceptions_csv_output="output/exceptions.csv",
    )

    print(result)

## License Notice

Use of this function requires a license for Whitebox Workflows Professional (WbW-Pro). Please visit www.whiteboxgeo.com to purchase a license.

## Project Links

WbW Homepage User Manual Support WbW