A Weighted Approach to the Maximum Cardinality Bipartite Matching Problem with Applications in Geometric Settings

Nathaniel Lahn, Sharath Raghvendra

Abstract

We present a weighted approach to compute a maximum cardinality matching in an arbitrary bipartite graph. Our main result is a new algorithm that takes as input a weighted bipartite graph $G(A\cup B,E)$ with edge weights of $0$ or $1$. Let $w \leq n$ be an upper bound on the weight of any matching in $G$. Consider the subgraph induced by all the edges of $G$ with a weight $0$. Suppose every connected component in this subgraph has $\mathcal{O}(r)$ vertices and $\mathcal{O}(mr/n)$ edges. We present an algorithm to compute a maximum cardinality matching in $G$ in $\tilde{\mathcal{O}}( m(\sqrt{w}+ \sqrt{r}+\frac{wr}{n}))$ time. When all the edge weights are $1$, our algorithm is identical to the well-known Hopcroft-Karp (HK) algorithm, which runs in $\mathcal{O}(m\sqrt{n})$ time. However, if we can carefully assign weights of $0$ and $1$ on its edges such that both $w$ and $r$ are sub-linear in $n$ and $wr=\mathcal{O}(n^{\gamma})$ for $\gamma < 3/2$, then we can compute maximum cardinality matching in $G$ in $o(m\sqrt{n})$ time. Using our algorithm, we obtain a new $\tilde{\mathcal{O}}(n^{4/3}/\varepsilon^4)$ time algorithm to compute an $\varepsilon$-approximate bottleneck matching of $A,B\subset\mathbb{R}^2$ and an $\frac{1}{\varepsilon^{\mathcal{O}(d)}}n^{1+\frac{d-1}{2d-1}}\mathrm{poly}\log n$ time algorithm for computing $\varepsilon$-approximate bottleneck matching in $d$-dimensions. All previous algorithms take $\Omega(n^{3/2})$ time.

Introduction

The Maximum Cardinality Bipartite Matching (MCBM) problem is a fundamental challenge in combinatorial optimization. For nearly five decades, the Hopcroft-Karp (HK) algorithm has served as the standard benchmark, providing a complexity of $O(m\sqrt{n})$. While improvements have been made for specific graph classes, such as planar graphs, a general barrier has persisted at $O(n^{1.5})$ for dense graphs. This paper introduces a novel weighted reduction strategy that breaks this barrier for specific graph structures, particularly those arising in geometric settings.

The Weighted Reduction Framework

The core innovation of this work is the transformation of an unweighted bipartite matching problem into a strategically weighted one. By assigning weights of 0 or 1 to edges, the algorithm can prioritize certain paths and reduce the total number of computational phases.

Graph Partitioning and Weighting

The algorithm partitions the graph into connected components (or "pieces") consisting solely of 0-weight edges. Let $r$ represent the number of vertices in a piece and $w$ represent the maximum weight of any matching in the graph. By ensuring that most edges are "free" (weight 0), the algorithm focuses its computational effort on the "expensive" (weight 1) edges that bridge different pieces.

Primal-Dual Execution

The algorithm utilizes a primal-dual framework, alternating between two primary stages:

  1. Hungarian Search: A modified Dijkstra-like search updates dual weights on vertices to identify the shortest augmenting paths.
  2. DFS Augmentation: A Depth-First Search (DFS) identifies and applies multiple augmenting paths simultaneously.

To optimize this process, the authors introduce the "Affected Piece" trick. In standard algorithms, edges visited by a failed DFS are typically deleted. Here, the algorithm preserves edges belonging to "affected pieces"—components that were part of a successful augmentation. This allows for higher edge reuse and reduces the total number of phases from the standard $O(\sqrt{n})$ to $O(\sqrt{w})$.

Geometric Bottleneck Matching

The most significant application of this weighted approach is in Geometric Bottleneck Matching. In this problem, given two sets of points in $d$-dimensional space, the goal is to find a perfect matching that minimizes the maximum distance between any matched pair.

To solve the $\varepsilon$-approximate version of this problem, the authors employ a Geometric Sparsification technique. They use a grid-based "compact residual network" to represent the graph. This allows the algorithm to handle the potential $O(n^2)$ edges of a complete bipartite graph without explicitly constructing them, maintaining the efficiency required to beat the $O(n^{1.5})$ limit.

