NP Complete, Traveling Salesman Problem

Traveling Salesman Problem

A traveling salesman, or should I say salesperson, must leave home, visit a collection of cities, and return home, at minimal cost. The cities are vertices on a graph or digraph, and the costs are reflected in the edges. The cost could represent the distance between cities, if you're driving, or the air fare between cities, which has little to do with distance. If the costs are asymmetric, you'll need a digraph. Finding the path that minimizes cost is np complete.

Note that all the cities must be in a connected component of the graph, and any other components can be ignored.

A minimal path may take you through a city twice (repeated vertex), or along a road twice (repeated edge). We're not ruling anything out.

If a vertex is not on your itinerary, delete it, and draw direct connections instead. Thus, if you don't have to visit Atlanta, but it's a hub for a connecting flight from Richmond to Dallas, ignore Atlanta, and pretend like there's a direct flight from Richmond to Dallas, having the same cost (in dollars or time) as the connecting flight that you will be taking if you actually travel that route. Repeat this process until the only vertices that remain are your home, and the cities you must visit. If there are multiple edges between cities, which could easily happen after the aforementioned deletions, retain the edge with the lowest cost.

Now for the proof, and it's practically a corollary. Given a boolean expression, build a hamiltonian graph or digraph, as described in the previous section. You must visit each vertex, and the cost of every edge is 1. If there are n vertices in the graph, a hamiltonian circuit has cost n, and a shorter trip cannot visit all the cities. The optimal trip is a hamiltonian circuit, and that is an np complete problem.

Within a Factor of Two

The following statements are in my notes, without proof.

If the distances obey the triangular inequality, the minimal spanning tree outlines a path, traversing each edge twice, that is at most twice the cost of the optimal path.

In general (without the triangular inequality), finding a path that is ≤ twice the optimal path is np complete.