Matching or independent set of edges is a set with no common edges in a graph. Finding a match in a bipartite graph is equivalent to the network flow problem.
Graph matching algorithm are commonly used in OI. It can be generally divided into maximum matching and maximum weight matching. We will first introduce the bipartite graph, and then propose solutions for general graphs.
Matching¶
In graph theory, suppose the graph
A set of edges that have no common vertices in pairs
Define the size of the match as the number of edges
When the graph is weighted, the match with maximum sum of edges' weights is maximum weight matching.
The edges in the match are called matched edges, and the opposite are called unmatched edges.
If a vertex belongs to
Maximal matching: No more matching edges can be added. It may not be the maximum match. Maximum matching: The match with the maximum number of matches. Perfect matching/Complete matching/1-factor: All vertices belong to the matching, and also meet the maximum match. Near-perfect matching: The number of vertices in the graph is odd, and there is exactly one vertex that is not in the match. The graph after removing this vertex is called factor-critical graph.
Maximal matching maximum matching
Bipartite graph matching¶
The matching on a bipartite graph is called bipartite matching.
Let
Complete match¶
Let
Hall's Theorem¶
Let bipartite graph
Maximum matching¶
Finding maximum number of matching edges in bipartite graph is called the maximum matching problem.
Algorithm¶
A basic problem in combinatorial optimization is to find maximum matching.
Bipartite graph maximum matching¶
In the unweighted bipartite graph, the Hopcroft-Karp algorithm can be used to solve the problem in
Bipartite graph maximum weight matching¶
In the weighted bipartite graph, it can be solved by Hungarian algorithm.
If the Bellman–Ford algorithm is used to find the shortest path, the time complexity is
General graph maximum matching¶
In the unweighted general graph, the Edmonds' blossom algorithm can be used to solve the problem in
General graph maximum weight matching¶
In the weighted general graph, the Edmonds' blossom algorithm can be used to solve the problem in
References¶
- [1]Wikiwand - Matching (graph theory)
- [2]Wikiwand - Blossom algorithm
- [3]2015 Talking about the matching algorithm of graph and its application"- Chen Yinbo
- [4]Algorithm notes - Matching
- [5]the-tourist/algo
- [6]Bill Yang's Blog - Blossom Algorithm learning notes (original link in Chinese)
- [7]Bipartite graph maximum matching, perfect matching and Hungarian algorithm (original link in Chinese)
- [8]Wikiwand - Hopcroft–Karp algorithm
buildLast update and/or translate time of this article,Check the history
editFound smelly bugs? Translation outdated? Wanna contribute with us? Edit this Page on Github
peopleContributor of this article accelsao
translateTranslator of this article Visit the original article!
copyrightThe article is available under CC BY-SA 4.0 & SATA ; additional terms may apply.