Graph Theory-Bipartite Graph

[Overview]
Bipartite graph, also called even graph, is a special model in graph theory.

Let G=(V,E) be an undirected graph, if vertex V can be divided into two disjoint subsets (A, B), and each edge (i, j) in the graph is associated with two If the vertices i and j belong to these two different vertex sets (i ∈ A, j ∈ B), then the graph G is called a bipartite graph.

The necessary and sufficient conditions are: there are at least two points in the graph G, and the length of all loops in the graph are even numbers.

In simple terms, the vertex set V can be divided into two disjoint subsets, and the two vertices attached to each edge in the graph belong to these two disjoint subsets, and the vertices in the two subsets Not adjacent.

When the vertices in the graph are divided into two sets, so that all the vertices in the first set are connected with all the vertices in the second set, then it is a special bipartite graph, called a complete bipartite graph.
Insert picture description here
[Basic concepts]
1. Matching
Given a bipartite graph G, in a subgraph M of G, if any two edges in the edge set of M are not attached to the same vertex, then M is said to be a match.
Simply put, matching is a set of edges in a bipartite graph, where any two edges have no common vertices.
As shown in the figure, the red edge is a match.
Insert picture description here
Define matching points , matching edges , unmatched points , and non-matching edges . Their meaning is very obvious. For example, in the above figure 1, 4, 5, and 7 are matching points, other vertices are unmatched points; 1-5, 4-7 are matching edges, and the other edges are non-matching edges.
2. Maximum matching
Given all the matches in the bipartite graph G, the match with the most matching edges is called the maximum matching of this graph. The problem of selecting the maximum matching is the maximum matching problem of the graph.
As shown in the figure, the red edge is a maximum match.

3. Complete match In
a match, each vertex in the graph is associated with an edge in the graph, then this match is called a complete match, that is, in a certain match of a graph, all vertices are matching points, which is a Exact match.
Obviously, since any point of a perfect match has already been matched, adding a new matching edge will definitely conflict with the existing matching edge, so a perfect match must be the maximum match. But it should be noted that not every graph has an exact match.
In simple terms, for a bipartite graph, each point in the left point set matches a point in the right point set, or every point in the right point set matches a point in the left point set.
4. Perfect match
For a bipartite graph, the number of points in the left point set and the right point set is the same. If there is a match, including all the vertices of the left point set and the right point set, it is called a perfect match.
In simple terms, for a bipartite graph, every point in the left point set matches a point in the right point set, and every point in the right point set matches a point in the left point set.
As shown in the figure below, the match connected by the red line is not only a perfect match, but also a perfect match.
5. Maximum matching problem For
example, as shown in the figure below, if there is a connecting edge between a pair of boys and girls, it means that they like each other. Is it possible to pair all boys and girls in pairs so that each pair likes each other? This is the exact match problem. And how many boys/girls who like each other can be paired? This is the maximum matching problem.

6. Optimal matching
The complete match with the largest weight of the weighted bipartite graph is called the best match. It should be noted that the optimal match of the bipartite graph is not necessarily the maximum weight match of the bipartite graph.

In essence, the optimal matching problem is the maximum matching problem of finding the edge weight and the maximum.

Solution skills: You can add some edges with a weight of 0 to unify the optimal matching and the maximum weight matching.
[Related Algorithms]
1. Bipartite graph judgment
2. Hungary algorithm
3. KM algorithm
Among them, Hungary algorithm is often used to find the maximum matching number, minimum point coverage, maximum independent set, minimum path coverage, etc.; KM algorithm is often used to find the best Matching, edge weights and minimum perfect matching, minimum directed ring coverage weights and optimal matching constructed with original matching edges.
On the coverage and independent set of DAG graphs

Guess you like

Origin blog.csdn.net/yueyuedog/article/details/112589732