The Travelling Salesman’s Power



What would the world be like, if TSP were in P?



Benjamin Krause is the one person in the world who can say he has composed what sounds like. He composed the score for the movie Travelling Salesman, which is due to premiere on June 16. The movie is written and directed by Timothy Lanzone, and produced by Preston Clay Reed under the aegis of Fretboard Pictures.

Today Dick and I ask whether our world would really change much if the Travelling Salesman Problem (TSP) were solvable by a polynomial-time algorithm.

At last someone is taking the position that is a possibility seriously. If nothing else, the film’s brain trust realize that being equal is the cool direction, the direction with the most excitement, the most worthy of a major motion picture. We doubt there could be a cool movie that builds a story around a lower bound.

As Krause described in a post on his own blog in December 2010:

The film depicts the heated backroom discussions of four mathematicians who have solved the P vs. NP problem and a government agent (a severe, creepy, Big-Brotherish sort of guy) who has come to collect their findings and coerce them into silence.

Last month he linked the film’s trailer. Say what you will, the sound of is foreboding. The trailer proclaims: “Death, destruction, annihiliation, everything—simplified.” We can temper this with a few observations.

Some Notes

First of all, we are already pretty close to living in a world where . Although TSP is -complete, it is considered among the easiest to solve in practice, especially the familiar version with cities in the Euclidean plane. Dick’s colleague William Cook maintains a vast page on TSP, including his recent book In Pursuit of the Traveling Salesman. (No typo here—our salesman loses an ‘ ‘ when he visits America.) Although all known -complete problems are related by polynomial-time computable isomorphisms, these can have quadratic overhead and do not always preserve problem-solving structure. Some -complete problems show their hardness in important cases, but David S. Johnson, who began his seminal work on TSP in the 1980’s, was already fond of saying two decades ago that instances with hundreds of cities were by-and-large solvable exactly. Real-world cases solved exactly include:

Second, we are not talking about the possibility of a proverbial -time algorithm, which would show in theory but of itself be practically useless. Nor do we mean small-exponent algorithms with huge constants like the -time deciders originally found for certain graph-minor related problems by Neil Robertson and Paul Seymour. We covered this here, and discussed it among others we like to call galactic algorithms here.

No, let us get down to Earth and suppose TSP has a linear-time algorithm, with a reasonable constant, not only for the Euclidean plane but for general graphs provided they are fairly dense. What then?

Too Much Information, Too Little Power?

Let us first bait-and-switch by discussing the -complete Independent Set problem, because its standard reduction from Three-Satisfiability (3SAT) exemplifies our point better. Given a 3SAT instance with clauses, the reduction builds a graph with nodes and edges, a sparse graph. The constant in the is small, since the clause gadgets have three nodes each and the connections to truth settings of the variables are single edges. Say this graph has “SAT-power” proportional to its size.

We can imagine, however, that important instances of Independent Set have average vertex degree higher than , say which is still fairly sparse. In proportion to their size , these graphs may have SAT-power only . In practice these instances, for relevant sizes of , might present themselves as being fairly easy. They have a lot more information from the greater number of edges, but it might not be contributing to the hardness.

Now the reductions from 3SAT to TSP, especially Euclidean TSP, are less familiar, and we ascribe this to their being far more “expansive.” Texts usually reduce 3SAT to Hamiltonian Cycle, then present the latter as a special case of TSP, but this does not apply to Euclidean TSP. The -completeness of Euclidean TSP took a few years until being shown by Christos Papadimitriou, and a 1981 paper by him with Alon Itai and Jayme Luiz Szwarcfiter advertised a “new, relatively simple, proof.” This proof uses vertex-induced subgraphs of the grid graph in the plane, for which the shortest possible TSP tour and any Hamiltonian cycle have the same length. Despite this simplification, the gadgets involved are large—a diagram of one occupies most of one journal page. Note that it is open whether Euclidean TSP is -hard for “solid,” i.e. hole-free, grid graphs. Here is one of many smaller gadgets in their proof:

The point is that these instances have very low relative SAT-power, and this may be true of common instances of the same size. The idea of classifying -complete problems this way emerged in the 1980’s as the “Power Index” of Richard Stearns and Harry Hunt III, which presaged the Exponential Time Hypothesis of Russell Impagliazzo and Ramamohan Paturi, and in work by Alexander Dewdney on the fine-tuned time complexity of reductions between complete problems. Stearns and Hunt’s paper notes that planar Hamiltoniam Circuit has power index at most , and speculates that Euclidean TSP may be as low as .

Thus even a linear-time solver for Euclidean TSP might not confer enough power for solving sizable instances of the harder problems. Some instances of over 10,000 cities have been solved exactly, and the same methods work well on many cases with 1,000 cities, but if the SAT-power is only or from a quartic or cubic-time reduction, then we’re only able to apply it to formulas with ten-or-so variables, and even in the latter cases is only 100.

Here are the Movies

The new film does give a positive answer to a question Dick asked in the first month of this blog:

Where are the movies on P=NP?

We can perhaps already say movies plural: this web article has picked up on John Nash’s 1955 letter proposing “concepts that presage modern cryptography and computational complexity theory” in its blurb on “A Beautiful Mind,” and we’ve always had “Sneakers.”

Here is the “Story” summary on the film’s website, edited by us:

“Travelling Salesman” is an intellectual thriller about four mathematicians hired by the U.S. government to solve the most elusive problem in computer science history — P vs. NP. The four have jointly created a “system” which could be the next major advancement for our civilization or destroy the fabric of humanity. The solution’s immediate use would exist within computer science. However, its application would soon extend to countless other disciplines. For example, by utilizing the solution to P vs. NP, a hacker can crack advanced encryption codes within seconds–a task that now takes weeks, months, or even years. He could break into La Guardia’s air traffic control or China’s communication grid. But the mathematical algorithm would also serve as the basis for accelerated biological research, curing diseases such as AIDS and cancer. …As the mathematicians are about to sign documents that will give the US government sole and private ownership of their solution, they wrestle with the moral dilemma of how this volatile discovery will be used. The math is real. The implications are real.

Despite our caveat that a solution to TSP might not be to die for, let alone to kill for, it would certainly be a huge change in our knowledge of the world. The implications could be unlimited.

We certainly hope the movie raises awareness of computer science theory and the life importance of its subject matter. As we said it is coming out in June.

Open Problems

Can one reduce -clause 3SAT to problems on dense graphs with nodes? Is Euclidean TSP hard or easy for solid grid graphs?

[word fixes and clarifications in paragraphs on Independent Set and Euclidean TSP]