Skip to main content

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

  • GPUGraph describes canonical vertex and edge identity.
  • GPUGraphTopology builds 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

Loading interactive example…

Operations and API index

FamilyOperations
Graph and topologyGPUGraph, GPUGraphTopology, GPUGraphDegree
Traversal and pathsGPUGraphBreadthFirstSearch, GPUGraphSingleSourceShortestPath
Connectivity and communitiesGPUGraphConnectedComponents, GPUGraphCoreNumber, GPUGraphLabelPropagation, GPUGraphModularityOptimization
Metrics and rankingGPUGraphLocalClusteringCoefficient, GPUGraphModularity, GPUGraphPageRank
LayoutGPUGraphForceLayout, 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.
  • 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.