Maximum weight matching

Last updated
A maximum weight matching in an edge-weighted graph with 9 vertices and 14 edges. Maximum weight matching.png
A maximum weight matching in an edge-weighted graph with 9 vertices and 14 edges.

Maximum weight matching is an optimization problem in graph theory in which the goal is to find a matching of maximum possible total weight in an edge-weighted graph. A matching is an independent edge set (that is, a set of edges in which none of the members share a common endpoint). The weight of a matching is the sum of the weights on its edges.

Contents

The problem is a generalization of the maximum cardinality matching problem because it allows edges to carry arbitrary numerical weights. When all edge weights are equal, a maximum weight matching is equivalent to a maximum cardinality matching.

The maximum weight matching problem is solvable in polynomial time using, for example, the blossom algorithm, or Gabow's algorithm. [1] This contrasts with the problem of computing the (weighted) maximum independent set of vertices in a graph, which is NP-hard.

By adjusting the given edge weights, algorithms for the maximum weight matching problem can also be used to solve the maximum cardinality maximum weight matching problem, where the objective is to find, among all matchings with maximum cardinality, one whose total weight is maximised. Similar ideas can also be used to solve the maximum cardinality minimum weight matching problem. In cases where the edge-weighted graph is bipartite, such problems are also known as the assignment problem.

Definition

Given an undirected graph with vertex set , edge set , and weight function , a maximum weight matching is an independent set of edges that maximises the total weight

The edge weights may be positive, negative, or mixed.

Maximum cardinality weighted matchings

A maximum cardinality maximum weight matching. Maximum cardinality maximum weight matching.png
A maximum cardinality maximum weight matching.
A maximum cardinality minimum weight matching. Maximum cardinality minimum weight matching.png
A maximum cardinality minimum weight matching.

A commonly occurring variant of the problem involves computing a matching that contains as many edges as possible. The total weight of the matching is then used as a secondary measure.

To solve the maximum cardinality maximum weight matching problem on , a new graph is formed in which, for each edge ,

where is an appropriate positive constant. A maximum weight matching in then corresponds to a maximum cardinality maximum weight matching in .

To solve the maximum cardinality minimum weight matching problem, set

Again, a maximum weight matching on yields a maximum cardinality minimum weight matching in .

In both cases, a constant is needed to force the algorithm to favor matchings with greater cardinality regardless of the edge weights in . Any value of

is sufficient for this purpose.

Algorithms and implementations

The maximum weight matching problem is solvable in polynomial time. Well-known algorithms include:

Other algorithms are reviewed by Duan and Pettie. [3] Their work also proposes an approximation algorithm for general graphs that runs in linear time for any fixed error bound.

Efficient implementations are available in several software libraries, including NetworkX, LEDA, and the LEMON graph library.

Applications

Maximum weight matchings (and their maximum cardinality variants) arise in a wide range of optimization settings.

See also

References

  1. 1 2 Gabow, H. (1974). Implementation of algorithms for maximum matching on nonbipartite graphs. PhD Thesis, Stanford University.
  2. Gabow, H. (1990). Data structures for weighted matching and nearest common ancestors with linking . Proceedings of the First Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 434–443.
  3. Duan, R.; Pettie, S. (2014). Linear-time approximation for maximum weight matching . Journal of the ACM 61(1).
  4. Lewis, R.; Bonnet, L. (2025). Exact algorithms in bar nesting: How to cut general items from linear stocks so that wastage is minimised . Computers & Industrial Engineering 200, 110838.
  5. Ma, W.; McAnulla, C.; Wang, L. (2012). Protein complex prediction based on maximum matching with domain-domain interaction . Biochim Biophys Acta. 1824 (12), pp. 1418–1424.