language-icon Old Web
English
Sign In

Christofides algorithm

The Christofides algorithm is an algorithm for finding approximate solutions to the travelling salesman problem, on instances where the distances form a metric space (they are symmetric and obey the triangle inequality).It is an approximation algorithm that guarantees that its solutions will be within a factor of 3/2 of the optimal solution length, and is named after Nicos Christofides, who published it in 1976. As of 2017, this is the best approximation ratio that has been proven for the traveling salesman problem on general metric spaces, although better approximations are known for some special cases. The Christofides algorithm is an algorithm for finding approximate solutions to the travelling salesman problem, on instances where the distances form a metric space (they are symmetric and obey the triangle inequality).It is an approximation algorithm that guarantees that its solutions will be within a factor of 3/2 of the optimal solution length, and is named after Nicos Christofides, who published it in 1976. As of 2017, this is the best approximation ratio that has been proven for the traveling salesman problem on general metric spaces, although better approximations are known for some special cases. Let G = (V,w) be an instance of the travelling salesman problem. That is, G is a complete graph on the set V of vertices, and the function w assigns a nonnegative real weight to every edge of G.According to the triangle inequality, for every three vertices u, v, and x, it should be the case that w(uv) + w(vx) ≥ w(ux). Then the algorithm can be described in pseudocode as follows. The cost of the solution produced by the algorithm is within 3/2 of the optimum.To prove this, let C be the optimal traveling salesman tour. Removing an edge from C produces a spanning tree, which must have weight at least that of the minimum spanning tree, implying that w(T) ≤ w(C).Next, number the vertices of O in cyclic order around C, and partition C into two sets of paths: the ones in which the first path vertex in cyclic order has an odd number and the ones in which the first path vertex has an even number.Each set of paths corresponds to a perfect matching of O that matches the two endpoints of each path, and the weight of this matching is at most equal to the weight of the paths.Since these two sets of paths partition the edges of C, one of the two sets has at most half of the weight of C, and thanks to the triangle inequality its corresponding matching has weight that is also at most half the weight of C.The minimum-weight perfect matching can have no larger weight, so w(M) ≤ w(C)/2.Adding the weights of T and M gives the weight of the Euler tour, at most 3w(C)/2. Thanks to the triangle inequality, shortcutting does not increase the weight,so the weight of the output is also at most 3w(C)/2. There exist inputs to the travelling salesman problem that cause the Christofides algorithm to find a solution whose approximation ratio is arbitrarily close to 3/2. One such class of inputs are formed by a path of n vertices, with the path edges having weight 1, together with a set of edges connecting vertices two steps apart in the path with weight 1 + εfor a number ε chosen close to zero but positive. All remaining edges of the complete graph have distances given by the shortest paths in this subgraph.Then the minimum spanning tree will be given by the path, of length n − 1, and the only two odd vertices will be the path endpoints, whose perfect matching consists of a single edge with weight approximately n/2.The union of the tree and the matching is a cycle, with no possible shortcuts, and with weight approximately 3n/2. However, the optimal solution uses the edges of weight 1 + ε together with two weight-1 edges incident to the endpoints of the path,and has total weight (1 + ε)(n − 2) + 2, close to n for small values of ε. Hence we obtain an approximation ratio of 3/2.

[ "Bottleneck traveling salesman problem", "2-opt", "Karloff–Zwick algorithm" ]
Parent Topic
Child Topic
    No Parent Topic