1 / 14

NP-Complete Problems

NP-Complete Problems. What are they?. Book is a little hard to read here “Non-deterministic, Polynomial time Complete” Start with some interesting examples…. N-Queens Problem. Where She Can Attack. Why this is hard. Problem: Place 8 queens such that no queen can attack another

Télécharger la présentation

NP-Complete Problems

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. NP-Complete Problems Jeff Chastine

  2. What are they? • Book is a little hard to read here • “Non-deterministic, Polynomial time Complete” • Start with some interesting examples… Jeff Chastine

  3. N-Queens Problem Jeff Chastine

  4. Where She Can Attack Jeff Chastine

  5. Why this is hard • Problem: Place 8 queens such thatno queen can attack another • On a standard 8x8 chessboard • The first queen has 64 spots to choose from • The second queen has 63 spots to choose from • And so on… Yes, 178 trillion Jeff Chastine

  6. Why this is so easy! • How long to verify a correct board? Jeff Chastine

  7. Why this is so easy! • How long to verify a correct board? Polynomial time One word down, a few to go… Jeff Chastine

  8. Packing Boxes • What’s the most efficient way to pack a UPS truck with varying-sized boxes? • Why this is hard • Different order of boxes • Different positions • Different orientations • How many different ways are there? Jeff Chastine

  9. The BIG QUESTION • Someone shows you “a solution” • Shows you the truck • Shows you all the boxes in the truck • Is it correct? How do you know? • How long to verify? Jeff Chastine

  10. Difference • The n-Queens problem is “NP-Soft” • Exponential time to generate solution • Polynomial time to verify • The truck packing is “NP-Hard” • Exponential time to generate solution • Exponential time to verify Jeff Chastine

  11. Difference • The n-Queens problem is “NP-Soft” • Exponential time to generate solution • Polynomial time to verify • The truck packing is “NP-Hard” • Exponential time to generate solution • Exponential time to verify Fascinating to mathematicians Jeff Chastine

  12. Non-determinism • Idea from “Theory of Computing” • Automaton replicates itself for each decision • Each replica follows unique path • All machines halt when a solution is found • Questions: • How many machines for n-Queens • What is most time a machine would take? Note: Is this futuristic? Nope. It’s called Quantum Computing! Jeff Chastine

  13. What about “Complete” • Here’s the amazing thing: If you solve one of these problemsyou solve them all! Jeff Chastine

  14. So… • Non-deterministic, Polynomial time • We have a machine that replicates itself at decision points • The computing time for each machine is polynomial • Complete • This class of problems is all the same • If you solve one, you solve all NP-Complete problems Jeff Chastine

More Related