Christofides Heuristic
   HOME

TheInfoList



OR:

The Christofides algorithm or Christofides–Serdyukov algorithm is an
algorithm In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algorithms are used as specificat ...
for finding approximate solutions to the
travelling salesman problem The travelling salesman problem (also called the travelling salesperson problem or TSP) asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each cit ...
, on instances where the distances form a
metric space In mathematics, a metric space is a set together with a notion of ''distance'' between its elements, usually called points. The distance is measured by a function called a metric or distance function. Metric spaces are the most general settin ...
(they are symmetric and obey the
triangle inequality In mathematics, the triangle inequality states that for any triangle, the sum of the lengths of any two sides must be greater than or equal to the length of the remaining side. This statement permits the inclusion of degenerate triangles, but ...
).. It is an
approximation algorithm In computer science and operations research, approximation algorithms are efficient algorithms that find approximate solutions to optimization problems (in particular NP-hard problems) with provable guarantees on the distance of the returned solu ...
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, who discovered it independently in 1976. This algorithm still stands as the best polynomial time approximation algorithm that has been thoroughly peer-reviewed by the relevant scientific community for the traveling salesman problem on general metric spaces. In July 2020 however, 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. Their method 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. The paper was published at STOC'21 where it received a best paper award.


Algorithm

Let be an instance of the travelling salesman problem. That is, is a
complete graph In the mathematical field of graph theory, a complete graph is a simple undirected graph in which every pair of distinct vertices is connected by a unique edge. A complete digraph is a directed graph in which every pair of distinct vertices is c ...
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 In computer science, pseudocode is a plain language description of the steps in an algorithm or another system. Pseudocode often uses structural conventions of a normal programming language, but is intended for human reading rather than machine re ...
as follows. # Create a
minimum spanning tree A minimum spanning tree (MST) or minimum weight spanning tree is a subset of the edges of a connected, edge-weighted undirected graph that connects all the vertices together, without any cycles and with the minimum possible total edge weight. T ...
of . # Let be the set of vertices with odd
degree Degree may refer to: As a unit of measurement * Degree (angle), a unit of angle measurement ** Degree of geographical latitude ** Degree of geographical longitude * Degree symbol (°), a notation used in science, engineering, and mathematics ...
in . By the
handshaking lemma In graph theory, a branch of mathematics, the handshaking lemma is the statement that, in every finite undirected graph, the number of vertices that touch an odd number of edges is even. In more colloquial terms, in a party of people some of whom ...
, has an even number of vertices. # Find a minimum-weight
perfect matching In graph theory, a perfect matching in a graph is a matching that covers every vertex of the graph. More formally, given a graph , a perfect matching in is a subset of edge set , such that every vertex in the vertex set is adjacent to exactly ...
in the
induced subgraph In the mathematical field of graph theory, an induced subgraph of a graph is another graph, formed from a subset of the vertices of the graph and ''all'' of the edges (from the original graph) connecting pairs of vertices in that subset. Defini ...
given by the vertices from . # Combine the edges of and to form a connected
multigraph In mathematics, and more specifically in graph theory, a multigraph is a graph which is permitted to have multiple edges (also called ''parallel edges''), that is, edges that have the same end nodes. Thus two vertices may be connected by more ...
in which each vertex has even degree. # Form an
Eulerian circuit In graph theory, an Eulerian trail (or Eulerian path) is a trail in a finite graph that visits every edge exactly once (allowing for revisiting vertices). Similarly, an Eulerian circuit or Eulerian cycle is an Eulerian trail that starts and ends ...
in . # Make the circuit found in previous step into a
Hamiltonian circuit In the mathematical field of graph theory, a Hamiltonian path (or traceable path) is a path in an undirected or directed graph that visits each vertex exactly once. A Hamiltonian cycle (or Hamiltonian circuit) is a cycle that visits each vertex e ...
by skipping repeated vertices (''shortcutting''). The steps 5 and 6 do not necessarily yield only one result. As such the heuristic can give several different paths.


Approximation ratio

The cost of the solution produced by the algorithm is within 3/2 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 . 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. 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, shortcutting does not increase the weight, so the weight of the output is also at most .


Lower bounds

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 A path is a route for physical travel – see Trail. Path or PATH may also refer to: Physical paths of different types * Bicycle path * Bridle path, used by people on horseback * Course (navigation), the intended path of a vehicle * Desire p ...
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 path In graph theory, the shortest path problem is the problem of finding a path between two vertices (or nodes) in a graph such that the sum of the weights of its constituent edges is minimized. The problem of finding the shortest path between tw ...
s 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.}.


Example


References

{{reflist, 30em


External links


NIST Christofides Algorithm Definition
1976 in computing Travelling salesman problem Graph algorithms Spanning tree Approximation algorithms