Skip to main content

build_distributed_graph

Function build_distributed_graph 

Source
pub fn build_distributed_graph(
    edges: &[(usize, usize)],
    n_vertices: usize,
    config: &DistributedGraphConfig,
) -> DistributedGraph
Expand description

Build a DistributedGraph from an edge list.

Steps:

  1. Assign each vertex to a partition using the configured method.
  2. Assign each edge to a shard:
    • EdgeCut / HashBased: edge goes to the source vertex’s shard.
    • VertexCut: edge goes to the shard of the endpoint with fewer edges.
    • Fennel: same as EdgeCut after FENNEL vertex assignment.
  3. Record mirror vertices for cross-shard edges.
  4. Build vertex_map for O(1) location queries.