Christofides algorithm Created 2026-10-07 Updated 2026-10-14
Compute a minimum spanning tree, then a minimum-weight perfect matching on its odd-degree vertices. Their multiset union is connected with even degrees, so it has an Euler circuit. Shortcut repeated vertices to obtain a metric tour. The tree costs at most the optimal tour, and shortcutting the optimal tour to its odd-degree subset gives a cyclic order whose alternating matchings show that the added matching costs at most half the optimum. The result is a polynomial-time -approximation algorithm for symmetric metric instances.
Matching (graph theory) Created 2026-10-14 Updated 2026-10-20
A matching in a graph is a set of edges of an undirected graph with no shared endpoints: each vertex has capacity for at most one selected edge. It describes simultaneous compatible pairs, such as jobs assigned to distinct available workers, or tasks each occupying two resources that cannot be shared. The empty set is a valid matching in a graph.[ref]
Graph Theory by Reinhard Diestel. Matching, Covering and Packing, opening paragraph, printed p. 1: independent edges and matchings
For a finite simple graph , write when is selected and otherwise. The vertex capacity constraint is exactlyThese are constraints on a discrete selection, not a requirement that every vertex be used. A matching in a graph with matching saturation of all vertices is a perfect matching; an unmatched vertex in a matching uses none of its capacity.
The objective must be specified separately. A maximum cardinality matching selects as many edges as possible; a maximum-weight matching selects the greatest total benefit; a minimum-weight perfect matching minimizes cost while requiring every vertex to be paired. A maximal matching only says that no additional edge fits alongside the current choices. The four-vertex path graph below separates these notions: choosing the middle edge blocks both outer edges, yet replacing it by those two edges pairs more vertices.
This model is useful because conflicts are local at vertices, while the quality of a selection can depend on coordinated changes along a whole augmenting path in a matching. A greedy matching gives a quick feasible selection; Berge's theorem explains when searching for such changes has reached a maximum cardinality matching. Repeating the pairing problem over time leads instead to proper edge colouring, where each time slot is a matching in a graph.
Maximum-weight matching 2026-10-14
Assign each edge a real benefit . A maximum-weight matching maximizes over all matchings in a graph ; the empty matching in a graph is allowed. Setting every recovers a maximum cardinality matching, but otherwise the objectives can disagree.
On the same path graph , give the middle edge benefit and each outer edge benefit . The matching in a graph has total benefit , while the two-edge matching in a graph has total benefit . Thus the smaller choice is the unique maximum-weight matching. If instead the requirement is to find a maximum cardinality matching and then maximize benefit among those, the outer edges must be chosen. Requiring a perfect matching before optimizing cost is another distinct problem, covered by minimum-weight perfect matching. With negative benefits a maximum-weight matching can even be empty, so it need not be a maximal matching.
Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 42 3 c Solution Created 2026-10-03 Updated 2026-10-07
Let be an optimal metric tour. Removing any one of its edges gives a spanning tree, so the minimum spanning tree satisfies . The handshaking lemma shows that its odd-degree set has even size.
Follow and retain only vertices of , shortcutting between consecutive retained vertices. This produces a cyclic order on of total cost at most . If is nonempty, the alternating edges of that cyclic order form two perfect matchings; their costs sum to the cycle cost. One has cost at most , so a minimum-weight perfect matching hasFor , count the same undirected edge twice in the cyclic order; each alternating matching consists of one copy. For , use the empty matching.
The multigraph with edges is connected because it contains . Each odd-degree vertex receives exactly one matching edge, and the other degrees are unchanged, so every degree is even. It therefore has an Euler circuit. Constructively, follow unused edges until returning to the starting vertex; parity prevents getting stuck elsewhere. If unused edges remain, connectivity supplies a vertex of the current circuit incident with one, and its additional closed trail can be spliced into the circuit. Repetition gives a circuit using every edge exactly once, including parallel copies.
Shortcut repeated vertices of this Euler circuit to obtain a metric tour. Its cost is at mostComputing a minimum spanning tree, a minimum-weight perfect matching, an Euler circuit and the shortcut tour is polynomial-time; weighted perfect matching is a standard polynomial-time graph optimization problem. Thus the Christofides algorithm is a -approximation algorithm for symmetric metric tours.