Expand description
Primitive weighted graph helpers.
The crate provides a small weighted-edge type plus adjacency builders and a few helpers for summarizing edge weights.
§Examples
use use_weighted_graph::{WeightedEdge, build_weighted_directed_adjacency, path_weight};
let edge = WeightedEdge::new(0, 1, 2.5).unwrap();
let adjacency = build_weighted_directed_adjacency(2, &[edge]).unwrap();
assert_eq!(adjacency, vec![vec![(1, 2.5)], vec![]]);
assert_eq!(path_weight(&[edge]), Some(2.5));Structs§
Enums§
Functions§
- build_
weighted_ directed_ adjacency - build_
weighted_ undirected_ adjacency - max_
weight_ edge - min_
weight_ edge - path_
weight