Perfect Matchings in Õ(n^{1.5}) Time in Regular Bipartite Graphs

Ashish Goel, Michael Kapralov, Sanjeev KhannaarXiv 2009 · DOI

Abstract

Finding a perfect matching in a $d$-regular bipartite graph is a fundamental problem in combinatorial optimization. While general bipartite matching takes $O(m\sqrt{n})$ time, regular bipartite graphs allow for faster solutions. This paper introduces a randomized algorithm that achieves an expected running time of $O((n \ln n)^{1.5})$, or more precisely $O(\min\{m, \frac{n^2 \ln^3 n}{d}\})$. The approach utilizes a novel two-stage sampling scheme and a new "Proportionate Uncrossing Theorem" that links Hall's theorem witnesses to graph cuts.

Introduction

A bipartite graph is $d$-regular if every vertex has exactly $d$ neighbors. For such graphs, a perfect matching—a set of edges covering every vertex exactly once—is guaranteed to exist. Historically, algorithms like Hopcroft-Karp have provided $O(m\sqrt{n})$ bounds for general graphs. In the $d$-regular case, $O(m)$ was the standard. However, for dense graphs where $m = nd \approx n^2$, this is inefficient. This work pushes the boundary to $\tilde{O}(n^{1.5})$, bridging the gap between dense and sparse graph performance.

Methodology: Two-Stage Sampling

The core innovation is a sampling pipeline that reduces a dense $d$-regular graph to a sparse subgraph with only $O(n \log n)$ edges while preserving at least one perfect matching with high probability.

  1. Uniform Sampling: Initial reduction of edge density.
  2. Non-Uniform Sampling: Utilizing an adaptation of the Benczür-Karger scheme. While Benczür-Karger is typically used to preserve cut sizes, the authors extend it to preserve the existence of perfect matchings.
  3. Proportionate Uncrossing Theorem: This theorem is the mathematical bridge. It establishes a correspondence between the sets of vertices that could violate Hall's Marriage Theorem (witnesses) and the cuts in the graph. By preserving cuts, the algorithm implicitly preserves the conditions necessary for a perfect matching.
Visualizing the correspondence between Hall's theorem witnesses and graph cuts through the uncrossing of vertex sets.
  1. Refined Hopcroft-Karp: Once the graph is sparsified to $O(n \log n)$ edges, the Hopcroft-Karp algorithm is applied. The authors provide a tighter analysis specifically for these sampled graphs to ensure the $\tilde{O}(n^{1.5})$ total time.

Key Insights

The "aha" moment lies in the Proportionate Uncrossing Theorem. In bipartite graphs, the existence of a matching is tied to Hall's Theorem: for every subset of vertices $S$ on one side, its neighborhood $N(S)$ must satisfy $|N(S)| \ge |S|$. The authors found a way to "uncross" these sets so they behave like graph cuts, allowing the use of powerful sparsification tools that were previously restricted to cut-preservation problems.

Results and Applications

The algorithm achieves an expected time of $O(\min\{m, \frac{n^2 \ln^3 n}{d}\})$. For any $d$, this simplifies to $\tilde{O}(n^{1.5})$.

Beyond graph theory, this result has immediate implications for linear algebra. The authors show that a perfect matching in the support of an $n \times n$ doubly stochastic matrix (where rows and columns sum to 1) can be found in $\tilde{O}(m + n^{1.5})$ time. This improves upon previous precision-dependent bounds.

Conclusion

By combining randomized sampling with deep structural theorems about bipartite graphs, this work provides a near-optimal algorithm for a classic problem. While the algorithm is randomized, it sets a new benchmark for efficiency in regular bipartite matching. Future research may look toward a deterministic version or further reducing the polylogarithmic factors to reach a truly linear-time $O(n \text{ polylog } n)$ bound.

Summary updated

Abstract

We consider the well-studied problem of finding a perfect matching in $d$-regular bipartite graphs with $2n$ vertices and $m = nd$ edges. While the best-known algorithm for general bipartite graphs (due to Hopcroft and Karp) takes $O(m \sqrt{n})$ time, in regular bipartite graphs, a perfect matching is known to be computable in $O(m)$ time. Very recently, the $O(m)$ bound was improved to $O(\min\{m, \frac{n^{2.5}\ln n}{d}\})$ expected time, an expression that is bounded by $\tilde{O}(n^{1.75})$. In this paper, we further improve this result by giving an $O(\min\{m, \frac{n^2\ln^3 n}{d}\})$ expected time algorithm for finding a perfect matching in regular bipartite graphs; as a function of $n$ alone, the algorithm takes expected time $O((n\ln n)^{1.5})$. To obtain this result, we design and analyze a two-stage sampling scheme that reduces the problem of finding a perfect matching in a regular bipartite graph to the same problem on a subsampled bipartite graph with $O(n\ln n)$ edges that has a perfect matching with high probability. The matching is then recovered using the Hopcroft-Karp algorithm. While the standard analysis of Hopcroft-Karp gives us an $\tilde{O}(n^{1.5})$ running time, we present a tighter analysis for our special case that results in the stronger $\tilde{O}(\min\{m, \frac{n^2}{d} \})$ time mentioned earlier. Our proof of correctness of this sampling scheme uses a new correspondence theorem between cuts and Hall's theorem ``witnesses'' for a perfect matching in a bipartite graph that we prove. We believe this theorem may be of independent interest; as another example application, we show that a perfect matching in the support of an $n \times n$ doubly stochastic matrix with $m$ non-zero entries can be found in expected time $\tilde{O}(m + n^{1.5})$.
BibTeX
@misc{goel2009perfect,
  author = {Ashish Goel and Michael Kapralov and Sanjeev Khanna},
  title = {{Perfect Matchings in Õ(n^\{1.5\}) Time in Regular Bipartite Graphs}},
  year = {2009},
  eprint = {0902.1617},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/0902.1617},
}

Loading related content...

Figure