A decision problem belongs to NP if every yes-instance has a polynomial-length certificate verifiable by a deterministic polynomial-time algorithm. It is NP-hard if every problem in NP has a polynomial-time many-one reduction to it. It is NP-complete if it is both NP-hard and in NP.
A polynomial-time algorithm for any NP-complete problem would therefore give one for every problem in NP, implying . Conversely, if , all NP-complete decision problems have polynomial-time algorithms. NP-completeness does not unconditionally prove that polynomial-time solution is impossible. Optimization problems such as minimum tour cost are described as NP-hard, while their threshold decision versions can be NP-complete.
For a minimization problem with nonnegative costs, an approximation algorithm of ratio is a polynomial-time algorithm returning a feasible solution of cost at most times the optimum on every instance. For maximization, one often uses with value at least ; an equivalent convention uses ratios at most one. The metric-tour question uses the minimization convention.
Reduce the Hamiltonian cycle decision problem to the metric travelling salesman problem. Given a simple graph on vertices, form the complete graph with distance on original edges and distance on nonedges. These symmetric distances satisfy the triangle inequality, since a direct distance is at most and any two positive edge distances sum to at least .
A tour has edges, each of cost at least . It has cost at most exactly when every edge is an original graph edge, that is, exactly when the original graph has a Hamiltonian cycle. The construction and threshold are polynomial in the input size. Thus the metric travelling salesman problem is NP-hard; its rational-cost threshold version is also in NP because a tour is a polynomial-size certificate.
Allowing repeated vertex visits does not reduce the optimum for a complete metric instance. Given a closed walk visiting every vertex, keep the vertices in order of first appearance and shortcut the portions between them, including the final return. The triangle inequality makes the resulting Hamiltonian tour no more expensive. Conversely a Hamiltonian tour is an allowed closed walk. Hence the two optimal costs are equal, and the repeated-visit metric version remains NP-hard. If travel is described on a sparse graph, taking its shortest-path metric gives the corresponding closed-walk formulation rather than an easier exact problem.
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.
Articles by others on the same topic
There are currently no matching articles.