GPU Graph
Overview
@luma.gl/gpgpu/gpu-graph 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 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/gpgpu/gpu-core';
import {GPUGraph, GPUGraphPageRank, GPUGraphTopology} from '@luma.gl/gpgpu/gpu-graph';
const graph = new GPUCommandGraph({device, id: 'graph-analysis'});
const topology = new GPUGraphTopology({device, graph, edges, vertexCount});
const pageRank = new GPUGraphPageRank({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
GPUGraphdescribes canonical vertex and edge identity.GPUGraphTopologybuilds 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 | GPUGraph, GPUGraphTopology, GPUGraphDegree |
| Traversal and paths | GPUGraphBreadthFirstSearch, GPUGraphSingleSourceShortestPath |
| Connectivity and communities | GPUGraphConnectedComponents, GPUGraphCoreNumber, GPUGraphLabelPropagation, GPUGraphModularityOptimization |
| Metrics and ranking | GPUGraphLocalClusteringCoefficient, GPUGraphModularity, GPUGraphPageRank |
| Layout | GPUGraphForceLayout, GPUGraphSpatialForceLayout |
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.