Tutorials › Graph Theory (Undergraduate) › The Odd-Vertex Matching Bound In Christofides Algorithm

The Traveling Salesman Problem · Tutorial 536 of 799

The Odd-Vertex Matching Bound In Christofides Algorithm

Learn why the minimum perfect matching on a spanning tree’s odd-degree vertices costs no more than half an optimal metric tour.

Advanced 10 min read

What You'll Learn

  • Define the odd-degree vertex set of a spanning tree in a metric TSP instance
  • Show why the number of odd-degree vertices is even
  • Shortcut an optimal tour to obtain a cyclic order of the odd-degree vertices
  • Construct two perfect matchings from alternating links in that order
  • Prove that the cheaper matching costs at most half the optimal tour
  • Check the bound on metric examples, including cases with two and four odd vertices

Why the Odd Vertices Matter

In Christofides’ algorithm, a spanning tree is augmented by a perfect matching on the tree’s odd-degree vertices. The matching links are chosen using the metric costs, not necessarily from the tree. A key bound is that a minimum-cost such matching costs at most half the cost of an optimal tour. The reason is that an optimal tour can be shortcut to a cycle through the odd vertices, and alternating links around that cycle give two candidate matchings.

We work with a finite metric TSP instance on a vertex set \(V\) with \(|V|\geq 3\). It is represented by the complete undirected graph on \(V\), with edge costs \(d(u,v)\). The costs are symmetric, are positive for distinct vertices, and satisfy the triangle inequality \(d(u,w)\leq d(u,v)+d(v,w)\). A tour visits every vertex exactly once and returns to its starting vertex; its cost is the sum of its edge costs. An optimal tour is a tour of minimum cost, denoted \(\operatorname{OPT}\). Such a tour exists because there are finitely many tours.

Definition: For a spanning tree \(T\) on \(V\), let \(O(T)=\{v\in V:\deg_T(v)\text{ is odd}\}\). A perfect matching on \(O(T)\) is a collection of pairwise vertex-disjoint edges of the complete metric graph such that every vertex in \(O(T)\) is an endpoint of exactly one edge. Its cost is the sum of its edge costs. The minimum perfect matching cost is the smallest cost among all perfect matchings on \(O(T)\).

The tree itself determines which vertices must be matched; the metric determines the cost of the matching edges. The bound below does not require the matching edges to belong to \(T\).

Why Alternating Links Give Matchings

The number of odd-degree vertices in a tree is even. Indeed, each tree edge contributes one to the degree of each of its two endpoints, so the sum of all degrees is twice the number of tree edges and is even. A sum of integers is even only if it contains an even number of odd summands. Thus we can write \(|O(T)|=k\) with \(k\) even.

List the odd vertices in the order in which they appear while travelling around an optimal tour: \(u_1,u_2,\ldots,u_k\). Between each consecutive pair in this cyclic order, follow the tour until reaching the next odd vertex. These portions of the tour partition the tour’s edges. Replace each portion by a single metric edge joining its endpoints. The triangle inequality says the cost of each replacement edge is no greater than the cost of the portion it replaces. Consequently, the sum of the costs of these cyclic links is at most \(\operatorname{OPT}\).

There are two ways to take alternating links: pair \(u_1\) with \(u_2\), \(u_3\) with \(u_4\), and so on; or pair \(u_2\) with \(u_3\), \(u_4\) with \(u_5\), and so on, finally pairing \(u_k\) with \(u_1\). Since \(k\) is even, each choice uses every odd vertex exactly once. Both choices are perfect matchings. Their costs add up to the cost of all the cyclic links, so at least one of them costs no more than half that sum.

Theorem (Odd-Vertex Matching Bound): Let \(T\) be a spanning tree of a finite metric TSP instance with at least three vertices, and let \(\operatorname{OPT}\) be the cost of an optimal tour. The minimum-cost perfect matching on \(O(T)\) has cost at most \(\operatorname{OPT}/2\).

