All Topics  
Matching

 

   Email Print
   Bookmark   Link






 

Matching



 
 
In the mathematical discipline of graph theory
Graph theory

In mathematics and computer science, graph theory is the study of graph : mathematical structures used to model pairwise relations between objects from a certain collection....
 a matching or edge-independent set in a graph
Graph (mathematics)

In mathematics a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected objects are represented by mathematical abstractions called vertices, and the links that connect some pairs of vertices are called edges....
 is a set of edges without common vertices
Vertex (graph theory)

In graph theory, a vertex or node is the fundamental unit out of which graphs are formed: an undirected graph consists of a set of vertices and a set of edges , while a directed graph consists of a set of vertices and a set of arcs ....
. It may also be an entire graph consisting of edges without common vertices.

Definition
Given a graph
Graph (mathematics)

In mathematics a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected objects are represented by mathematical abstractions called vertices, and the links that connect some pairs of vertices are called edges....
 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
Full Discussion Forum



Encyclopedia


In the mathematical discipline of graph theory
Graph theory

In mathematics and computer science, graph theory is the study of graph : mathematical structures used to model pairwise relations between objects from a certain collection....
 a matching or edge-independent set in a graph
Graph (mathematics)

In mathematics a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected objects are represented by mathematical abstractions called vertices, and the links that connect some pairs of vertices are called edges....
 is a set of edges without common vertices
Vertex (graph theory)

In graph theory, a vertex or node is the fundamental unit out of which graphs are formed: an undirected graph consists of a set of vertices and a set of edges , while a directed graph consists of a set of vertices and a set of arcs ....
. It may also be an entire graph consisting of edges without common vertices.

Definition


Given a graph
Graph (mathematics)

In mathematics a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected objects are represented by mathematical abstractions called vertices, and the links that connect some pairs of vertices are called edges....
 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
Incidence (geometry)

In geometry, the relations of incidence are those such as 'lies on' between points and lines , and 'intersects' . That is, they are the binary relations describing how subsets meet....
 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
Edge cover

In the mathematics discipline of graph theory, an edge cover of a graph is a set of edges such that every vertex of the graph touches at least one element of the set....
.

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
Factor-critical graph

In graph theory, a mathematical discipline, factor-critical graph is a graph with n vertices in which any subset of n − 1 vertices has a perfect matching....
.

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
Claude Berge

Claude Berge was a French mathematician, recognized as one of the modern founders of combinatorics and graph theory. He is particularly remembered for his famous conjectures on perfect graphs and for Berge's lemma, which states that a matching M in a graph G is maximum if and only if there is in G no augmenting path with respect...
'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 graph
Bipartite graph

In the mathematics field of graph theory, a bipartite graph is a graph whose vertex can be divided into two disjoint sets U and V such that every edge connects a vertex in U to one in V; that is, U and V are independent sets....
s. 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
Maximum flow problem

The maximum flow problem is to find a feasible flow through a single-source, single-sink flow network that is maximum. Sometimes it is defined as finding the value of such a flow....
 from to . All edges with flow from to then constitute a maximum matching. An improvement over this is the Hopcroft-Karp algorithm
Hopcroft-Karp algorithm

In computer science, the Hopcroft?Karp algorithm is an algorithm that takes as input a bipartite graph and produces as output a maximum cardinality matching ? a set of as many edges as possible with the property that no two edges share an endpoint....
, which runs in time. Another approach is based on the fast matrix multiplication
Matrix multiplication

In mathematics, matrix multiplication is the operation of multiplying a matrix with either a scalar or another matrix. This article gives an overview of the various ways to perform 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
Assignment problem

The assignment problem is one of the fundamental combinatorial optimization problems in the branch of Optimization or operations research in mathematics....
. It can be solved by using a modified shortest path search in the augmenting path algorithm. If the Bellman-Ford algorithm
Bellman-Ford algorithm

The Bellman?Ford algorithm, a label correcting algorithm, computes single-source shortest paths in a weighted digraph . Dijkstra's algorithm solves the same problem with a lower running time, but requires edge weights to be non-negative....
 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
Fibonacci heap

In computer science, a Fibonacci heap is a Heap consisting of a forest of trees. It has a better amortized analysis running time than a binomial heap....
. The remarkable Hungarian algorithm
Hungarian algorithm

The Hungarian method is a Optimization algorithm which solves the assignment problem in polynomial time and which anticipated later primal-dual methods....
 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
Jack Edmonds

Jack R. Edmonds is a mathematician, regarded as one of the most important contributors to the field of combinatorial optimization. He was the recipient of the 1985 John von Neumann Theory Prize....
, is called the paths, trees, and flowers method, and uses bidirected edges
Bidirected graph

