Skip to main content

Module distributed

Module distributed 

Source
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.

MethodDescription
GraphPartitionMethod::HashBasedvertex % n_partitions (round-robin, zero overhead)
GraphPartitionMethod::EdgeCutSame as hash; edges of a vertex live on its shard
GraphPartitionMethod::VertexCutEdge lives on the shard of the lower-degree endpoint
GraphPartitionMethod::FennelStreaming 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§

DistributedGraph
Distributed graph: a collection of shards with a global vertex map.
DistributedGraphConfig
Configuration for build_distributed_graph.
DistributedStats
Summary statistics for a distributed graph.
GraphShard
A single partition (shard) of the distributed graph.
VertexLocation
Location of a vertex in the distributed graph.

Enums§

GraphPartitionMethod
Method used to partition a graph’s vertices across shards.

Functions§

build_distributed_graph
Build a DistributedGraph from an edge list.
distributed_degree
Return the degree of vertex by 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 vertex by 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.