GPU Graph Algorithms
Overview​
@luma.gl/graph/gpu-graph-algorithms provides graph-data structures and algorithms that compose inside a
caller-owned GPUCommandGraph. It keeps adjacency, traversal frontiers, scores, partitions, and
layouts GPU-resident so analysis can feed another analysis or a renderer without downloading the
graph through JavaScript.
When to use it​
Use GPU Graph Algorithms for repeated analytics over a graph already stored on the GPU, especially when results will drive filtering, styling, layout, or later graph operations. For a single small graph or an algorithm whose result is immediately needed on the CPU, a CPU graph library may be simpler.
Quick start​
import {GPUCommandGraph} from '@luma.gl/graph/gpu-core';
import {GPUGraphAlgorithmsData, GPUGraphAlgorithmsPageRank, GPUGraphAlgorithmsTopology} from '@luma.gl/graph/gpu-graph-algorithms';
const graph = new GPUCommandGraph({device, id: 'graph-analysis'});
const topology = new GPUGraphAlgorithmsTopology({device, graph, edges, vertexCount});
const pageRank = new GPUGraphAlgorithmsPageRank({device, graph, topology});
pageRank.addPasses();
const compiledGraph = graph.compile();
The application compiles, encodes, submits, and decides whether a bounded result should be read back. Operations contribute nodes and graph views only.
Core concepts and data model​
GPUGraphAlgorithmsDatadescribes canonical vertex and edge identity.GPUGraphAlgorithmsTopologybuilds reusable adjacency views for algorithms that need neighbors.- Algorithms publish ordinary graph buffers and bounded status so their outputs compose.
- Iterative operations expose capacity, convergence, and incomplete-result behavior explicitly.
- Weighted, directed, and undirected semantics are operation-specific and documented in the operations reference.
Explore a live graph​
Operations and API index​
| Family | Operations |
|---|---|
| Graph and topology | GPUGraphAlgorithmsData, GPUGraphAlgorithmsTopology, GPUGraphAlgorithmsDegree |
| Traversal and paths | GPUGraphAlgorithmsBreadthFirstSearch, GPUGraphAlgorithmsSingleSourceShortestPath |
| Connectivity and communities | GPUGraphAlgorithmsConnectedComponents, GPUGraphAlgorithmsCoreNumber, GPUGraphAlgorithmsLabelPropagation, GPUGraphAlgorithmsModularityOptimization |
| Metrics and ranking | GPUGraphAlgorithmsLocalClusteringCoefficient, GPUGraphAlgorithmsModularity, GPUGraphAlgorithmsPageRank |
| Layout | GPUGraphAlgorithmsForceLayout, GPUGraphAlgorithmsSpatialForceLayout |
The operations reference documents usage, buffers, execution, capacity, validation, and performance for each family.
Limits and compatibility​
- GPU Graph is experimental and WebGPU-only.
- Algorithms use fixed compiled capacities and report convergence or incomplete work explicitly.
- The caller owns source buffers, submission, readback, and cancellation.
- Algorithm support for weights, directionality, self-edges, and parallel edges is documented per operation.
Related modules​
- GPU Core provides scheduling and generic GPU operations.
- GPU Dataframe analyzes columnar records rather than graph topology.
- GPU Trace adds trace-specific dependency and hierarchy semantics.