Expand description
Memory-efficient graph operations: sparse COO representations, graph Laplacians, adaptive coarsening, and chunked neighbor aggregation. Memory-efficient graph operations.
This module provides utilities that keep memory usage proportional to the number of edges rather than the number of node pairs:
SparseGraphstores a graph in coordinate (COO) form, extracting only the non-negligible entries of a dense adjacency matrix.sparse_laplacianbuilds the (optionally symmetric-normalized) graph Laplacian directly in COO form without ever materializing the densenum_nodes x num_nodesmatrix.adaptive_coarseningreduces a graph to a target number of supernodes using greedy edge-contraction (union-find), averaging the node features of each contracted cluster.chunked_neighbor_aggregationperforms mean neighbor aggregation using a sparse adjacency list (O(E)memory) and processes destination nodes in bounded-size chunks for cache locality.
Structs§
- Sparse
Graph - Sparse coordinate (COO) representation of a graph or graph operator.
Functions§
- adaptive_
coarsening - Coarsen
graphdown to at mosttarget_nodessupernodes. - chunked_
neighbor_ aggregation - Mean-aggregate each node’s neighbor features.
- sparse_
laplacian - Build the graph Laplacian directly in sparse COO form.