HOME

TheInfoList



OR:

In the mathematical discipline of
graph theory In mathematics, graph theory is the study of '' graphs'', which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of '' vertices'' (also called ''nodes'' or ''points'') which are conn ...
, a matching or independent edge set in an undirected
graph Graph may refer to: Mathematics *Graph (discrete mathematics), a structure made of vertices and edges **Graph theory, the study of such graphs and their properties *Graph (topology), a topological space resembling a graph in the sense of discre ...
is a set of edges without common vertices. Finding a matching in a
bipartite graph In the mathematical field of graph theory, a bipartite graph (or bigraph) is a graph whose vertices can be divided into two disjoint and independent sets U and V, that is every edge connects a vertex in U to one in V. Vertex sets U and V a ...
can be treated as a network flow problem.


Definitions

Given a
graph Graph may refer to: Mathematics *Graph (discrete mathematics), a structure made of vertices and edges **Graph theory, the study of such graphs and their properties *Graph (topology), a topological space resembling a graph in the sense of discre ...
a matching ''M'' in ''G'' is a set of pairwise
non-adjacent This is a glossary of graph theory. Graph theory is the study of graphs, systems of nodes or vertices connected in pairs by lines or edges. Symbols A B ...
edges, none of which are
loop Loop or LOOP may refer to: Brands and enterprises * Loop (mobile), a Bulgarian virtual network operator and co-founder of Loop Live * Loop, clothing, a company founded by Carlos Vasquez in the 1990s and worn by Digable Planets * Loop Mobile, an ...
s; that is, no two edges share common vertices. 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) is a matching that contains the largest possible number of edges. There may be many maximum matchings. The matching number \nu(G) of a graph 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 In graph theory, a perfect matching in a graph is a matching that covers every vertex of the graph. More formally, given a graph , a perfect matching in is a subset of edge set , such that every vertex in the vertex set is adjacent to exactl ...
is a matching that matches all vertices of the graph. That is, a matching is perfect if every vertex of the graph is
incident Incident may refer to: * A property of a graph in graph theory * ''Incident'' (film), a 1948 film noir * Incident (festival), a cultural festival of The National Institute of Technology in Surathkal, Karnataka, India * Incident (Scientology), a ...
to an 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, only part (b) shows a perfect matching. A perfect matching is also a minimum-size
edge cover In graph theory, an edge cover of a graph is a set of edges such that every vertex of the graph is incident to at least one edge of the set. In computer science, the minimum edge cover problem is the problem of finding an edge cover of minimum siz ...
. 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
odd number In mathematics, parity is the property of an integer of whether it is even or odd. An integer is even if it is a multiple of two, and odd if it is not.. For example, −4, 0, 82 are even because \begin -2 \cdot 2 &= -4 \\ 0 \cdot 2 &= 0 \\ 41 ...
of vertices, and near-perfect matchings are maximum matchings. In the above figure, part (c) shows a near-perfect matching. If every vertex is unmatched by some near-perfect matching, then the graph is called factor-critical. Given a matching ''M'', an alternating path is a path that begins with an unmatched vertex and whose edges belong alternately to the matching and not to the matching. An augmenting path is an alternating path that starts from and ends on free (unmatched) vertices.
Berge's lemma In graph theory, Berge's theorem states that a matching ''M'' in a graph ''G'' is maximum (contains the largest possible number of edges) if and only if there is no augmenting path (a path that starts and ends on free (unmatched) vertices, and alt ...
states that a matching ''M'' is maximum if and only if there is no augmenting path with respect to ''M''. An
induced matching In graph theory, an induced matching or strong matching is a subset of the edges of an undirected graph that do not share any vertices (it is a matching) and includes every edge connecting any two vertices in the subset (it is an induced subgraph) ...
is a matching that is the edge set of an
induced subgraph In the mathematical field of graph theory, an induced subgraph of a graph is another graph, formed from a subset of the vertices of the graph and ''all'' of the edges (from the original graph) connecting pairs of vertices in that subset. Defini ...
.


Properties

In any graph without isolated vertices, the sum of the matching number and the
edge covering number Edge or EDGE may refer to: Technology Computing * Edge computing, a network load-balancing system * Edge device, an entry point to a computer network * Adobe Edge, a graphical development application * Microsoft Edge, a web browser developed b ...
equals the number of vertices. If there is a perfect matching, then both the matching number and the edge cover number are . If and are two maximal matchings, then and . To see this, observe that each edge in can be adjacent to at most two edges in because is a matching; moreover each edge in is adjacent to an edge in by maximality of , hence :, A \setminus B, \le 2, B \setminus A , . Further we deduce that :, A, = , A \cap B, + , A \setminus B, \le 2, B \cap A, + 2, B \setminus A, = 2, B, . 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 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 G be a
graph Graph may refer to: Mathematics *Graph (discrete mathematics), a structure made of vertices and edges **Graph theory, the study of such graphs and their properties *Graph (topology), a topological space resembling a graph in the sense of discre ...
on n vertices, and \lambda_1 > \lambda_2 > \ldots > \lambda_k>0 be k distinct nonzero purely imaginary numbers where 2k \leq n. Then the
matching number Matching may refer to: * Matching, Essex, England ** Matching Green ** Matching Tye * Matching (graph theory), in graph theory, a set of edges without common vertices * Graph matching, detection of similarity between graphs * Matching (statist ...
of G is k if and only if (a) there is a real
skew-symmetric matrix In mathematics, particularly in linear algebra, a skew-symmetric (or antisymmetric or antimetric) matrix is a square matrix whose transpose equals its negative. That is, it satisfies the condition In terms of the entries of the matrix, i ...
A with graph G and
eigenvalues In linear algebra, an eigenvector () or characteristic vector of a linear transformation is a nonzero vector that changes at most by a scalar factor when that linear transformation is applied to it. The corresponding eigenvalue, often denote ...
\pm \lambda_1, \pm\lambda_2,\ldots,\pm\lambda_k and n-2k zeros, and (b) all real skew-symmetric matrices with graph G have at most 2k nonzero
eigenvalues In linear algebra, an eigenvector () or characteristic vector of a linear transformation is a nonzero vector that changes at most by a scalar factor when that linear transformation is applied to it. The corresponding eigenvalue, often denote ...
. Note that the (simple) graph of a real symmetric or skew-symmetric matrix A of order n has n vertices and edges given by the nonozero off-diagonal entries of A.


Matching polynomials

A
generating function In mathematics, a generating function is a way of encoding an infinite sequence of numbers () by treating them as the coefficients of a formal power series. This series is called the generating function of the sequence. Unlike an ordinary serie ...
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 :\sum_ m_k x^k. Another definition gives the matching polynomial as :\sum_ (-1)^k m_k x^, 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 Combinatorial optimization is a subfield of mathematical optimization that consists of finding an optimal object from a finite set of objects, where the set of feasible solutions is discrete or can be reduced to a discrete set. Typical combi ...
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 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 adj ...
. The problem is solved by the Hopcroft-Karp algorithm in time time, and there are more efficient
randomized algorithm A randomized algorithm is an algorithm that employs a degree of randomness as part of its logic or procedure. The algorithm typically uses uniformly random bits as an auxiliary input to guide its behavior, in the hope of achieving good performa ...
s,
approximation algorithm In computer science and operations research, approximation algorithms are efficient algorithms that find approximate solutions to optimization problems (in particular NP-hard problems) with provable guarantees on the distance of the returned sol ...
s, and algorithms for special classes of graphs such as bipartite
planar graph In graph theory, a planar graph is a graph that can be embedded in the plane, i.e., it can be drawn on the plane in such a way that its edges intersect only at their endpoints. In other words, it can be drawn in such a way that no edges cro ...
s, as described in the main article.


Maximum-weight matching

In a ''weighted'' ''bipartite graph,'' the optimization problem is to find a maximum-weight matching; a dual problem is to find a minimum-weight matching. This problem is often called maximum weighted bipartite matching, or the
assignment problem The assignment problem is a fundamental combinatorial optimization problem. In its most general form, the problem is as follows: :The problem instance has a number of ''agents'' and a number of ''tasks''. Any agent can be assigned to perform any ta ...
. The
Hungarian algorithm The Hungarian method is a combinatorial optimization algorithm that solves the assignment problem in polynomial time and which anticipated later primal–dual methods. It was developed and published in 1955 by Harold Kuhn, who gave the name "Hun ...
solves the assignment problem and it was one of the beginnings of combinatorial optimization algorithms. It uses a modified
shortest path In graph theory, the shortest path problem is the problem of finding a path between two vertices (or nodes) in a graph such that the sum of the weights of its constituent edges is minimized. The problem of finding the shortest path between ...
search in the augmenting path algorithm. If the
Bellman–Ford algorithm The Bellman–Ford algorithm is an algorithm that computes shortest paths from a single source vertex to all of the other vertices in a weighted digraph. It is slower than Dijkstra's algorithm for the same problem, but more versatile, as it i ...
is used for this step, the running time of the Hungarian algorithm becomes O(V^2 E), or the edge cost can be shifted with a potential to achieve O(V^2 \log + V E) running time with the
Dijkstra algorithm Dijkstra's algorithm ( ) is an algorithm for finding the shortest paths between nodes in a graph, which may represent, for example, road networks. It was conceived by computer scientist Edsger W. Dijkstra in 1956 and published three years la ...
and
Fibonacci heap In computer science, a Fibonacci heap is a data structure for priority queue operations, consisting of a collection of heap-ordered trees. It has a better amortized running time than many other priority queue data structures including the bina ...
. In a ''non-bipartite weighted graph'', the problem of
maximum weight matching In computer science and graph theory, the maximum weight matching problem is the problem of finding, in a weighted graph, a matching in which the sum of weights is maximized. A special case of it is the assignment problem, in which the input is ...
can be solved in time O(V^E) using Edmonds' blossom algorithm.


Maximal matchings

A maximal matching can be found with a simple
greedy algorithm A greedy algorithm is any algorithm that follows the problem-solving heuristic of making the locally optimal choice at each stage. In many problems, a greedy strategy does not produce an optimal solution, but a greedy heuristic can yield locally ...
. 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
edge dominating set In graph theory, an edge dominating set for a graph ''G'' = (''V'', ''E'') is a subset ''D'' ⊆ ''E'' such that every edge not in ''D'' is adjacent to at least one edge in ''D''. An edge dominating set is also known as a ...
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 optimization problems are known to be
NP-hard In computational complexity theory, NP-hardness ( non-deterministic polynomial-time hardness) is the defining property of a class of problems that are informally "at least as hard as the hardest problems in NP". A simple example of an NP-hard pr ...
; the decision versions of these problems are classical examples of
NP-complete In computational complexity theory, a problem is NP-complete when: # it is a problem for which the correctness of each solution can be verified quickly (namely, in polynomial time) and a brute-force search algorithm can find a solution by trying ...
problems. Both problems can be approximated within factor 2 in polynomial time: simply find an arbitrary maximal matching ''M''.


Counting problems

The number of matchings in a graph is known as the
Hosoya index The Hosoya index, also known as the Z index, of a graph is the total number of matchings in it. The Hosoya index is always at least one, because the empty set of edges is counted as a matching for this purpose. Equivalently, the Hosoya index is t ...
of the graph. It is #P-complete to compute this quantity, even for bipartite graphs. It is also #P-complete to count perfect matchings, even in
bipartite graph In the mathematical field of graph theory, a bipartite graph (or bigraph) is a graph whose vertices can be divided into two disjoint and independent sets U and V, that is every edge connects a vertex in U to one in V. Vertex sets U and V a ...
s, because computing the permanent of an arbitrary 0–1 matrix (another #P-complete problem) is the same as computing the number of perfect matchings in the bipartite graph having the given matrix as its
biadjacency matrix In graph theory and computer science, an adjacency matrix is a square matrix used to represent a finite graph. The elements of the matrix indicate whether pairs of vertices are adjacent or not in the graph. In the special case of a finite simple ...
. However, there exists a fully polynomial time randomized approximation scheme for counting the number of bipartite matchings. A remarkable theorem of Kasteleyn states that the number of perfect matchings in a
planar graph In graph theory, a planar graph is a graph that can be embedded in the plane, i.e., it can be drawn on the plane in such a way that its edges intersect only at their endpoints. In other words, it can be drawn in such a way that no edges cro ...
can be computed exactly in polynomial time via the
FKT algorithm The FKT algorithm, named after Fisher, Kasteleyn, and Temperley, counts the number of perfect matchings in a planar graph in polynomial time. This same task is #P-complete for general graphs. For matchings that are not required to be perfect, c ...
. The number of perfect matchings in a
complete graph In the mathematical field of graph theory, a complete graph is a simple undirected graph in which every pair of distinct vertices is connected by a unique edge. A complete digraph is a directed graph in which every pair of distinct vertices is ...
''K''''n'' (with ''n'' even) is given by the
double factorial In mathematics, the double factorial or semifactorial of a number , denoted by , is the product of all the integers from 1 up to that have the same parity (odd or even) as . That is, :n!! = \prod_^ (n-2k) = n (n-2) (n-4) \cdots. For even , the ...
(''n'' − 1)!!. The numbers of matchings in complete graphs, without constraining the matchings to be perfect, are given by the
telephone number A telephone number is a sequence of digits assigned to a landline telephone subscriber station connected to a telephone line or to a wireless electronic telephony device, such as a radio telephone or a mobile telephone, or to other devices f ...
s.


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 edge In graph theory, a maximally-matchable edge in a graph is an edge that is included in at least one maximum-cardinality matching in the graph. An alternative term is allowed edge. A fundamental problem in matching theory is: given a graph ''G'', f ...
s, or allowed edges). Algorithms for this problem include: * For general graphs, a deterministic algorithm in time O(VE) and a randomized algorithm in time \tilde(V^) . * For bipartite graphs, if a single maximum matching is found, a deterministic algorithm runs in time O(V+E).


Online bipartite matching

The problem of developing an
online algorithm In computer science, an online algorithm is one that can process its input piece-by-piece in a serial fashion, i.e., in the order that the input is fed to the algorithm, without having the entire input available from the start. In contrast, an o ...
for matching was first considered by Richard M. Karp,
Umesh Vazirani Umesh Virkumar Vazirani is an Indian-American academic who is the Roger A. Strauch Professor of Electrical Engineering and Computer Science at the University of California, Berkeley, and the director of the Berkeley Quantum Computation Center. Hi ...
, and
Vijay Vazirani Vijay Virkumar Vazirani ( hi, विजय वीरकुमार वज़ीरानी; b. 1957) is an Indian American distinguished professor of computer science in the Donald Bren School of Information and Computer Sciences at the Universi ...
in 1990. 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 The secretary problem demonstrates a scenario involving optimal stopping theory For French translation, secover storyin the July issue of ''Pour la Science'' (2009). that is studied extensively in the fields of applied probability, statistics, a ...
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 .


Characterizations

Kőnig's theorem states that, in bipartite graphs, the maximum matching is equal in size to the minimum
vertex cover In graph theory, a vertex cover (sometimes node cover) of a graph is a set of vertices that includes at least one endpoint of every edge of the graph. In computer science, the problem of finding a minimum vertex cover is a classical optimiza ...
. Via this result, the minimum vertex cover,
maximum independent set In graph theory, an independent set, stable set, coclique or anticlique is a set of vertices in a graph, no two of which are adjacent. That is, it is a set S of vertices such that for every two vertices in S, there is no edge connecting the tw ...
, and
maximum vertex biclique In mathematical analysis, the maxima and minima (the respective plurals of maximum and minimum) of a function, known collectively as extrema (the plural of extremum), are the largest and smallest value of the function, either within a given ran ...
problems may be solved in
polynomial time In computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations performed by ...
for bipartite graphs.
Hall's marriage theorem In mathematics, Hall's marriage theorem, proved by , is a theorem with two equivalent formulations: * The combinatorial formulation deals with a collection of finite sets. It gives a necessary and sufficient condition for being able to select a di ...
provides a characterization of bipartite graphs which have a perfect matching and the
Tutte theorem In the mathematical discipline of graph theory the Tutte theorem, named after William Thomas Tutte, is a characterization of finite graphs with perfect matchings. It is a generalization of Hall's marriage theorem from bipartite to arbitrary gra ...
provides a characterization for arbitrary graphs.


Applications


Matching in general graphs

* A Kekulé structure of an
aromatic compound Aromatic compounds, also known as "mono- and polycyclic aromatic hydrocarbons", are organic compounds containing one or more aromatic rings. The parent member of aromatic compounds is benzene. The word "aromatic" originates from the past groupin ...
consists of a perfect matching of its
carbon skeleton The skeletal formula, or line-angle formula or shorthand formula, of an organic compound is a type of molecular structural formula that serves as a shorthand representation of a molecule's bonding and some details of its molecular geometry. A ...
, showing the locations of
double bond In chemistry, a double bond is a covalent bond between two atoms involving four bonding electrons as opposed to two in a single bond. Double bonds occur most commonly between two carbon atoms, for example in alkenes. Many double bonds exist betwee ...
s in the
chemical structure A chemical structure determination includes a chemist's specifying the molecular geometry and, when feasible and necessary, the electronic structure of the target molecule or other solid. Molecular geometry refers to the spatial arrangement of ...
. These structures are named after
Friedrich August Kekulé von Stradonitz Friedrich may refer to: Names * Friedrich (surname), people with the surname ''Friedrich'' * Friedrich (given name), people with the given name ''Friedrich'' Other * Friedrich (board game), a board game about Frederick the Great and the Seven Year ...
, who showed that
benzene Benzene is an organic chemical compound with the molecular formula C6H6. The benzene molecule is composed of six carbon atoms joined in a planar ring with one hydrogen atom attached to each. Because it contains only carbon and hydrogen atoms ...
(in graph theoretical terms, a 6-vertex cycle) can be given such a structure.See, e.g., . * The
Hosoya index The Hosoya index, also known as the Z index, of a graph is the total number of matchings in it. The Hosoya index is always at least one, because the empty set of edges is counted as a matching for this purpose. Equivalently, the Hosoya index is t ...
is the number of non-empty matchings plus one; it is used in
computational chemistry Computational chemistry is a branch of chemistry that uses computer simulation to assist in solving chemical problems. It uses methods of theoretical chemistry, incorporated into computer programs, to calculate the structures and properties of mo ...
and mathematical chemistry investigations for organic compounds. * The
Chinese postman problem In graph theory, a branch of mathematics and computer science, Guan's route problem, the Chinese postman problem, postman tour or route inspection problem is to find a shortest closed path or circuit that visits every edge of an (connected) undire ...
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 In graph theory, a matching in a hypergraph is a set of hyperedges, in which every two hyperedges are disjoint. It is an extension of the notion of matching in a graph. Definition Recall that a hypergraph is a pair , where is a set of ve ...
- a generalization of matching in graphs. *
Fractional matching In graph theory, a fractional matching is a generalization of a matching in which, intuitively, each vertex may be broken into fractions that are matched to different neighbor vertices. Definition Given a graph ''G'' = (''V'', ''E''), a fractio ...
. * 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 In graph theory, an edge coloring of a graph is an assignment of "colors" to the edges of the graph so that no two incident edges have the same color. For example, the figure to the right shows an edge coloring of a graph by the colors red, blu ...
, a partition of the edges of a graph into matchings *
Matching preclusion In graph theory, a branch of mathematics, the matching preclusion number of a graph ''G'' (denoted mp(''G'')) is the minimum number of edges whose deletion results in the destruction of a perfect matching or near-perfect matching (a matching that c ...
, the minimum number of edges to delete to prevent a perfect matching from existing *
Rainbow matching In the mathematical discipline of graph theory, a rainbow matching in an edge-colored graph is a matching in which all the edges have distinct colors. Definition Given an edge-colored graph , a rainbow matching in is a set of pairwise non-adja ...
, 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 In mathematics, economics, and computer science, the stable marriage problem (also stable matching problem or SMP) is the problem of finding a stable matching between two equally sized sets of elements given an ordering of preferences for each e ...
, a matching in which no two elements prefer each other to their matched partners *
Vertex independent set In graph theory, an independent set, stable set, coclique or anticlique is a set of vertices in a graph, no two of which are adjacent. That is, it is a set S of vertices such that for every two vertices in S, there is no edge connecting the two ...
, a set of vertices (rather than edges) no two of which are adjacent to each other *
Stable marriage problem In mathematics, economics, and computer science, the stable marriage problem (also stable matching problem or SMP) is the problem of finding a stable matching between two equally sized sets of elements given an ordering of preferences for each e ...
(also known as stable matching problem)


References


Further reading

# # # # # #


External links


A graph library with Hopcroft–Karp and Push–Relabel-based maximum cardinality matching implementation
{{Authority control Combinatorial optimization Polynomial-time problems Computational problems in graph theory