use-graph-metrics 0.0.1

Primitive graph size, degree, and density helpers
Documentation
  • Coverage
  • 10%
    1 out of 10 items documented1 out of 10 items with examples
  • Size
  • Source code size: 6.1 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 289.02 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 18s Average build duration of successful builds.
  • all releases: 18s 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 graph metrics.

The crate provides small helpers for counting nodes and edges, inspecting degrees, and computing simple directed or undirected densities.

Examples

use use_graph_metrics::{average_degree, density_directed, edge_count_directed, max_degree};

let adjacency = vec![vec![1, 2], vec![2], vec![]];

assert_eq!(edge_count_directed(&adjacency), 3);
assert_eq!(max_degree(&adjacency), Some(2));
assert_eq!(average_degree(&adjacency), Some(1.0));
assert_eq!(density_directed(&adjacency), Some(0.5));