Proof. Write the odd vertices in their order on an optimal tour as \(u_1,\ldots,u_k\), where \(k\) is even. If \(k=0\), the empty matching has cost zero, which is at most \(\operatorname{OPT}/2\). Now suppose \(k\geq 2\). For \(1\leq i\leq k\), let \(c_i=d(u_i,u_{i+1})\), with \(u_{k+1}=u_1\). Each link \(u_i u_{i+1}\) shortcuts the portion of the optimal tour from \(u_i\) to \(u_{i+1}\) in the chosen direction. Repeated application of the triangle inequality shows that \(c_i\) is at most the cost of that portion: for a portion with successive vertices \(x_0,\ldots,x_r\), induction on \(r\) gives \(d(x_0,x_r)\leq\sum_{j=1}^{r}d(x_{j-1},x_j)\). The portions partition the tour, so \(\sum_{i=1}^{k}c_i\leq\operatorname{OPT}\).

One matching consists of the links in positions \(1,3,\ldots,k-1\); the other consists of the links in positions \(2,4,\ldots,k\). Each is a perfect matching because these pairs partition the vertices \(u_1,\ldots,u_k\). Their costs sum to \(\sum_{i=1}^{k}c_i\), so the lesser of the two costs is at most \(\frac12\sum_{i=1}^{k}c_i\), and hence at most \(\operatorname{OPT}/2\). The minimum-cost perfect matching costs no more than either candidate matching, proving the result. When \(k=2\), the two indexed cyclic links have the same pair of endpoints, but each alternating choice is still a perfect matching with one edge; the cost-sum argument remains valid. \(\square\)

This argument proves a bound on the minimum matching by exhibiting candidate matchings. It does not require computing the minimum matching or finding the optimal tour in order to justify the inequality. The tour is a comparison object in the proof.

Worked Example: Four Odd Vertices with Unequal Alternating Costs

Let \(V=\{a,b,c,d\}\), placed at coordinates \(0,1,2,4\) on a line, and take the complete graph with edge costs equal to distances between coordinates. Its six edge costs are \(d(a,b)=1\), \(d(a,c)=2\), \(d(a,d)=4\), \(d(b,c)=1\), \(d(b,d)=3\), and \(d(c,d)=2\). These costs satisfy the triangle inequality because distance on a line does.

Take the spanning tree \(T\) with edge set \(\{ab,ac,ad\}\). Its degrees are \(\deg_T(a)=3\), \(\deg_T(b)=1\), \(\deg_T(c)=1\), and \(\deg_T(d)=1\); therefore \(O(T)=\{a,b,c,d\}\). The tour \(a,b,c,d,a\) has cost \(d(a,b)+d(b,c)+d(c,d)+d(d,a)=1+1+2+4=8\). Any tour visiting both endpoints of the line must travel a total distance of at least \(4\) from coordinate \(0\) to coordinate \(4\), and at least \(4\) to return. Thus this tour is optimal and \(\operatorname{OPT}=8\).

In the tour order \(a,b,c,d\), the cyclic link costs are \(1,1,2,4\). The alternating matchings have costs \(d(a,b)+d(c,d)=1+2=3\) and \(d(b,c)+d(d,a)=1+4=5\). The cheaper one costs \(3\), which is at most \(\operatorname{OPT}/2=8/2=4\). For an independent check, the third possible pairing costs \(d(a,c)+d(b,d)=2+3=5\). Thus the minimum over all three pairings is \(3\), as found from the alternating candidates.

Worked Example: A Star Tree and Four Odd Leaves

Let \(V=\{x,a,b,c,d\}\), with a complete metric graph whose costs come from a weighted star with center \(x\) and spoke lengths \(1,2,3,4\) to \(a,b,c,d\), respectively. Thus \(d(x,a)=1\), \(d(x,b)=2\), \(d(x,c)=3\), \(d(x,d)=4\), and the distances between distinct leaves are the sums of their spoke lengths. For example, \(d(a,b)=1+2=3\), \(d(b,c)=2+3=5\), and \(d(c,d)=3+4=7\). These are shortest-path distances on the star and satisfy the triangle inequality.

