Skip to main content

bfs_parallel

Function bfs_parallel 

Source
pub fn bfs_parallel(
    adj: &CsrMatrix,
    sources: &[NodeId],
) -> Result<Vec<Distance>>
Expand description

Parallel BFS implementation (frontier-based).

Uses level-synchronous approach suitable for GPU parallelization:

  1. Process all nodes in current frontier in parallel
  2. Collect next frontier
  3. Repeat until no more nodes to explore

On CPU, this uses rayon for parallelism (when available). The same algorithm structure maps directly to GPU kernels.