Expand description
Graph construction and analysis with cache-optimized CSR representation.
This module provides high-performance graph algorithms built on top of Compressed Sparse Row (CSR) format for maximum cache locality. Key features:
- CSR representation (50-70% memory reduction vs HashMap)
- Centrality measures (degree, betweenness, PageRank)
- Parallel algorithms using Rayon
- Numerical stability (Kahan summation in PageRank)
§Examples
use aprender::graph::Graph;
let g = Graph::from_edges(&[(0, 1), (1, 2), (2, 0)], false);
let dc = g.degree_centrality();
assert_eq!(dc.len(), 3);Structs§
- Edge
- Graph edge with optional weight.
- Graph
- Graph structure using CSR (Compressed Sparse Row) for cache efficiency.
Type Aliases§
- NodeId
- Graph node identifier (contiguous integers for cache efficiency).