Maximum cardinality matching


Maximum cardinality matching is a fundamental problem in graph theory.
We are given a graph, and the goal is to find a matching containing as many edges as possible, that is, a maximum cardinality subset of the edges such that each vertex is adjacent to at most one edge of the subset. As each edge will cover exactly two vertices, this problem is equivalent to the task of finding a matching that covers as many vertices as possible.
An important special case of the maximum cardinality matching problem is when G is a bipartite graph, whose vertices V are partitioned between left vertices in X and right vertices in Y, and edges in E always connect a left vertex to a right vertex. In this case, the problem can be efficiently solved with simpler algorithms than in the general case.

Algorithms for bipartite graphs

The simplest way to compute a maximum cardinality matching is to follow the Ford–Fulkerson algorithm. This algorithm solves the more general problem of computing the maximum flow, but can be easily adapted: we simply transform the graph into a flow network by adding a source vertex to the graph with an having to all left vertices in X, adding a sink vertex having an edge from all right vertices in Y, keeping all edges between X and Y, and giving a capacity of 1 to each edge. The Ford–Fulkerson algorithm will then proceed by repeatedly finding an augmenting path from some to some and updating the matching M by taking the symmetric difference of that path with M. As each path can be found in time, the running time is, and the maximum matching consists of the edges of E that carry flow from X to Y.
An improvement to this algorithm is given by the more elaborate Hopcroft–Karp algorithm, which searches for multiple augmenting paths simultaneously. This algorithm runs in time.
The algorithm of Chandran and Hochbaum for bipartite graphs runs in time that depends on the size of the maximum matching, which for is. Using boolean operations on words of size the complexity is further improved to.
More efficient algorithms exist for special kinds of bipartite graphs:
The blossom algorithm finds a maximum-cardinality matching in general graphs. It runs in time. A better performance of for general graphs, matching the performance of the Hopcroft–Karp algorithm on bipartite graphs, can be achieved with the much more complicated algorithm of Micali and Vazirani. The same bound was achieved by an algorithm by Blum and an algorithm by Gabow and Tarjan.
An alternative approach uses randomization and is based on the fast matrix multiplication algorithm. This gives a randomized algorithm for general graphs with complexity. This is better in theory for sufficiently dense graphs, but in practice the algorithm is slower.
Other algorithms for the task are reviewed by Duan and Pettie. In terms of approximation algorithms, they also point out that the blossom algorithm and the algorithms by Micali and Vazirani can be seen as approximation algorithms running in linear time for any fixed error bound.

Applications and generalizations