Use that star as \(T\). Its center has degree \(4\), and each of its four leaves has degree \(1\), so \(O(T)=\{a,b,c,d\}\). The tour \(a,x,b,c,d,a\) costs \(1+2+5+7+5=20\). Every tour has this same cost: each leaf’s spoke length contributes twice, once for each of its two incident tour edges. Therefore every tour costs \(2(1+2+3+4)=20\), and \(\operatorname{OPT}=20\).

The odd vertices appear in the tour order \(a,b,c,d\). The cyclic link costs are \(d(a,b)=3\), \(d(b,c)=5\), \(d(c,d)=7\), and \(d(d,a)=4+1=5\). The two alternating matching costs are \(3+7=10\) and \(5+5=10\). Hence the minimum matching costs at most \(10=\operatorname{OPT}/2\). Checking all pairings independently gives \(d(a,b)+d(c,d)=3+7=10\), \(d(a,c)+d(b,d)=4+6=10\), and \(d(a,d)+d(b,c)=5+5=10\). The minimum is indeed \(10\).

Worked Example: Two Odd Vertices

Let \(V=\{a,b,c\}\) and give the complete graph costs \(d(a,b)=2\), \(d(b,c)=3\), and \(d(a,c)=5\). These are distances along a line with coordinates \(0,2,5\), so they form a metric. Take \(T\) to be the path with edge set \(\{ab,bc\}\). Its degrees are \(1,2,1\), so \(O(T)=\{a,c\}\).

The tour \(a,b,c,a\) costs \(2+3+5=10\). On three vertices every tour uses all three edges, so \(\operatorname{OPT}=10\). The only perfect matching on \(\{a,c\}\) consists of the edge \(ac\), with cost \(5\). Therefore the minimum matching cost is \(5=\operatorname{OPT}/2\).

Here the two cyclic shortcuts between the odd vertices both have cost \(5\): one shortcuts the tour portion \(a,b,c\), and the other is the return link from \(c\) to \(a\). They have the same endpoints, but represent the two different portions of the tour when their costs are summed. Each alternating choice is the same one-edge matching, of cost \(5\), so the alternating argument applies in this case as well.

A Common Pitfall

It is not valid to claim that each alternating matching costs at most half the cyclic-link sum. The proof only guarantees that at least one does: the two costs add to the sum, so their minimum is at most half. In the first example, the cyclic-link sum is \(1+1+2+4=8\), and half of it is \(8/2=4\). One alternating matching costs \(1+2=3\), but the other costs \(1+4=5\), which is greater than \(4\). The correction is to compare both alternating choices and select the cheaper one. The minimum perfect matching costs no more than that selected candidate.

The factor of one-half comes from having two complementary matchings, not from the fact that either matching uses half of the links. A matching does use half the link positions, but the individual link costs need not be equal. The argument relies on the sum of the two matching costs, not on an assumption that costs are evenly distributed.

How the Bound Fits the Algorithm

The matching bound applies to every spanning tree \(T\) on the metric instance: its odd-degree set determines the vertices to pair, and the optimal tour supplies the cyclic order used in the proof. The proof then provides two feasible matchings whose combined cost is at most the optimal tour cost. It follows that the cheaper candidate, and therefore the minimum perfect matching, costs at most half of \(\operatorname{OPT}\).

This is the matching-cost estimate used in the analysis of Christofides’ algorithm. The estimate alone does not prove a bound on the algorithm’s full tour: it concerns only the matching added to the tree. Combining it with the spanning-tree cost bound and the tour construction is a separate step.

Check Your Understanding

Use the definitions and alternating-link argument to answer the following.

  1. Why must the number of odd-degree vertices in a spanning tree be even?
  2. For four odd vertices in tour order, write both alternating perfect matchings and explain why their costs sum to the cyclic-link cost.
  3. In the first worked example, why does the alternating matching of cost \(5\) not contradict the theorem?
  4. If the odd-degree set is empty, what is the cost of its empty matching, and why does the stated bound hold?
  5. For the three-vertex path example, why do the two cyclic links have the same endpoints even though they represent different portions of the tour?