ArticleslgStudy

computer science

Maximum-weight matching

Maximum-weight matching is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Maximum-weight matching rather than just read about it. In short: 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).

Maximum-weight matching — main illustration
Maximum-weight matching — illustration

Key takeaways

  • Maximum-weight matching belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Maximum-weight matching to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Maximum-weight matching from memory before moving on to harder problems.

Reference excerpt

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. 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 O ( E V 2 ) {\displaystyle O(EV^{2})} blossom algorithm, or Gabow's O ( V 3 ) {\displaystyle O(V^{3})} algorithm. 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 G = ( V , E , w ) {\displaystyle G=(V,E,w)} with vertex set V {\displaystyle V} , edge set E {\displaystyle E} , and weight function w : E → R {\displaystyle w:E\to \mathbb {R} } , a maximum-weight matching is an independent set of edges M ⊆ E {\displaystyle M\subseteq E} that maximises the total weight

w ( M ) = ∑ e ∈ M w ( e ) . {\displaystyle w(M)=\sum _{e\in M}w(e).}

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

Maximum cardinality weighted matchings

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 G = ( V , E , w ) {\displaystyle G=(V,E,w)} , a new graph G ′ = ( V , E , w ′ ) {\displaystyle G'=(V,E,w')} is formed in which, for each edge e ∈ E {\displaystyle e\in E} ,

w ′ ( e ) = C + w ( e ) , {\displaystyle w'(e)=C+w(e),}

where C {\displaystyle C} is an appropriate positive constant. A maximum-weight matching in G ′ {\displaystyle G'} then corresponds to a maximum cardinality maximum-weight matching in G {\displaystyle G} . To solve the maximum cardinality minimum weight matching problem, set

w ′ ( e ) = C − w ( e ) . {\displaystyle w'(e)=C-w(e).}

Again, a maximum-weight matching on G ′ {\displaystyle G'} yields a maximum cardinality minimum weight matching in G {\displaystyle G} . In both cases, a constant C {\displaystyle C} is needed to force the algorithm to favor matchings with greater cardinality regardless of the edge weights in G {\displaystyle G} . Any value of

C > 2 ∑ e ∈ E | w ( e ) | {\displaystyle C>2\sum _{e\in E}|w(e)|}

is sufficient for this purpose.

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

… excerpt ends here. Continue reading the full article.

Illustrations

Maximum-weight matching: A maximum weight matching in an edge-weighted graph with 9 vertices and 14 edges.
A maximum weight matching in an edge-weighted graph with 9 vertices and 14 edges.
Maximum-weight matching: A maximum-cardinality maximum-weight matching.
A maximum-cardinality maximum-weight matching.
Maximum-weight matching: A maximum-cardinality minimum-weight matching.
A maximum-cardinality minimum-weight matching.

Worked examples

Example 1 — a first encounter with Maximum-weight matching

Start with the simplest possible case. Write down what Maximum-weight matching claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Maximum-weight matching before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Maximum-weight matching ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Maximum-weight matching

In research
Maximum-weight matching appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Maximum-weight matching in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Maximum-weight matching is common in secondary-school and first-year university syllabi. It links to neighbouring topics Combinatorial optimization, Computational problems in graph theory, so understanding it makes those chapters shorter.
In everyday life
Look for Maximum-weight matching outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Maximum-weight matching in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Maximum-weight matching means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Maximum-weight matching out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Maximum-weight matching in simple terms?

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).

Why does Maximum-weight matching matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Maximum-weight matching?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Maximum-weight matching.

Tags

  • Combinatorial optimization
  • Computational problems in graph theory

Keep exploring