Skip to main content

Crate solverforge_cvrp

Crate solverforge_cvrp 

Source
Expand description

CVRP domain helpers for SolverForge.

Provides ProblemData, MatrixDistanceMeter, MatrixIntraDistanceMeter, the VrpSolution trait, and a suite of free functions for Clarke-Wright and k-opt construction phases.

Structs§

MatrixDistanceMeter
Cross-entity distance meter backed by the solution’s distance matrix.
MatrixIntraDistanceMeter
Intra-entity distance meter backed by the solution’s distance matrix.
ProblemData
Immutable problem data shared by all vehicles.

Traits§

VrpSolution
Trait implemented by a planning solution that holds a fleet of vehicles, each carrying a *const ProblemData pointer and a list of visited stops.

Functions§

assign_route
Assigns a constructed route to the given vehicle.
capacity
Returns the vehicle capacity.
depot_for_cw
Returns the depot index for Clarke-Wright (plan-level, not per-entity).
depot_for_entity
Returns the depot index (same for all vehicles).
distance
Distance between two element indices using the first vehicle’s data pointer.
element_load
Returns the demand (load) for a single customer element.
get_route
Returns the current route for entity entity_idx.
is_kopt_feasible
K-opt feasibility gate: returns true if the route satisfies all time-window constraints. The entity_idx parameter is ignored — time windows are uniform across vehicles.
is_time_feasible
Returns true if the route satisfies all time-window constraints.
set_route
Replaces the current route for entity entity_idx.