Matching (graph theory)
In the mathematical discipline of
Definitions
Given a
A vertex is matched (or saturated) if it is an endpoint of one of the edges in the matching. Otherwise the vertex is unmatched (or unsaturated).
A maximal matching is a matching M of a graph G that is not a subset of any other matching. 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 (red) in three graphs.
A maximum matching (also known as maximum-cardinality matching[2]) is a matching that contains the largest possible number of edges. There may be many maximum matchings. The matching number of a graph G is the size of a maximum matching. Every maximum matching is maximal, but not every maximal matching is a maximum matching. The following figure shows examples of maximum matchings in the same three graphs.
A perfect matching is a matching that matches all vertices of the graph. That is, a matching is perfect if every vertex of the graph is incident to an edge of the matching. A matching is perfect if |E|=|V|/2. Every perfect matching is maximum and hence maximal. In some literature, the term complete matching is used. In the above figure, only part (b) shows a perfect matching. A perfect matching is also a minimum-size edge cover. Thus, the size of a maximum matching is no larger than the size of a minimum edge cover: . A graph can only contain a perfect matching when the graph has an even number of vertices.
A near-perfect matching is one in which exactly one vertex is unmatched. Clearly, a graph can only contain a near-perfect matching when the graph has an
Given a matching M, an alternating path is a path that begins with an unmatched vertex
An induced matching is a matching that is the edge set of an induced subgraph.[4]
Properties
In any graph without isolated vertices, the sum of the matching number and the
If A and B are two maximal matchings, then |A| ≤ 2|B| and |B| ≤ 2|A|. To see this, observe that each edge in B \ A can be adjacent to at most two edges in A \ B because A is a matching; moreover each edge in A \ B is adjacent to an edge in B \ A by maximality of B, hence
Further we deduce 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 vertices, the size of a minimum maximal matching is 1 and the size of a maximum matching is 2.
A spectral characterization of the matching number of a graph is given by Hassani Monfared and Mallik as follows: Let be a graph on vertices, and be distinct nonzero purely imaginary numbers where . Then the
Matching polynomials
A generating function of the number of k-edge matchings in a graph is called a matching polynomial. Let G be a graph and mk be the number of k-edge matchings. One matching polynomial of G is
Another definition gives the matching polynomial as
where n is the number of vertices in the graph. Each type has its uses; for more information see the article on matching polynomials.
Algorithms and computational complexity
Maximum-cardinality matching
A fundamental problem in combinatorial optimization is finding a maximum matching. This problem has various algorithms for different classes of graphs.
In an unweighted bipartite graph, the optimization problem is to find a
Maximum-weight matching
In a
In a non-bipartite weighted graph, the problem of maximum weight matching can be solved in time using
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.
A maximal matching with k edges is an
Counting problems
The number of matchings in a graph is known as the
The number of perfect matchings in a complete graph Kn (with n even) is given by the double factorial (n − 1)!!.[13] The numbers of matchings in complete graphs, without constraining the matchings to be perfect, are given by the telephone numbers.[14]
The number of perfect matchings in a graph is also known as the hafnian of its adjacency matrix.
Finding all maximally matchable edges
One of the basic problems in matching theory is to find in a given graph all edges that may be extended to a maximum matching in the graph (such edges are called maximally matchable edges, or allowed edges). Algorithms for this problem include:
- For general graphs, a deterministic algorithm in time and a randomized algorithm in time .[15][16]
- For bipartite graphs, if a single maximum matching is found, a deterministic algorithm runs in time .[17]
Online bipartite matching
The problem of developing an online algorithm for matching was first considered by Richard M. Karp, Umesh Vazirani, and Vijay Vazirani in 1990.[18]
In the online setting, nodes on one side of the bipartite graph arrive one at a time and must either be immediately matched to the other side of the graph or discarded. This is a natural generalization of the secretary problem and has applications to online ad auctions. The best online algorithm, for the unweighted maximization case with a random arrival model, attains a competitive ratio of 0.696.[19]
Characterizations
Hall's marriage theorem provides a characterization of bipartite graphs which have a perfect matching and the Tutte theorem provides a characterization for arbitrary graphs.
Applications
Matching in general graphs
- A Kekulé structure of an
- The Hosoya index is the number of non-empty matchings plus one; it is used in computational chemistry and mathematical chemistry investigations for organic compounds.
- The Chinese postman problem involves finding a minimum-weight perfect matching as a subproblem.
Matching in bipartite graphs
- Graduation problem is about choosing minimum set of classes from given requirements for graduation.
- Hitchcock transport problem involves bipartite matching as sub-problem.
- Subtree isomorphism problem involves bipartite matching as sub-problem.
See also
- Matching in hypergraphs - a generalization of matching in graphs.
- Fractional matching.
- Dulmage–Mendelsohn decomposition, a partition of the vertices of a bipartite graph into subsets such that each edge belongs to a perfect matching if and only if its endpoints belong to the same subset
- Edge coloring, a partition of the edges of a graph into matchings
- Matching preclusion, the minimum number of edges to delete to prevent a perfect matching from existing
- Rainbow matching, a matching in an edge-colored bipartite graph with no repeated colors
- Skew-symmetric graph, a type of graph that can be used to model alternating path searches for matchings
- Stable matching, a matching in which no two elements prefer each other to their matched partners
- Independent vertex set, a set of vertices (rather than edges) no two of which are adjacent to each other
- Stable marriage problem (also known as stable matching problem)
References
- ^ "is_matching". NetworkX 2.8.2 documentation. Retrieved 2022-05-31.
Each node is incident to at most one edge in the matching. The edges are said to be independent.
- ^ Alan Gibbons, Algorithmic Graph Theory, Cambridge University Press, 1985, Chapter 5.
- ^ "Preview".
- MR 1011265
- ^ Gallai, Tibor (1959), "Über extreme Punkt- und Kantenmengen", Ann. Univ. Sci. Budapest. Eötvös Sect. Math., 2: 133–138.
- ^ Keivan Hassani Monfared and Sudipta Mallik, Theorem 3.6, Spectral characterization of matchings in graphs, Linear Algebra and its Applications 496 (2016) 407–419, https://doi.org/10.1016/j.laa.2016.02.004, https://arxiv.org/abs/1602.03590
- S2CID 7904683
- doi:10.1137/0138030.
- ISBN 0-7167-1045-5. Edge dominating set (decision version) is discussed under the dominating set problem, which is the problem GT2 in Appendix A1.1. Minimum maximal matching (decision version) is the problem GT10 in Appendix A1.1.
- ^ Ausiello, Giorgio; Crescenzi, Pierluigi; Gambosi, Giorgio; Kann, Viggo; Marchetti-Spaccamela, Alberto; Protasi, Marco (2003), Complexity and Approximation: Combinatorial Optimization Problems and Their Approximability Properties, Springer. Minimum edge dominating set (optimisation version) is the problem GT3 in Appendix B (page 370). Minimum maximal matching (optimisation version) is the problem GT10 in Appendix B (page 374). See also Minimum Edge Dominating Set and Minimum Maximal Matching in the web compendium.
- ^ Leslie Valiant, The Complexity of Enumeration and Reliability Problems, SIAM J. Comput., 8(3), 410–421
- S2CID 755231.
- Bibcode:2009arXiv0906.1317C.
- PMID 16201918.
- ^ Cheriyan, Joseph (1997), "Randomized algorithms for problems in matching theory",
- .
- .
- .
Further reading
- MR 0859549
- ISBN 0-262-53196-8)
{{citation}}
: CS1 maint: multiple names: authors list (link - András Frank (2004). On Kuhn's Hungarian Method – A tribute from Hungary (PDF) (Technical report). Egerváry Research Group.
- S2CID 7904683.
- S. J. Cyvin & Ivan Gutman (1988), Kekule Structures in Benzenoid Hydrocarbons, Springer-Verlag
- ISBN 978-0-19-850162-6