Skip to main content

Crate petgraph_live

Crate petgraph_live 

Source
Expand description

petgraph-live — graph cache, snapshot, and algorithms for petgraph 0.8.

§Features

FeatureDescription
(default)cache, metrics, connect, shortest_path, mst
snapshotDisk persistence via bincode or JSON
snapshot-zstdZstd compression for snapshots (implies snapshot)
snapshot-lz4LZ4 compression via lz4_flex (implies snapshot)

Enabling snapshot also gates [live], which composes the cache with snapshot lifecycle.

§Quick start

use petgraph_live::cache::GenerationCache;
use std::sync::Arc;

let cache: GenerationCache<Vec<u32>> = GenerationCache::new();
let g: Arc<Vec<u32>> = cache.get_or_build(1, || Ok::<_, ()>(vec![1, 2, 3])).unwrap();
assert_eq!(*g, vec![1, 2, 3]);

See README for more examples.

Modules§

cache
connect
Connectivity analysis: articulation points and bridges.
metrics
Distance-based graph characteristics.
mst
Minimum spanning tree algorithms.
shortest_path
Shortest path algorithms.