NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Optimal Streaming Algorithms for Graph Matching

Jianer Chen, Qin Huang, Iyad Kanj, Ge XiaarXiv 2021

Abstract

This paper introduces optimal, one-pass streaming algorithms for finding maximum-weight $k$-matchings in both dynamic and insert-only graph streams. Crucially, it achieves optimal space and update times without relying on the restrictive "promise" used in prior work—the unrealistic assumption that the graph's overall maximum matching is bounded by $k$—making these algorithms much more robust for massive, real-world data streams.

Introduction

In modern big-data applications, graphs such as social networks or web links are often too massive to store in memory. Instead, they are processed in a streaming model, where edges arrive sequentially. The algorithm must maintain a small "sketch" of the graph in limited memory and process each new edge very quickly.

A classic problem in this space is finding a $k$-matching: a set of $k$ edges that do not share any vertices. In a weighted graph, the goal is to find the $k$-matching with the highest possible total weight. Previous state-of-the-art algorithms for this problem required a "promise," meaning they only functioned if the entire graph's matching size was known to be small. This research tackles the challenge of finding a maximum-weight $k$-matching efficiently without such a priori knowledge.

Methodology

The authors design algorithms for two standard streaming models: Insert-Only (edges are only added) and Dynamic (edges can be inserted and deleted).

The $k$-Subset Hashing Toolkit (Dynamic Model)

To remove the "promise" requirement, the authors developed a novel two-phase hashing technique. They use $O(\log k)$-wise independent hash functions to partition the graph's vertices into buckets, followed by universal hash functions to isolate specific elements.

The two-phase hashing strategy used to isolate elements of a k-subset from a larger universe.

As illustrated in the figure above, this mathematically guarantees that the $2k$ vertices making up the optimal $k$-matching will land in completely disjoint buckets. Once isolated, the algorithm uses $\ell_0$-samplers (a standard streaming data structure) to randomly sample edges between these buckets and reconstruct the matching.

Reduced Compact Subgraphs (Insert-Only Model)

For the simpler insert-only model, the algorithm partitions the graph using hashing and maintains an "auxiliary graph" (a kernel) of size $O(k^2)$. As new edges stream in, the algorithm constantly updates this small subgraph, keeping only the heaviest edges between different partitions. This ensures the small sketch always contains enough information to extract the maximum-weight $k$-matching at the end of the stream.

Key Results

The paper achieves mathematically optimal bounds (up to poly-logarithmic factors) for space and update time:

  • Insert-only model: The algorithm computes a maximum-weight $k$-matching using $O(k^2)$ space and $O(1)$ update time per edge.
  • Dynamic model: The algorithm uses $\tilde{O}(Wk^2)$ space and $\tilde{O}(1)$ update time, where $W$ is the number of distinct edge weights. For unweighted graphs ($W=1$), this is optimal.
  • Approximation: To handle cases where $W$ is large, the authors provide a $(1+\epsilon)$-approximation algorithm that reduces the space requirement to $\tilde{O}(k^2 \epsilon^{-1} \log W')$, where $W'$ is the ratio of the maximum to minimum edge weight.

Discussion and Theoretical Insights

Beyond the specific algorithms, the paper provides two major theoretical contributions:

  1. Breaking the Promise: The most significant conceptual leap is proving that you don't need to bound the graph's total matching size to find a $k$-matching efficiently. The new hashing toolkit successfully isolates the target $k$-matching even if it is buried inside a graph containing a massively larger matching.
  2. Hardness of Changing Weights: The authors prove a lower bound showing that if you allow the weights of existing edges to change dynamically during the stream, the problem requires memory linear to the size of the entire graph. This justifies the standard streaming assumption that an edge's weight remains constant once it is inserted.

Limitations and Future Work

The primary limitation is in the dynamic streaming model for exact weighted matchings: the space complexity scales linearly with $W$ (the number of distinct edge weights). If a graph has millions of unique weights, the memory footprint could become too large, necessitating the use of the approximation algorithm. An important open question remains: Is it possible to design a dynamic streaming algorithm for exact weighted $k$-matching that runs in $\tilde{O}(k^2)$ space without depending on $W$?

Summary updated

BibTeX
@misc{chen2021optimal,
  author = {Jianer Chen and Qin Huang and Iyad Kanj and Ge Xia},
  title = {{Optimal Streaming Algorithms for Graph Matching}},
  year = {2021},
  eprint = {2102.06939},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2102.06939},
}
Figure