Theoretical Results

As a theoretical contribution, the paper's results are established through rigorous mathematical proofs rather than empirical benchmarks. The key findings include:

  • General Bound: A new complexity bound of $\tilde{O}(m(\sqrt{w} + \sqrt{r} + \frac{wr}{n}))$.
  • 2D Geometric Matching: The first algorithm to achieve $\tilde{O}(n^{4/3}/\varepsilon^4)$ for $\varepsilon$-approximate bottleneck matching in $\mathbb{R}^2$, successfully breaking the $n^{1.5}$ barrier.
  • High-Dimensional Matching: For $d$ dimensions, the complexity is $\frac{1}{\varepsilon^{O(d)}} n^{1 + \frac{d-1}{2d-1}} \text{poly log } n$, which remains sub-quadratic for any fixed $d$.
  • Graphs with Separators: For graphs possessing balanced vertex separators of size $n^\delta$, the matching time is improved to $\tilde{O}(mn^{\frac{\delta}{1+\delta}})$.

Conclusion and Future Work

This research demonstrates that adding weights to an unweighted problem can, counterintuitively, lead to faster solutions by exploiting graph structure. While the current speedups are dependent on the existence of small separators or geometric proximity, they represent a major step forward in algorithmic graph theory. Future work remains to determine if exact bottleneck matching can be achieved in sub-quadratic time for general bipartite graphs and to optimize the constant factors associated with the grid-based constructions in geometric settings.

Summary updated

Abstract

We present a weighted approach to compute a maximum cardinality matching in an arbitrary bipartite graph. Our main result is a new algorithm that takes as input a weighted bipartite graph $G(A\cup B,E)$ with edge weights of $0$ or $1$. Let $w \leq n$ be an upper bound on the weight of any matching in $G$. Consider the subgraph induced by all the edges of $G$ with a weight $0$. Suppose every connected component in this subgraph has $\mathcal{O}(r)$ vertices and $\mathcal{O}(mr/n)$ edges. We present an algorithm to compute a maximum cardinality matching in $G$ in $\tilde{\mathcal{O}}( m(\sqrt{w}+ \sqrt{r}+\frac{wr}{n}))$ time. When all the edge weights are $1$ (symmetrically when all weights are $0$), our algorithm will be identical to the well-known Hopcroft-Karp (HK) algorithm, which runs in $\mathcal{O}(m\sqrt{n})$ time. However, if we can carefully assign weights of $0$ and $1$ on its edges such that both $w$ and $r$ are sub-linear in $n$ and $wr=\mathcal{O}(n^{\gamma})$ for $\gamma < 3/2$, then we can compute maximum cardinality matching in $G$ in $o(m\sqrt{n})$ time. Using our algorithm, we obtain a new $\tilde{\mathcal{O}}(n^{4/3}/\varepsilon^4)$ time algorithm to compute an $\varepsilon$-approximate bottleneck matching of $A,B\subset\mathbb{R}^2$ and an $\frac{1}{\varepsilon^{\mathcal{O}(d)}}n^{1+\frac{d-1}{2d-1}}\mathrm{poly}\log n$ time algorithm for computing $\varepsilon$-approximate bottleneck matching in $d$-dimensions. All previous algorithms take $\Omega(n^{3/2})$ time. Given any graph $G(A \cup B,E)$ that has an easily computable balanced vertex separator for every subgraph $G'(V',E')$ of size $|V'|^{\delta}$, for $\delta\in [1/2,1)$, we can apply our algorithm to compute a maximum matching in $\tilde{\mathcal{O}}(mn^{\frac{\delta}{1+\delta}})$ time improving upon the $\mathcal{O}(m\sqrt{n})$ time taken by the HK-Algorithm.
BibTeX
@article{lahn2020weighted,
  author = {Nathaniel Lahn and Sharath Raghvendra},
  title = {{A Weighted Approach to the Maximum Cardinality Bipartite Matching Problem with Applications in Geometric Settings}},
  journal = {J. Comput. Geom.},
  year = {2020},
  url = {https://openreview.net/forum?id=g1DQBaSU86},
}
Figure