use-graph-path 0.0.1

Primitive path validation and unweighted shortest-path helpers
Documentation
  • Coverage
  • 5.88%
    1 out of 17 items documented1 out of 12 items with examples
  • Size
  • Source code size: 7.65 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 394.16 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 25s Average build duration of successful builds.
  • all releases: 25s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-graph
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

Primitive path helpers.

The crate keeps path handling explicit through a small Path wrapper and a breadth-first shortest-path helper for unweighted graphs.

Examples

use use_graph_path::{Path, is_valid_path, shortest_path_unweighted};

let adjacency = vec![vec![1], vec![2], vec![]];
let shortest = shortest_path_unweighted(&adjacency, 0, 2).unwrap().unwrap();
let path = Path::new(vec![0, 1, 2]).unwrap();

assert_eq!(shortest.nodes(), &[0, 1, 2]);
assert!(is_valid_path(&adjacency, path.nodes()).unwrap());