|
|
|
|
Matching
|
| |
|
| |
In the mathematical discipline of graph theory a matching or edge-independent set in a graph is a set of edges without common vertices. It may also be an entire graph consisting of edges without common vertices.
Definition Given a graph G = (V,E), a matching M in G is a set of pairwise non-adjacent edges; that is, no two edges share a common vertex.
A vertex is matched if it is incident to an edge in the matching.

Discussion
Ask a question about 'Matching'
Start a new discussion about 'Matching'
Answer questions from other users
|
Encyclopedia
In the mathematical discipline of graph theory a matching or edge-independent set in a graph is a set of edges without common vertices. It may also be an entire graph consisting of edges without common vertices.
Definition Given a graph G = (V,E), a matching M in G is a set of pairwise non-adjacent edges; that is, no two edges share a common vertex.
A vertex is matched if it is incident to an edge in the matching. Otherwise the vertex is unmatched.
A maximal matching is a matching M of a graph G with the property that if any edge not in M is added to M, it is no longer a matching, that is, M is maximal if it is not a proper subset of any other matching in graph G. In other words, a matching M of a graph G is maximal if every edge in G has a non-empty intersection with at least one edge in M. The following figure shows examples of maximal matchings in three graphs.
-
A maximum matching is a matching that contains the largest possible number of edges. There may be many maximum matchings. The matching number of a graph is the size of a maximum matching. Note that every maximum matching is maximal, but not every maximal matching is a maximum matching. The following figure shows examples of maximum matchings in three graphs.
-
A perfect matching is a matching which matches all vertices of the graph. That is, every vertex of the graph is incident to exactly one edge of the matching. Every perfect matching is maximum and hence maximal. In some literature, the term complete matching is used. In the above figure, part (b) shows a perfect matching. A perfect matching is also a minimum-size edge cover.
A near-perfect matching is one in which exactly one vertex is unmatched. This can only occur when the graph has an odd number of vertices, and such a matching must be maximum. In the above figure, part (c) shows a near-perfect matching. If, for every vertex in a graph, there is a near-perfect matching that omits only that vertex, the graph is also called factor-critical.
Given a matching M,
- an alternating path is a path in which the edges belong alternatively to the matching and not to the matching.
- an augmenting path is an alternating path that starts from and ends on free (unmatched) vertices.
One can prove that a matching is maximum if and only if it does not have any augmenting path. (This result is sometimes called Berge's Lemma).
Properties In any graph without isolated vertices, the sum of the matching number and the edge covering number equals the number of vertices. If there is a perfect matching, then both the matching number and the edge cover number are |V|/2.
If A and B are two maximal matchings, then |A| = 2|B| and |B| = 2|A|. To see this, observe that each edge in A \ B can be adjacent to at most two edges in B \ A because B is a matching. Since each edge in B \ A is adjacent to an edge in A \ B by maximality, we see that
Further we get that
In particular, this shows that any maximal matching is a 2-approximation of a maximum matching and also a 2-approximation of a minimum maximal matching. This inequality is tight: for example, if G is a path with 3 edges and 4 nodes, the size of a minimum maximal matching is 1 and the size of a maximum matching is 2.
Algorithms and computational complexity
Maximum bipartite matchings Matching problems are often concerned with bipartite graphs. Finding a maximum bipartite matching (often called a maximum cardinality bipartite matching) in a bipartite graph is perhaps the simplest problem. The augmenting path algorithm finds it by finding an augmenting path from each to and adding it to the matching if it exists. As each path can be found in time, the running time is . This solution is equivalent to adding a super source with edges to all vertices in , and a super sink with edges from all vertices in , and finding a maximal flow from to . All edges with flow from to then constitute a maximum matching. An improvement over this is the Hopcroft-Karp algorithm, which runs in time. Another approach is based on the fast matrix multiplication algorithm and gives complexity, which is better in theory, but in practice the algorithm is slower.
In a weighted bipartite graph, each edge has an associated value. A maximum weighted bipartite matching is defined as a perfect matching where the sum of the values of the edges in the matching have a maximal value. If the graph is not complete bipartite, missing edges are inserted with value zero. Finding such a matching is known as the assignment problem. It can be solved by using a modified shortest path search in the augmenting path algorithm. If the Bellman-Ford algorithm is used, the running time becomes , or the edge cost can be shifted with a potential to achieve running time with the Dijkstra algorithm and Fibonacci heap. The remarkable Hungarian algorithm solves the assignment problem and it was one of the beginnings of combinatorial optimization algorithms. The original approach of this algorithm need running time, but it could be improved to time with extensive use of priority queues.
Maximum matchings There is a polynomial time algorithm to find a maximum matching or a maximum weight matching in a graph that is not bipartite; it is due to Jack Edmonds, is called the paths, trees, and flowers method, and uses bidirected edges. A generalization of the same technique can also be used to find maximum independent sets in claw-free graphs. Edmonds' algorithm has subsequently been improved to run in time time, matching the time for bipartite maximum matching.
Algorithm by Mucha and Sankowski, based on the fast matrix multiplication algorithm, gives complexity.
Maximal matchings A maximal matching can be found with a simple greedy algorithm. A maximum matching is also a maximal matching, and hence it is possible to find a largest maximal matching in polynomial time. However, no polynomial-time algorithm is known for finding a minimum maximal matching, that is, a maximal matching that contains the smallest possible number of edges.
Note that a maximal matching with k edges is an edge dominating set with k edges. Conversely, if we are given a minimum edge dominating set with k edges, we can construct a maximal matching with k edges in polynomial time. Therefore the problem of finding a minimum maximal matching is essentially equal to the problem of finding a minimum edge dominating set. Both of these two optimisation problems are known to be NP-hard; the decision versions of these problems are classical examples of NP-complete problems. Both problems can be approximated within factor 2 in polynomial time: simply find an arbitrary maximal matching M.
Counting problems The problem of determining the number of perfect matchings in a given graph is #P Complete (see Permanent). However, a remarkable theorem of Kasteleyn states that the number of perfect matchings in a planar graph can be computed exactly in polynomial time. Also, for bipartite graphs, the problem can be approximately solved in polynomial time. That is, for any e>0, there is a probabilistic polynomial time algorithm that determines, with high probability, the number of perfect matchings M within an error of at most eM.
For the problem of determining the total number of matchings in a given graph, see Hosoya index.
Applications A Kekulé structure of an aromatic compound consists of a perfect matching of its carbon skeleton, showing the locations of double bonds in the chemical structure. These structures are named after Friedrich August Kekulé von Stradonitz, who showed that benzene (in graph theoretical terms, a 6-vertex cycle) can be given such a structure.
The Hosoya index is the total number of matchings of a graph; it is used in computer chemistry investigations for organic compounds.
See also
Additional reading
-
-
-
-
External links
- [https://lemon.cs.elte.hu/ A graph library with Hopcroft-Karp and Push-Relabel based maximum cardinality matching implementation ]
|
| |
|
|