Solving NP problems in (usually) Polynomial time? - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-24T08:52:46Z http://mathoverflow.net/feeds/question/10358 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/10358/solving-np-problems-in-usually-polynomial-time Solving NP problems in (usually) Polynomial time? DoubleJay 2010-01-01T07:58:37Z 2012-03-03T21:49:14Z <p>Just because a problem is NP-complete doesn't mean it can't be usually solved quickly.</p> <p>The best example of this is probably the traveling salesman problem, for which extraordinarily large instances have been optimally solved using advanced heuristics, for instance sophisticated variations of <a href="http://en.wikipedia.org/wiki/Branch%5Fand%5Fbound" rel="nofollow">branch-and-bound</a>. The size of problems that can be solved exactly by these heuristics is mind-blowing, in comparison to the size one would naively predict from the fact that the problem is NP. For instance, a tour of all 25000 cities in Sweden has been solved, as has a VLSI of 85900 points (see <a href="http://www.tsp.gatech.edu/pla85900/index.html" rel="nofollow">here</a> for info on both).</p> <p>Now I have a few questions:</p> <p>1) There special cases of reasonably small size where these heuristics either cannot find the optimal tour at all, or where they are extremely slow to do so?</p> <p>2) In the average case (of uniformly distributed points, let's say), is it known whether the time to find the optimal tour using these heuristics is asymptotically exponential n, despite success in solving surprisingly large cases? Or is it asymptotically polynomial, or is such an analysis too difficult to perform?</p> <p>3) Is it correct to say that the existence of an average-case polynomial, worst-case exponential time algorithm to solve NP problems has no importance for P=NP?</p> <p>4) What can be said about the structure of problems that allow suprisingly large cases to be solved exactly through heuristic methods versus ones that don't? </p> http://mathoverflow.net/questions/10358/solving-np-problems-in-usually-polynomial-time/10360#10360 Answer by Harrison Brown for Solving NP problems in (usually) Polynomial time? Harrison Brown 2010-01-01T09:08:46Z 2010-01-01T19:09:09Z <p>Hmm, it's not an NP-complete problem, but hopefully it's still relevant to (4) and to a question I think is implicit in (2).</p> <p>It's well-known that linear programming is in P, but in practice the simplex algorithm (which is exponential in the worst case) is usually the fastest method to solve LP problems, and it's virtually always competitive with the polynomial-time interior point methods. However, sampling uniformly from some space of problems is an unrealistic model, so average-case analysis isn't convincing. Spielman and Tang introduced the notion of "smoothed analysis" to remedy this, and showed that the simplex algorithm has polynomial smoothed time complexity. Glancing at Spielman's page, it looks like this has been applied to the knapsack problem, although the link to the paper is broken.</p> <p>Re (1): What do you mean by "small?" :) I suspect that the heuristics would fail to help much if you took a random instance of, say, 3SAT with the right number of clauses and variables, and reduced this to an instance of TSP. But you'd get some polynomial-size blowup, so...</p> <p>Re (3): It's correct that the existence of such an algorithm, on its own, would imply neither P = NP nor P != NP. But for "practical considerations" it might be hugely important, depending on what the constants were, and it would certainly spur investigation into whether there was a worst-case polynomial algorithm along the same lines.</p> <p>ETA: Actually, here's a construction for an NP-complete problem and an algorithm which <em>unconditionally</em> runs in average-case polynomial time. The problem is the union of a language in P and an NP-complete language (solvable in exp(n) time), such that the number of instances of size n of the first problem is something like exp(n^3), while the number of instances of the second problem is exp(n).</p> <p>So the interesting thing about (3) is what the existence of an average-case polynomial algorithm for <em>every</em> problem in NP would tell us. And there the answer is still "nothing," but it's conceivable that we could prove P = NP under this assumption.</p> <p>By the way, Impagliazzo talks about some of these issues (although not all of them; the paper's 15 years old and predates Spielman-Tang, for instance) in <a href="http://cseweb.ucsd.edu/~russell/average.ps" rel="nofollow">perhaps the greatest survey paper ever written</a>. I highly recommend it.</p> http://mathoverflow.net/questions/10358/solving-np-problems-in-usually-polynomial-time/10369#10369 Answer by Steve Huntsman for Solving NP problems in (usually) Polynomial time? Steve Huntsman 2010-01-01T13:32:05Z 2010-01-01T13:32:05Z <p>Re: 1), NP-complete problems generally exhibit a phase transition in computational complexity. See R. Monasson, et al., "Determining computational complexity from characteristic `phase transitions'" <em>Nature</em> <strong>400</strong>, 133 (1999) (available near the bottom of the page at <a href="http://www.math.ucla.edu/~percus/Teaching/RIPS/refs.html" rel="nofollow">http://www.math.ucla.edu/~percus/Teaching/RIPS/refs.html</a> ) and also the answer to 3). Picking problems on or very near the phase boundaries does the trick. For TSP I would reckon that having lots of very similar pairwise distances between a subset of cities would be the sort of thing that would achieve this.</p> <p>Re: 2), I punt. See the other references in this answer.</p> <p>Re: 3), the answer I think would depend on the characteristic nature of the easy and hard problem instances. Susan Coppersmith has looked at this sort of thing in the context of the renormalization group to formulate a physics-flavored conjectural approach to the P/NP question. See <a href="http://arxiv.org/abs/cs/0608053" rel="nofollow">http://arxiv.org/abs/cs/0608053</a></p> <p>Re: 4), I doubt much can be said at present. For instance there are extremely good SAT solvers out there, capable of tackling (at least) thousands of variables and hundreds of thousands of clauses. See <a href="http://www.satcompetition.org/" rel="nofollow">http://www.satcompetition.org/</a></p> http://mathoverflow.net/questions/10358/solving-np-problems-in-usually-polynomial-time/10379#10379 Answer by Joel David Hamkins for Solving NP problems in (usually) Polynomial time? Joel David Hamkins 2010-01-01T15:42:37Z 2010-01-01T15:42:37Z <p>This phenomenon extends beyond the traveling salesman problem, and even beyond NP, for there are even some <em>undecidable</em> problems with the feature that most instances can be solved very quickly.</p> <p>There is an emerging subfield of complexity theory called <a href="http://en.wikipedia.org/wiki/Generic-case%5Fcomplexity" rel="nofollow">generic-case complexity</a>, which is concerned with decision problems in the generic case, the problem of solving most or nearly all instances of a given problem. This contrasts with the situtation in the classical complexity theory, where it is in effect the worst-case complexity that drives many complexity classifications. (And even for approximate solutions in NP-hard problems, the worst-case phenomenon is still present.)</p> <p>Particularly interesting is the <b>black-hole</b> phenomenon, the phenomenon by which the difficulty of an infeasible or even undecidable problem is concentrated in a very tiny region, outside of which it is easy. (Here, tiny means tiny with respect to some natural measure, such as asymptotic density.) For example, many of the classical decision problems from combinatorial group theory, such as the word problem and the conjugacy problem are linear time solvable in the generic case. This phenomenon provides a negative answer to analogue of your question 1 for these problems. The fact that the problems are easily solved outside the black hole provides a negative answer to the analogue of question 2. And I think that the fact that these problems are actually undecidable as total problems suggests that this manner of solving almost all cases of a problem will not help us with P vs. NP, in your question 3.</p> <p>For question 4, let me mention that an extreme version of the black-hole phenomenon is provided even by the classical halting problem. Of course, this is the most famous of undecidable problems. Nevertheless, Alexei Miasnikov and I proved that for one of the standard Turing machine models with a one-way infinite tape, there is an algorithm that solves the halting problem on a set of asymptotic measure one. That is, there is a set A of Turing machine programs, such that (1) almost every program is in A, in the sense of asymptotic density, (2) A is linear time decidable, and (3) the halting problem is linear time decidable for programs in A. This result appears in (J. D. Hamkins and A. Miasnikov, The halting problem is decidable on a set of asymptotic probability one, Notre Dame J. Formal Logic 47, 2006. <a href="http://arxiv.org/abs/math/0504351" rel="nofollow">http://arxiv.org/abs/math/0504351</a>). Inside the black hole, the complement of A, of course, the problem is intractible. The proof, unfortunately, does not fully generalize to all the other implementations of Turing machines, since for other models one finds a black hole of some measure intermediate between 0 and 1, rather than measure 0. </p> http://mathoverflow.net/questions/10358/solving-np-problems-in-usually-polynomial-time/10392#10392 Answer by Joseph Malkevitch for Solving NP problems in (usually) Polynomial time? Joseph Malkevitch 2010-01-01T19:08:04Z 2010-01-01T19:08:04Z <p>Another approach to NP-complete problems is via what has come to be called parameterized complexity. </p> <p>The idea is a problem may be "hard" when expressed in terms of the input size but one can reformulate the problem with a parameter k so that the problem is polynomial in terms of the input size but exponential in terms of the parameter k. In some situations this allows one to find algorithms that are "tractable" for small values of k.</p> <p><a href="http://en.wikipedia.org/wiki/Parameterized_complexity" rel="nofollow">http://en.wikipedia.org/wiki/Parameterized_complexity</a></p> <p><a href="http://fpt.wikidot.com/" rel="nofollow">http://fpt.wikidot.com/</a></p> http://mathoverflow.net/questions/10358/solving-np-problems-in-usually-polynomial-time/90105#90105 Answer by Benjamin Steinberg for Solving NP problems in (usually) Polynomial time? Benjamin Steinberg 2012-03-03T03:54:10Z 2012-03-03T03:54:10Z <p>Gurevich and Shelah show Hamitonian path problem has linear average case complexity with respect to the Erdos random graph model <a href="http://research.microsoft.com/en-us/um/people/gurevich/opera/71.pdf" rel="nofollow">http://research.microsoft.com/en-us/um/people/gurevich/opera/71.pdf</a></p> http://mathoverflow.net/questions/10358/solving-np-problems-in-usually-polynomial-time/90149#90149 Answer by Kaveh for Solving NP problems in (usually) Polynomial time? Kaveh 2012-03-03T21:49:14Z 2012-03-03T21:49:14Z <p>Your post seems to assume something like $\mathsf{P} \neq \mathsf{NP}$ and that an $\mathsf{NP\text{-}complete}$ problem is difficult to solve at least in theory. As you are probably aware, although widely believed by experts, it is unknown. </p> <p>But let's assume a stronger form of $\mathsf{NP}\neq\mathsf{P}$, for example <a href="http://en.wikipedia.org/wiki/Exponential_time_hypothesis" rel="nofollow">ETH</a>. SAT is one of the most widely studied $\mathsf {NP\text{-}complete}$ problems (if not the most), and there are easy reductions from SAT to TSP and vice versa. So I will use SAT to answer your questions, similar things apply to TSP (e.g. if you have a small hard instance of SAT then you can convert it to a small hard instance of TSP).</p> <p>Usually the instances we face in practice have considerably more structure than an arbitrary instance of the problem. Therefore researchers can design algorithms that exploit these structures. There are industrial SAT solver algorithms that are used to solve huge instances of SAT (with several hundred thousands variables) in practice. On the other hand, we know that all these SAT solvers perform exponentially bad on natural, simple, and small formulas like PHP (the pigeon hole principle).</p> <p>Similar structures exist in TSP problems, e.g. the graph of map of Sweden that you have mentioned is a planner graph, and many graph problems become much simpler when the input is restricted to planner graphs. So if the instances of TSP that you are interested in practice is a subset of all graphs then it is a different problem than the original TSP and it is possible that the restricted problem is not $\mathsf{NP\text{-}hard}$ anymore. (For some graph problems that become easier in restricted cases see <a href="http://cstheory.stackexchange.com/questions/2384/what-is-easy-for-minor-excluded-graphs" rel="nofollow">this question</a>.)</p> <ol> <li><p>Yes, there are small problem instances for which the algorithms used in practice to solve huge instances fail to solve these small problem instances in reasonable time, e.g. PHP for SAT.</p></li> <li><p>It is believed by many that is the case, but we don't have no unconditional exponential time lower-bounds on the running time of (general) algorithms solving these problems.</p></li> <li><p>If I understand correctly, you are asking something like: does $TSP \in$ <a href="http://qwiki.stanford.edu/index.php/Complexity_Zoo%3AA#avgp" rel="nofollow">$\mathsf{AveP}$</a> imply $\mathsf{NP} = \mathsf{P}$? As far as I know, this is unknown.</p></li> <li><p>I am not sure what you mean by solving using heuristics methods, but if you mean <a href="http://qwiki.stanford.edu/index.php/Complexity_Zoo%3AH#heurp" rel="nofollow">$\mathsf{HeurP}$</a>, and want to compare it with $\mathsf{P}$, then we should be careful since the problems in these classes are of different types. If you mean the original decision problem plus the uniform distribution, then the Zoo doesn't say much and the answer is probably unknown.</p></li> </ol>