6 releases
| new 0.4.2 | Feb 6, 2026 |
|---|---|
| 0.4.1 | Feb 6, 2026 |
| 0.4.0 | Jan 25, 2026 |
| 0.3.2 | Jan 21, 2026 |
| 0.2.0 | Jan 14, 2026 |
#1049 in Algorithms
105KB
2.5K
SLoC
GPU-accelerated graph algorithm primitives for RingKernel.
This crate provides high-performance graph algorithms optimized for parallel execution on GPUs. It includes:
- CSR Matrix: Compressed Sparse Row format for efficient graph storage
- BFS: Parallel breadth-first search with multiple source support
- SCC: Strongly connected components via forward-backward algorithm
- Union-Find: Parallel disjoint set data structure
- SpMV: Sparse matrix-vector multiplication
Example
use ringkernel_graph::{CsrMatrix, bfs_parallel, NodeId};
// Build adjacency list: 0 -> 1 -> 2
let matrix = CsrMatrix::from_edges(3, &[(0, 1), (1, 2)]);
// Run BFS from node 0
let distances = bfs_parallel(&matrix, &[NodeId(0)]).await?;
assert_eq!(distances[0].0, 0); // Distance to self
assert_eq!(distances[1].0, 1); // Distance to node 1
assert_eq!(distances[2].0, 2); // Distance to node 2
Dependencies
~12–18MB
~260K SLoC