The Christofides algorithm or Christofides–Serdyukov 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).[1] 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 and Anatoliy I. Serdyukov (Russian: Анатолий Иванович Сердюков); the latter discovered it independently in 1976 (but the publication is dated 1978).
Let be an instance of the travelling salesman problem. That is, is a complete graph on the set of vertices, and the function assigns a nonnegative real weight to every edge of .According to the triangle inequality, for every three vertices,, and, it should be the case that .
Then the algorithm can be described in pseudocode as follows.[1]
Steps 5 and 6 do not necessarily yield only a single result; as such, the heuristic can give several different paths.
The worst-case complexity of the algorithm is dominated by the perfect matching step, which has
O(n3)
O(n3logn)
The cost of the solution produced by the algorithm is within of the optimum.To prove this, let be the optimal traveling salesman tour. Removing an edge from produces a spanning tree, which must have weight at least that of the minimum spanning tree, implying that - lower bound to the cost of the optimal solution.
The algorithm addresses the problem that is not a tour by identifying all the odd degree vertices in ; since the sum of degrees in any graph is even (by the Handshaking lemma), there is an even number of such vertices. The algorithm finds a minimum-weight perfect matching among the odd-degree ones.
Next, number the vertices of in cyclic order around, and partition 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 that matches the two endpoints of each path, and the weight of this matching is at most equal to the weight of the paths. In fact, each path endpoint will be connected to another endpoint, which also has an odd number of visits due to the nature of the tour.
Since these two sets of paths partition the edges of, one of the two sets has at most half of the weight of, and thanks to the triangle inequality its corresponding matching has weight that is also at most half the weight of .The minimum-weight perfect matching can have no larger weight, so .Adding the weights of and gives the weight of the Euler tour, at most . Thanks to the triangle inequality, even though the Euler tour might revisit vertices, shortcutting does not increase the weight,so the weight of the output is also at most .
There exist inputs to the travelling salesman problem that cause the Christofides algorithm to find a solution whose approximation ratio is arbitrarily close to . One such class of inputs are formed by a path of vertices, with the path edges having weight, together with a set of edges connecting vertices two steps apart in the path with weight 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, and the only two odd vertices will be the path endpoints, whose perfect matching consists of a single edge with weight approximately .
The union of the tree and the matching is a cycle, with no possible shortcuts, and with weight approximately . However, the optimal solution uses the edges of weight together with two weight- edges incident to the endpoints of the path,and has total weight, close to for small values of . Hence we obtain an approximation ratio of 3/2.[2]
This algorithm still stands as the best polynomial time approximation algorithm for the stated problem that has been thoroughly peer-reviewed by the relevant scientific community for the traveling salesman problem on general metric spaces. In July 2020 Karlin, Klein, and Gharan released a preprint in which they introduced a novel approximation algorithm and claimed that its approximation ratio is 1.5 - 10−36. Theirs is a randomized algorithm and it follows similar principles to Christofides' algorithm, but uses a randomly chosen tree from a carefully chosen random distribution in place of the minimum spanning tree.[3] [4] The paper was published at STOC'21[5] where it received a best paper award.[6]
In the special case of Euclidean space, for any c > 0, where d is the number of dimensions in the Euclidean space, there is a polynomial-time algorithm that finds a tour of length at most (1 + 1/c) times the optimal for geometric instances of TSP in
O\left(n(logn)(O(c))d-1
this is called a polynomial-time approximation scheme (PTAS).[7] Sanjeev Arora and Joseph S. B. Mitchell were awarded the Gödel Prize in 2010 for their simultaneous discovery of a PTAS for the Euclidean TSP.