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

Efficient Kernelization Algorithm for Bipartite Graph Matching

Guang Wu, Xinbiao Gan, Zhengbin Pang, Bo Huang, Bopin RanarXiv 2024 · DOI

Abstract

Bipartite graph matching is a fundamental problem in computer science with broad applications in resource allocation and crowdsourcing. To handle massive modern datasets, kernelization (data reduction) is used to shrink the graph before running exact algorithms. This paper introduces the Multi-Vertex Merging (MVM) algorithm, which implements the classic Karp-Sipser data reduction rules with near-linear $O(m \log n)$ time complexity. By combining a cache-friendly CSR-like data structure with novel optimization strategies, MVM achieves significant speedups—up to 56x on real-world graphs and over 4,000x on worst-case synthetic instances—while maintaining a low memory footprint.

Introduction

Finding a maximum matching in a bipartite graph involves pairing as many nodes as possible from two distinct sets. As datasets scale to millions of vertices and edges, the computational cost of exact matching algorithms becomes prohibitive. Kernelization serves as a critical preprocessing step, applying data reduction rules to shrink the graph while preserving the properties needed to find a maximum matching.

The Karp-Sipser (KS) rules are the standard for this reduction. Rule 1 involves removing degree-1 nodes, which is straightforward. Rule 2, which involves merging degree-2 nodes, is significantly more complex to implement efficiently. Existing approaches often rely on theoretical data structures like hash tables or red-black trees, which suffer from poor cache performance on real hardware.

The MVM Algorithm

The Multi-Vertex Merging (MVM) algorithm addresses these limitations through three primary strategies:

  1. Multi-Vertex Merging Strategy: Instead of sequential, one-by-one merges, MVM identifies groups of adjacent mergeable vertices and processes them in batches. This minimizes the overhead of structural modifications to the graph.
  2. Indirect Set Operations (ISO): MVM avoids expensive set subtractions by tracking vertex access counts during neighborhood traversals. If a vertex is accessed a number of times equal to its degree minus one, it is identified as mergeable, making the identification process nearly "free."
  3. Balanced Processing Strategy (BP): To ensure robustness against adversarial graph structures, MVM employs a bucket-based approach to balance the workload, preventing bottlenecks caused by high-degree boundary vertices.
The Karp-Sipser data reduction rules: Rule 1 (top) removes degree-1 nodes, while Rule 2 (bottom) merges degree-2 nodes.

Hardware-Aware Data Structures

A key contribution of MVM is its use of a modified Compressed Sparse Row (CSR) format. Unlike standard CSR, which is static, MVM's version supports dynamic updates through linked edge tables and batch modifications. This design maintains the sequential memory access patterns favored by modern CPUs, bridging the gap between theoretical complexity and practical performance.

Updating the edge array in the CSR-like structure before and after vertex merging operations.

Experimental Results

MVM was evaluated against 12 real-life graphs and 8 synthetic worst-case instances. On real-world datasets, MVM achieved average speedups of 25x over hash-table-based implementations and 56x over tree-based ones. On synthetic graphs designed to trigger $O(n^2)$ behavior in traditional algorithms, MVM demonstrated its dominance, running up to 4,340x faster on instances with 4 million vertices. Furthermore, using MVM as a pre-processor for the PFP matching algorithm resulted in a 230-fold speedup on the com-LiveJournal dataset.

Conclusion

The MVM algorithm demonstrates that near-linear complexity for bipartite graph kernelization can be achieved without sacrificing hardware efficiency. By combining multi-vertex merging with a cache-friendly data structure, MVM provides a robust and high-performance solution for large-scale graph matching problems. Future work includes exploring parallelization on multi-core and GPU architectures to further enhance scalability.

Summary updated

BibTeX
@misc{wu2024efficient,
  author = {Guang Wu and Xinbiao Gan and Zhengbin Pang and Bo Huang and Bopin Ran},
  title = {{Efficient Kernelization Algorithm for Bipartite Graph Matching}},
  year = {2024},
  eprint = {2412.00704},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.00704},
}
Figure