pub struct SolomonInstance {
pub name: String,
pub vehicle: VehicleConfig,
pub num_nodes: usize,
pub xs: Vec<f32>,
pub ys: Vec<f32>,
pub demands: Vec<f32>,
pub ready_times: Vec<f32>,
pub due_times: Vec<f32>,
pub service_times: Vec<f32>,
pub distance_matrix: Vec<f32>,
}Expand description
A parsed Solomon CVRP instance with contiguous memory layouts (SoA) optimized for CPU caching and direct GPU device transfers.
Fields§
§name: StringInstance identifier / name (e.g., “C101”).
vehicle: VehicleConfigFleet and vehicle capacity settings.
num_nodes: usizeTotal number of nodes (1 depot at index 0 + N customers).
xs: Vec<f32>X-coordinates of all nodes (depot at index 0).
ys: Vec<f32>Y-coordinates of all nodes (depot at index 0).
demands: Vec<f32>Demand of each node (depot demand at index 0 is always 0.0).
ready_times: Vec<f32>Ready times for time-window constraints (available for rich VRP extensions).
due_times: Vec<f32>Due times for time-window constraints.
service_times: Vec<f32>Service times at each customer.
distance_matrix: Vec<f32>Flattened 1D row-major euclidean distance matrix of size num_nodes * num_nodes.
Distance from node i to node j is accessed via distance_matrix[i * num_nodes + j].
Implementations§
Source§impl SolomonInstance
impl SolomonInstance
Sourcepub fn validate(&self) -> Result<(), &'static str>
pub fn validate(&self) -> Result<(), &'static str>
Validates the public arrays and the symmetric CVRP cost model.
Call this after constructing or mutating an instance manually. Validation is O(n²), including finite, nonnegative, symmetric distances.