In the mathematics domain of graph theory, a bidirected graph is a Graph in which each edge is given an independent orientation at each end. Thus, there are three kinds of bidirected edges: those where the arrows point outward, towards the vertices, at both ends; those where both arrows point inward, away from the vertices; and those in w...
. 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
Matrix multiplication

In mathematics, matrix multiplication is the operation of multiplying a matrix with either a scalar or another matrix. This article gives an overview of the various ways to perform 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
Edge dominating set

File:Edge-dominating-set.svgIn graph theory, an edge dominating set for a graph G =  is a subset D ? E such that every edge not in D is adjacent to at least one edge in D....
 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
NP-hard

NP-hard , in computational complexity theory, is a class of problems informally "at least as hard as the hardest problems in NP ." A problem H is NP-hard if and only if there is an NP-complete problem L that is polynomial-time Turing reduction to H, i.e....
; the decision versions of these problems are classical examples of NP-complete
NP-complete

In computational complexity theory, the complexity class NP-complete is a class of problems having two properties:* Any given solution to the problem can be verified quickly ; the set of problems with this property is called NP ....
 problems. Both problems can be approximated
Approximation algorithm

In computer science and operations research, approximation algorithms are algorithms used to find approximate solutions to optimization problems....
 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
Permanent

In linear algebra, the permanent of a square matrix is a function of the matrix similar to the determinant. The permanent, as well as the determinant, is a polynomial in the entries of the matrix....
). 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 graph
Bipartite graph

In the mathematics field of graph theory, a bipartite graph is a graph whose vertex can be divided into two disjoint sets U and V such that every edge connects a vertex in U to one in V; that is, U and V are independent sets....
s, the problem can be approximately
Approximation algorithm

In computer science and operations research, approximation algorithms are algorithms used to find approximate solutions to optimization problems....
 solved in polynomial time. That is, for any e>0, there is a probabilistic
Randomized algorithm

A randomized algorithm or probabilistic algorithm is an algorithm which employs a degree of randomness as part of its logic. The algorithm typically uses Uniform distribution bits as an auxiliary input to guide its behavior, in the hope of achieving good performance in the "average case" over all possible choices of random bits....
 polynomial time algorithm that determines, with high probability
Probability

Probability, or wikt:chance, is a way of expressing knowledge or belief that an Event will occur or has occurred. In mathematics the concept has been given an exact meaning in probability theory, that is used extensively in such areas of study as mathematics, statistics, finance, gambling, science, and philosophy to draw conclusions about t...
, 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
Hosoya index

The Hosoya index, also known as the topological index or 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....
.

Applications


A Kekulé structure of an aromatic compound
Aromaticity

Aromaticity is a chemical property in which a conjugated system ring of unsaturated bonds, lone pairs, or empty orbitals exhibit a stabilization stronger than would be expected by the stabilization of conjugation alone....
 consists of a perfect matching of its carbon skeleton
Skeletal formula

The skeletal formula of an organic compound is a shorthand representation of its molecular geometry. Skeletal formulae are ubiquitous in organic chemistry because they show complicated structures clearly and they are quick and simple to draw....
, showing the locations of double bonds in the chemical structure
Chemical structure

A Chemical structure includes molecular geometry, electronic structure and crystal structure of a chemical compound. Molecular geometry refers to the spatial arrangement of atoms in a molecule and the chemical bonds that hold the atoms together....
. These structures are named after Friedrich August Kekulé von Stradonitz, who showed that benzene
Benzene

Benzene, or benzol, is an organic compound chemical compound and a known carcinogen with the molecular formula Carbon6Hydrogen6....
 (in graph theoretical terms, a 6-vertex cycle) can be given such a structure.

The Hosoya index
Hosoya index

The Hosoya index, also known as the topological index or 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....
 is the total number of matchings of a graph; it is used in computer chemistry investigations for organic compounds.

See also

  • Vertex independent set
  • Dulmage-Mendelsohn Decomposition
    Dulmage-Mendelsohn decomposition

    In graph theory, the Dulmage-Mendelsohn decomposition is a method used to create a maximal matching on a bipartite graph.It has been used to partition meshes in Finite Element Analysis, and to determine specified, underspecified and overspecified equations in systems of nonlinear equations....
  • Stable matching
  • Skew-symmetric graph
    Skew-symmetric graph

    In graph theory, a branch of mathematics, a skew-symmetric graph is a directed graph that is graph isomorphism to its own transpose graph, the graph formed by reversing all of its edges....


Additional reading



External links

  • [https://lemon.cs.elte.hu/ A graph library with Hopcroft-Karp and Push-Relabel based maximum cardinality matching implementation ]