pub fn map_weighted(
num_vertices: usize,
edges: &[(usize, usize)],
) -> Result<MappingResult, ReductionError>Expand description
Map a graph to a weighted triangular lattice grid graph using optimal path decomposition.
This is the main entry point for triangular lattice mapping. It uses automatic path decomposition (exact for ≤30 vertices, greedy for larger).
§Arguments
num_vertices- Number of vertices in the original graphedges- Edge list as (u, v) pairs
§Returns
A MappingResult containing the grid graph and mapping metadata.
§Errors
Returns ReductionError if the input graph or generated dimensions are invalid.
§Example
use problemreductions::rules::unitdiskmapping::triangular::mapping::map_weighted;
use problemreductions::topology::Graph;
let edges = vec![(0, 1), (1, 2)];
let result = map_weighted(3, &edges).unwrap();
assert!(result.to_triangular_subgraph().num_vertices() > 0);