P and NP

advertisement



P and NP
 P corresponds to a class of problems that can be solved in polynomial time
 NP corresponds to a class of problems whose solution can be checked in
polynomial time.
 P=NP?
 We know that P is a subset of NP
 Whether NP is also a subset of P, is not known.
 Probably false, but nobody has been able to prove.
NP-complete problems.
 A problem PI1 is NP complete, if every problem in NP can be reduced to PI1
in polynomial time.
 That means if you solved PI1, you solved every problem in NP.
 First problem that was proven to be NP-complete was CNF satisfiability.
Given a logical expression in conjunctive normal form, is there an assignment
for the logical variables for which the expression will evaluate to true.
 Cook (UofToronto) proved that CNF-satisfiability is NP-complete
 Since then 1000’s of problems have been shown to be NP-complete.
 The task of proving that a problem PI2 is NP-complete is much simpler than
faced by Cook.
 You can pick another problem PI1 that is known to be NP-complete and show
that PI1 can be reduced to PI2, then PI2 is NP-complete.
 If you can show that one NP-complete problem PI can be solved in
polynomial time, you have proven that P=NP. Because all the other problems
can be reduced (using a polynomial reduction) to PI and solved in polynomial
time.
 If you prove that one problem in NP has a lower bound which is exponential
(non-polynomial) then you have proved that P != NP.
 Guaranteed question.
NP hard problems
 These are problems whose solution cannot be checked in polynomial time.
 Typically, these are optimization problems
 Can a given graph be colored with k-colors? (NP complete)
 What are the minimum number of colors required to color a graph? (NP hard)
 If we can solve an NP hard problem in polynomial time, we can solve all the NPcomplete problems in polynomial time (P=NP). Note that just because you solved
(in your dreams) an NP hard problem in polynomial time doesn’t mean that you
can solve every other problem in polynomial time.
 Example:
 If you can find the minimum number of colors required to color a graph (NPhard) in polynomial time,
 you can definitely tell if the graph can be colored with k-colors (NP-complete)
in polynomial times.
 Since you solved one NP-complete problem in polynomial time, you can solve
all NP-complete problems in polynomial time.



NP-complete and NP-Hard problems are just the tip of the iceberg. There are many
well defined problems for which we cannot even form an algorithm to solve.
Decidable problems are those for which you can write an algorithm
These problems are called undecidable (Turing)
 Halting problem
 Blank tape problem
Download