P vs. NP and the Computational Complexity Zoo (2014) [video]
youtube.com
youtube.com
I'm always impressed when I see someone who can communicate ideas, especially complex scientific concepts, clearly and effectively, using analogies in a proper way that doesn't just overwhelm the viewer (as a lot of popsci stuff does). It's a talent I know that I need to work on; as a fledgling academic attempting to write papers clearly I struggle with it. Does it simply come with practice or are there resources anyone here can recommend for improving one's ability to make hard ideas understandable?
He also includes Traveling salesman in the class NP. I think there is some debate about whether traveling salesman is NP-Complete, as that would require a polynomial algorithm to check whether in fact your solution was the shortest. https://www.ibm.com/developerworks/community/blogs/jfp/entry...
> There is no debate, plain travelling salesman
> is defiantly not known to be NP-complete.
Actually, there is no debate, plain TSP is specifically not NP-complete and cannot be, because it's not a decision problem. So it's not just, as you say, "not known to be" but instead is "known not to be".However, by using binary search you can convert a decision version of TSP into the optimisation version in polynomial time. In this sense it is perfectly reasonable to refer to TSP as being NP-Complete.
I agree completely that these sorts of differences actually matter when dealing with the technicalities, but in practice it makes sense not to worry too much when trying to explain the broader concepts.
The decision version of TSP would be formulated as: Given a complete graph G and a budget b, decide if there exists a path that visits each node and has cumulative weight less than b.
If you have a solver for decision TSP, then you can solve the optimization version of TSP by performing binary search on the budget b.
I'm glossing over some details, but there's a clearer explanation on how to solve search problems with an oracle for decision problems in Sipser.
Traveling salesman is in NP. There is no point debating this.
Edit: as others have pointed out: traveling salesman in in NP only when it is in its decision version. Otherwise the question does not make sense, as standard complexity classes are defined for decision problems, this is - for languages.
It's kind of imprecise, but the understanding in these situations is that you're talking about some bounded version of the problem. In TSP, it's common to mean the problem of "is there a solution of length less than N", and you're only verifying that the length is less than N, not that it's optimal.
1. Practice, practice, practice.
2. Find good examples (like this video) and try to extract and generalize the techniques that you think work really well.
and the last point which not everyone thinks of consciously:
3. Watch sports, read books, watch TV and movies, read the news, and go outside. When you must communicate by analogy, you need a broad pool of experiences to draw from so that you can match your audience.
http://betterexplained.com/articles/adept-method/
It's by the author of better explained - a really great math teaching site.
The video is very well structured and goes from very basic explanations of the concept of complexity up to the different classes of complexities.
My expectation, however, is that either P!=NP or if it isn't, we will probably find out because some day, some guy wanted his program to run a little faster and he just happens to solve A NP-complete problem in polynomial time, therefore collapsing NP into P (remember, solving one of them solves all of them). Who knows, maybe the source code for some random Indie game someone programmed in his basement already contains the solution and nobody has noticed, a bit like back in the day with quakes "fast-inverse square root", which was so great it's now integral part of graphics computing. And we only noticed because the water looked so great.
https://www.reddit.com/r/programming/comments/372634/the_n_v...
After a bunch of Googling the only source I can find for this is a 2007 religious apologetics book with no Amazon reviews. I can't even find a French version of the quote. Anyone know if it's legitimate? And a more interesting question: if no one has ever even reviewed this book, how is it all over the Internet as the source of this quote?
EDIT: Oops, looks like it is not religious apologetics. Still, I'm curious how a (presumably manufactured) quote like this spreads from such an obscure source.
Case 1, it's proved that P = NP, and the complexity of solving an NP problem is N^1000. Case 2, it's proved that P != NP, and the complexity of solving an NP problem is N^log log log log N.
In both cases, the result is technically correct (case 1 is polynomial, case 2 is exponential), but from a practical standpoint this proof that P != NP is much more world changing than this proof that P = NP. For example, you'd have to have a problem size that's measured in hundreds of digits before even getting to N^3!
Similar arguments apply to case 1. (We know quite a bit about how a proof of NP ?= P could _not_ look like, because people already proved that certain strategies for a proof don't work. I am not sure if we can already rule out N^log log log log N, but it wouldn't surprise me.)
We find that algorithms we have identified in P usually have small exponents. This may simply be selection bias, if we are poor at coming up with n^4+ algorithms.
There are problems that we hope are hard in the average case. Like breaking cryptography.
It's nice and simple to talk like that, but I don't think it's particularly useful or helpful.
For example, there is a linear time algorithm for deciding whether two planar graphs are isomorphic (Hopcroft,Wong 1974). But the constant of the asymptotic time bound of their algorithm so large that it was not useful or practical (see end of abstract, http://dl.acm.org/citation.cfm?id=803896)
Only in 2004 did Kukluk, Holder, Cook publish a quadratic time algorithm, "suitable for practical implementation." http://www.eecs.wsu.edu/~holder/pubs/KuklukJGAA04.pdf
More such examples are listed at "Polynomial-time algorithms with huge exponent/constant," http://cstheory.stackexchange.com/questions/6660/polynomial-...
I think that all problems with a set definition for "solved" is solvable as in "P".
For example, the rubik's cube is solved if all sides have a solid color. And is thus a "P".
P = Set of problems for which we can find a solution in polynomial time in the length of the input.
Clearly, P \subseteq NP. Proving P = NP would require proving NP \subseteq P, something which most people would believe to be a) highly unlikely b) difficult.
/brainstorming
To prove P = NP, you would have to prove that one of the many NP-Complete problems has a polytime algorithm. Well that's not the only way to prove P = NP, but that's one approach.
There are many NP-Complete problems, and there are many NP problems that are thought to be neither NPC nor in P.
In fact, if P != NP, there are infinitely many such problems.
So proving P != NP could proceed by finding some problem in NP that is not also in P.
* the problem's class
* the algorithm.. or proof
* the size of the input
* the problem's class:each problem has a corresponding class(i) determined by a universal set of rules based on current solving algorithms and how they react to different input
in a beautiful and approachable paper by richard karp titled: reducibility among combinatorial problems(ii); karp showed that the hardest problems, that seem unable to be solved in polynomial or subpolynomial time, called NP-Hard, are basically all the same problem viewed from different perspectives
karp develops reducibility, a process used to show that one can reduce any of his 21 chosen problems into any of the others through a specific tree of transformations he calls reductions
this set of problems that form the tree of reductions is called NP-Complete
i say it is approachable because this paper develops reducibility and as such lacks any assumption about the reader's previous knowledge
.
* the algorithm:
check out this chart(iii) that lists some time complexities, you will see polynomial,P, time about mid way through
polynomial time is 2^O(log n) or poly(n), that 'O()' syntax is something called big O, which is analogous to a sort of algorithmic measurement unit(iv) derived from number of necessary operations in relation to the size of the input
all algorithms before the polynomial time listing are sub polynomial time for any inputs and as such are classified as P
.
* the size of the input:
lots of np problems have algorithm solutions that can solve specific inputs in polynomial time
sometimes those inputs are small, or follow a specific pattern, but a general purpose algorithm, or a collection of specific algorithms that can be proved to cover all possible inputs, that runs in a reduced(v) complexity of polynomial or sub polynomial time is necessary to be classified P
one way to prove P=NP is to take one of karp's problems and develop an algorithm that satisfies the above stated requirements
once developed karp's reductions can be used on the algorithm to show that all NP-Complete problems are in P as well, therefore P=NP
.
(i) http://en.wikipedia.org/wiki/Complexity_class
(ii) http://www.cs.berkeley.edu/~luca/cs172/karp.pdf
(iii) http://en.wikipedia.org/wiki/Time_complexity#Table_of_common...
(iv) http://en.wikipedia.org/wiki/Big_O_notation
(v) https://justin.abrah.ms/computer-science/big-o-notation-expl...
For a problem you can have a number of different algorithms to solve the problem. And a number of algorithms to check the solution to a problem. This is a point that is skipped over and trips lay people up because in school people are usually taught _the algorithm_ for solving a problem. But there are all sorts of ways to skin the cat mathematically. Some of these algorithms are great and some are 'bad'
Polynomial time algorithms are good. Ones that blow up exponentially are bad.
The question is, if you find a good polynomial time checking algorithm for a problem, does that mean there are polynomial time solving algorithms for that problem? Or not.
http://www.amazon.com/Algorithm-Design-Jon-Kleinberg/dp/0321...
and i found this integer programming tutorial comprehensive in offering practical applications of the desired algorithm(ii)
do any of these examples explain the problem best for you? can you write a program that will solve this question for you? now change the values of the variables, increase the number of variables
does your algorithm still work on these other inputs?
can you rewrite the algorithm to give the correct answers for these other inputs?
can you develop enough coverage to prove all possible inputs return correct values?
if your coverage is substantial, seemingly complete, can you write against your algorithm to find inputs that will still require you to further develop the algorithm?
for me, i felt i was able to follow the explanation for how the author found the answer and through that was able to start to see the shape of the coverage necessary to accommodate such a problem (iii)
this specific tutorial is on integer programming.. one of karp's 21, and through reduction on our understanding of 0-1 integer programming we can understand all of the other 21
(i) http://www.cs.berkeley.edu/~luca/cs172/karp.pdf
(ii) http://mat.gsia.cmu.edu/orclass/integer/integer.html
(iii) http://mat.gsia.cmu.edu/orclass/integer/node4.html#SECTION00...
My reaction to the video lecture: Wow. Amazing. Gee whiz. P versus NP. What a biggie! Or is it?
There does seem to be a little, tiny, itsy, bitsy point where the lecture went off the track:
The lecture gave a big list of some of the amazing things we could do if we could prove that P = NP. Some of the items on that list were protein folding (to cure cancer) and scheduling.
Right? Not so much:
If someone has an important problem in scheduling, protein folding or any of the NP-complete problems, bring forward that actual, specific, instance of the real problem.
Why? Because there's no proof and little evidence that finding a solution will be too difficult for "current computers".
To this claim I can hear the complaint now:
"But, but, but, the problems in NP-complete are too difficult to solve for current computers because as the problem size increases, the best known algorithms have running time that grows as an exponential in the size of the problem, and exponential growth limits us to problem instances of just small down to tiny size."
Yup, can hear that complaint.
Good news, guys: The complaint is false and does not correctly explain the challenge of NP-complete.
E.g,, 0-1 integer linear programming is in NP-complete, but I can write down, as fast as I can type, such problems about as big as you please that I, or anyone, can solve quickly just by simple inspection.
It's true.
E.g., for any positive integer n, consider the 0-1 integer linear programming problem
max z = 1 * x1 + 2 * x2 + ... + n * xn
subject to
x1 + x2 + ... + xn = 1
x1, x2, ..., xn = 0 or 1
So, the error in the complaint is that
actually the question of P versus NP has
to do with worst case instances of the
problems. But practical instances are not
all worst case, and for many of the
practical instances we can get solutions.So, for any particular actual, specific, instance of a real problem, bring it forward -- you might be able to get a solution.
And, wait, there's more!
For a problem like scheduling, mostly what is desired is just to save money in the actual operations, say, airlines where we need to schedule the planes for the planned flights, the crews, and maintenance for the planes.
Since the planes do fly, tough to convince me that the scheduling is impossible.
So, if spending $200 million a month on operations, an optimal schedule could save $20 million, can find a schedule that is approximately optimal and saves all but the last $100,000, then take the $19,900,000 savings and be happy.
The claim "we want to show that P = NP so that we can solve all these important problems" has been going on since the cartoon early in
Michael R. Garey and David S. Johnson, 'Computers and Intractability: A Guide to the Theory of NP-Completeness'.
where the mathematician stood before the business executive and admitted that he could not solve the executive's problem but neither could any of the mathematicians in a long line.
Likely nonsense: The mathematician was likely just looking for a long term job and actually not at all interested in solving the executive's problem.
Why? Because there was no indication that the executive's problem was large and worst case and needed an exactly optimal solution instead of a nearly optimal solution. The executive's problem might have been relatively easy to solve, with a nearly optimal solution and maybe with an exactly optimal solution.
Indeed, the book was from Bell Labs where one of their interests was network design. Well, since the phones did work, somehow Bell did find feasible solutions. Optimal? Maybe not.
So, what was "the executive's problem" that was in NP-complete and "too difficult to solve?". Maybe he just wanted to design a telecommunications network to have the needed performance and reliability and, otherwise, get the cost down as much as possible or nearly so. Finding an algorithm that shows that P = NP is very likely a significantly different problem, not his problem, and not necessary for his problem.
This erroneous belief that all large instances of problems in NP-complete are too difficult to solve is too common: E.g., once I got a problem in allocation of marketing resources. The instance was 0-1 integer linear programming with 40,000 constraints and 600,000 variables.
I thought for a day or so, typed in some software, did some Lagrangian relaxation, and in 905 seconds on a 90 MHz PC got a feasible solution guaranteed to be within 0.025% of optimality. Close enough for gumment work!
Then, later, as I was considering network design for the Internet, I got an interview at a network design startup in Texas and mentioned the problem with the 600,000 variables.
Well, the whole technical staff was on the other side of the table, had heard the horror stories about NP-complete in college, and concluded to a person that I was claiming to have done the impossible and had to be lying.
I left without a job offer, and they soon went out of business.
By the way, Mother Nature does protein folding, right? Hmm ....
>By the way, Mother Nature does protein folding, right?
Yes, but it does it directly without simulating any models of itself. As soon as you add the indirection and abstraction needed for human communication, you can't use those methods.
That's like saying "Usain Bolt can run fast, so you should be able to run fast just by pretending to be him." You can't be nature by pretending to act like it in an abstract model. I can't solve a protein folding problem by simply realizing that my body already folds proteins. That has nothing to do with the mental models of protein folding we use.
No. My point is that the video clip claimed too much for the importance in practice of finding an algorithm that shows that P = NP. Here the video clip was wrong.
In particular, the video clip mentioned scheduling problems. Yes, they are important. But as in my scenario, if, say, in airline scheduling where we are spending $200 million now, an optimal solution could save $20 million, and we can get a solution that will save all but the last $100,000, then we should take the savings of $19,900,000 and be happy. And, a solution that saves $19,900,000, saves nearly 10% of the $200 million, saves all but the last $100,000, saves all but that last 0.05% of the $200 million is, from the point of view of the airline, not at all "half-ass".
Or, if we are going to say that the research question of P versus NP is important for scheduling, which the video clip does, then we have to accept the clear, blunt fact that what is really important in scheduling is just saving money, and saving all but the last 0.05% is essentially just what the heck we really want.
The reason the clip was wrong is that much of the challenge of the question of P versus NP is the focus on worst case problems, but not nearly all practical instances of problems in NP-complete are worst case.
So, for important practical problems, e.g., 0-1 integer linear programming, we've known for several decades that often in practice we can get optimal solutions. E.g., in less than a minute at Google I found at
http://www.wired.com/2013/01/traveling-salesman-problem/
"The shortest traveling salesman route going through all 13,509 cities in the United States with a population of at least 500 (as of 1998)."
In my experience, it's been the case for decades that a surprisingly large fraction of applied mathematicians working on optimization of problems in NP-complete are overly focused, nearly obsessive, with nearly religious fervor, over getting solutions that are optimal, down to the last tiny fraction of the last penny, always and rejecting anything else as sloppy, irresponsible, immoral or some such, maybe "half ass". This really was the attitude in the cartoon early in Garey and Johnson.
Yes, it was darned nice to have heap sort: From the Gleason bound, for positive integer n, to sort n items by comparing pairs, can't run faster than O( n ln(n) ). Then, in both average case and worst case, heap sort does this. Nice. Super nice. Call a heap sort routine and know that will get O( n ln(n) ) performance, no ifs, ands, or buts about it.
So, sure, worst case guarantees are nice to have. Always necessary? No. Nice? Yes.
At one point there was a problem of assigning anti-ballistic missiles to incoming warheads, and it would be really nice to have an algorithm with guaranteed polynomial worst case performance. Well, can attack that problem with least cost network flows and attack that with the network version of the simplex algorithm of linear programming. With a modification for strongly feasible bases, can be sure that the algorithm will not cycle. But do we have a polynomial worst case guarantee? Apparently not. But there is an algorithm for that assignment problem with such a guarantee. Apparently the main name is D. Bertsekas, long at MIT. Nice work.
And for solving the optimization problems in NP-complete, again it would be really nice to have an algorithm that is fast and polynomial on worst case problems. Solid gold, diamond encrusted algorithm. Nice? Yes. Doable now? No. Necessary in practice? Often no.
So, we don't have our dream solid gold, diamond encrusted algorithm. The video clip is essentially claiming that we need a solid gold diamond encrusted algorithm to solve practical scheduling problems. This claim is claiming too much and is false.
Gee, this is like claiming that because we don't have a Rolls Royce we can't take our old Chevy to the grocery store. Nope: Sure, it might be nice to have a Rolls, but in the meanwhile we are hungry, need to get to the grocery store, and our old Chevy will do just fine.
The video clip is saying that because we don't have our dream solid gold solution, we have to go hungry until we show P = NP. Nonsense. Again, this nonsense has been going on for decades, all the way back to the cartoon in Garey and Johnson, the cartoon that claimed that no mathematician could solve the executive's problem. Likely nonsense: Maybe true if bend way over backwards to make in practice an absurd rewrite of the executive's problem as to have a guarantee to save the very last tiny fraction of the last penny, with a polynomial algorithm, on the worst case problems that can exist -- the executive likely doesn't give even a drop of coffee for that very last tiny fraction of one penny, likely does not have worst case problems, and for his problem sizes doesn't necessarily need a polynomial algorithm. The cartoon was wacko.
Scheduling and many other problems in NP-complete are darned important in practice. E.g., saving that $19,900,000 is darned important. The video clip is saying that need to get the very last tiny fraction of the last penny of savings on arbitrarily large, worst case problems and, thus, need to show that P = NP. Wrong: The real importance of the scheduling problem is to save the first $19,900,000 and not the last $100,000. And there is no moral shame in leaving the last $100,000, 0.05%, not saved.
My point here is totally simple, clear, and obvious. Just why too much of the relevant applied math community wants to take the erroneous position of the video clip or the cartoon in Garey and Johnson, essentially be moralistic about the last 0.05% and optimality, is beyond me.
Yes, in some early texts in operations research, optimality was taken as essentially a moral absolute.
My remark that nature solves protein folding problems quickly and routinely was to address a possible philosophical question: Is it possible in this universe to construct a machine that can solve large protein folding problems quickly or are such problems so challenging that somehow they are beyond this universe? Well, the problems are not beyond this universe, and likely nearly any animal, life form, or even virus is an example of a machine that does solve such problems. So, such a machine really is possible. So, more specifically, if protein folding is in NP-complete, then maybe actually P = NP -- which would surprise many researchers in that field.
Moreover, while the most obvious way of proving P = NP would be to find a P solution to an NP-complete problem, it's possible that someone will show existence of such a solution without being able to identify the particular solution. In that case, we don't get to do anything we couldn't do before.
It's also possible that we'll find a solution to an NP-complete problem that's O(n^million). That's in P, but may be substantially more out of reach than our O(2^n) approaches on realistically sized problems.
But my post was not really about your
"way of proving P = NP".
Instead I was considering the statement in the video that showing P = NP is important because it would let us make progress on protein folding (for curing cancer), scheduling, etc. I object to that statement because for a significant fraction of such problem instances, including some impressively large, we have a significantly good chance of getting solutions now and do not have to wait for more research on P versus NP.
My point, then, was, if someone has some actual problems in protein folding, scheduling, and other NP-complete problems, likely they do not have to wait for an algorithm that shows P = NP. Instead there's a significant chance that current algorithms, software, and computers can solve their problem instances.
Again, NP-complete problems of size n clearly are too challenging for "current computers" for exact solutions to worst case problems with large n. Here note the worst case. Instead, and as I illustrated, there are instances of NP-complete problems, e.g., 0-1 integer linear programming, where it is quite routine to find optimal solutions to real problem instances with impressively large n.
Important names for such work include G. Nemhauser, E. Johnson, R. Bixby. That is, the field of operations research has been attacking and solving important, practical instances of problems in NP-complete for several decades.
Again, if there are some important instances of some NP-complete problems, then don't have to wait for P = NP and, instead, should bring the problems forward now -- solutions may be reasonably easy to find now.
That is, where the video clip was essentially claiming that to solve problems in protein folding, scheduling, etc., we have to wait for a proof showing P = NP was wrong -- for optimal solutions to worst case instances of large problems, we have to wait, but not all practical instances are worst case, and sometimes we are quite happy with nearly optimal solutions.
P is defined as the class of problems decidable in polynomial time on a classical Turing machine.
P doesn't change with the advent of quantum computers.
Also it is suspected that BQP \not \subset NP, i.e. there are problems in BQP that might not be in NP.