Expand description
Distributed graph storage with partitioned adjacency.
This module provides data structures and algorithms for partitioning large graphs across multiple logical shards, enabling distributed-memory graph processing without a single monolithic adjacency representation.
§Overview
A DistributedGraph splits vertices across GraphShards according to
a chosen GraphPartitionMethod. Cross-shard edges create mirror
vertices — lightweight replicas used to route messages during distributed
algorithms without accessing the remote shard.
| Method | Description |
|---|---|
GraphPartitionMethod::HashBased | vertex % n_partitions (round-robin, zero overhead) |
GraphPartitionMethod::EdgeCut | Same as hash; edges of a vertex live on its shard |
GraphPartitionMethod::VertexCut | Edge lives on the shard of the lower-degree endpoint |
GraphPartitionMethod::Fennel | Streaming FENNEL greedy assignment (Tsourakakis 2014) |
§Example
use scirs2_graph::distributed::{build_distributed_graph, DistributedGraphConfig, distributed_degree};
let edges: Vec<(usize, usize)> = (0..5).flat_map(|i| (i+1..5).map(move |j| (i, j))).collect();
let cfg = DistributedGraphConfig::default();
let dg = build_distributed_graph(&edges, 5, &cfg);
assert!(distributed_degree(&dg, 0).is_some());Structs§
- Distributed
Graph - Distributed graph: a collection of shards with a global vertex map.
- Distributed
Graph Config - Configuration for
build_distributed_graph. - Distributed
Stats - Summary statistics for a distributed graph.
- Graph
Shard - A single partition (shard) of the distributed graph.
- Vertex
Location - Location of a vertex in the distributed graph.
Enums§
- Graph
Partition Method - Method used to partition a graph’s vertices across shards.
Functions§
- build_
distributed_ graph - Build a
DistributedGraphfrom an edge list. - distributed_
degree - Return the degree of
vertexby counting edges in its home shard. - distributed_
graph_ stats - Compute load-balance and edge-cut statistics for a distributed graph.
- distributed_
neighbors - Return all neighbours of
vertexby scanning its home shard’s edge list. - fennel_
partition - Streaming FENNEL partition assignment (Tsourakakis et al. 2014).
- hash_
partition - Hash-partition: assign vertex to
vertex % n_partitions.