introduction to np completeness l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Introduction to NP-Completeness PowerPoint Presentation
Download Presentation
Introduction to NP-Completeness

Loading in 2 Seconds...

play fullscreen
1 / 12

Introduction to NP-Completeness - PowerPoint PPT Presentation


  • 194 Views
  • Uploaded on

Introduction to NP-Completeness. Tahir Azim. The Downside of Computers. Many problems can be solved in linear time or polynomial time But there are also problems that can’t be solved so easily… Moral: know thy problem!. P vs NP. P = Problems that can be solved in polynomial time

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Introduction to NP-Completeness' - oshin


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
the downside of computers
The Downside of Computers
  • Many problems can be solved in linear time or polynomial time
  • But there are also problems that can’t be solved so easily…
  • Moral: know thy problem!
p vs np
P vs NP
  • P = Problems that can be solved in polynomial time
  • NP = Problems for which you can test the correctness of a solution in polynomial time
    • Example?
  • Solutions in P are also in NP
    • But not necessarily vice versa
  • Undecidable Problems: Cannot be solved by a computer.

Picture Courtesy: Wikipedia

examples of hard problems
Examples of hard problems
  • Long simple paths: Given a graph G, vertices s and t, and a number k, does there exist a path from s to t with at least k edges and no cycles?
    • In NP. Why?
    • In P? No!
  • RSA: In NP, but not in P!
  • Chess-Playing: In NP, but not in P!
  • Halting Problem
unsolvability of the halting problem

yes if Q(Q) halts

no otherwise

run forever if Q(Q) halts

halt if Q(Q) runs forever

Unsolvability of the halting problem
  • Suppose P solves variant of halting problem
    • On input Q, assume

P(Q) =

  • Build program D
    • D(Q) =
  • Does this make sense? What can D(D) do?
    • If D(D) halts, then D(D) runs forever.
    • If D(D) runs forever, then D(D) halts.
    • CONTRADICTION: program P must not exist.
how to solve such problems
How to solve such problems?
  • Heuristics
  • Approximation
  • Use the exponential time solution anyway
  • Add more assumptions to simplify it
is p np
Is P=NP?
  • If it's always easy to check a solution, should it also be easy to find the solution?
  • Most famous open problem in theoretical CS
  • Most expect it to be false, but there is no proof
np complete problems npc
NP-Complete Problems (NPC)
  • The hardest of all problems in NP
  • NP-hard: A problem that is at least as hard as any problem in NP
    • Does not necessarily have to be in NP, e.g. the Halting Problem
  • A problem is said to be NP-complete if it is
    • (i) in NP
    • and (ii), it is NP-hard
how to prove if a problem y is np hard
How to prove if a problem Y is NP-hard
  • By showing that an instance X of an NP-hard problem can be reduced to Y in polynomial time
  • Informally, a problem A is reducible to B if A can be solved by using B as a sub-routine
    • i.e. if B returns “yes”, then A also returns yes.
  • The idea is the following:
    • If Y was not NP-hard, then X could be solved “easily” by using Y
    • Therefore, X would no longer be a hard problem
    • X is NP-hard
    • Therefore, Y is NP-hard.
more common method slightly different
More common method (slightly different)
  • Generally, a slightly different approach is used
  • A problem Y is said to be NP-complete if it is
    • (i) in NP
    • and, (ii) an instance of an NP-complete problem can be reduced to Y in polynomial time
      • Notation: X <p Y, Ǝ X Ɛ NPC
  • Where did the first NP-complete problem come from?
    • Stephen Cook (1971) showed that SAT is an NP-complete problem from first principles
examples of various np complete problems and their reductions
Examples of various NP-complete problems and their reductions
  • Additional Problems:
    • Graph Coloring
  • Karp's 21 NP-complete problems (1972)

Picture Courtesy: Wikipedia

more of the good stuff
More of the good stuff…
  • If you can prove one NP-complete problem to be solvable in polynomial time, you can prove that all others are also solvable in polynomial time
  • One way to prove P=NP!
  • Follow up:
    • Wikipedia, of course  But check your sources! Don’t trust Wikipedia!