1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
use crateEdgeWeightFormat;
use crateEdgeWeightType;
/// Represents the unified edge‑weight representation used by this library.
///
/// In the VRPLib specification, edge weights are described using two separate
/// fields: `EDGE_WEIGHT_TYPE` and `EDGE_WEIGHT_FORMAT`. For explicit
/// edge‑weight matrices (`EDGE_WEIGHT_TYPE = EXPLICIT`), the
/// `EDGE_WEIGHT_FORMAT` field determines how the matrix is stored, including
/// various compressed layouts. For coordinate‑based types such as `EUC_2D` or
/// `GEO`, the edge weights are computed from node coordinates and the
/// `EDGE_WEIGHT_FORMAT` field is not used.
///
/// `EdgeWeightKind` provides a unified abstraction that merges these concepts
/// into a single representation used internally by this library, allowing the
/// loader and instance builder to treat all supported formats consistently.
///
/// Currently, only the `LowerRow` and `Euc2D` format is supported.
///
/// - `LowerRow`: The lower triangular part of a symmetric matrix is listed
/// row by row, excluding the diagonal. This corresponds to VRPLib’s
/// `EDGE_WEIGHT_FORMAT = LOWER_ROW` when used with `EDGE_WEIGHT_TYPE = EXPLICIT`.
/// - `Euc2D`: The edge weights are computed as the Euclidean distance between
/// 2D coordinates. This corresponds to VRPLib’s `EDGE_WEIGHT_TYPE = EUC_2D` with no
/// `EDGE_WEIGHT_FORMAT`.