1 / 14

CSE 421 Algorithms

CSE 421 Algorithms. Richard Anderson Lecture 30 NP-Completeness. NP-Completeness. A problem X is NP-complete if X is in NP For every Y in NP, Y < P X X is a “hardest” problem in NP To show X is NP complete, we must show how to reduce every problem in NP to X. Cook’s Theorem.

george
Download Presentation

CSE 421 Algorithms

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. CSE 421Algorithms Richard Anderson Lecture 30 NP-Completeness

  2. NP-Completeness • A problem X is NP-complete if • X is in NP • For every Y in NP, Y <P X • X is a “hardest” problem in NP • To show X is NP complete, we must show how to reduce every problem in NP to X

  3. Cook’s Theorem • The Circuit Satisfiability Problem is NP-Complete • Circuit Satisfiability • Given a boolean circuit, determine if there is an assignment of boolean values to the input to make the output true

  4. Circuit SAT Satisfying assignment x1 = T, x2 = F, x3 = F x4 = T, x5 = T AND OR OR AND AND AND AND NOT OR NOT OR AND OR AND NOT AND NOT OR NOT AND x3 x4 x5 x1 x2

  5. Proof of Cook’s Theorem • Reduce an arbitrary problem Y in NP to X • Let A be a non-deterministic polynomial time algorithm for Y • Convert A to a circuit, so that Y is a Yes instance iff and only if the circuit is satisfiable

  6. Garey and Johnson

  7. History • Jack Edmonds • Identified NP • Steve Cook • Cook’s Theorem – NP-Completeness • Dick Karp • Identified “standard” collection of NP-Complete Problems • Leonid Levin • Independent discovery of NP-Completeness in USSR

  8. Populating the NP-Completeness Universe • Circuit Sat <P 3-SAT • 3-SAT <P Independent Set • Independent Set <P Vertex Cover • 3-SAT <P Hamiltonian Circuit • Hamiltonian Circuit <P Traveling Salesman • 3-SAT <P Integer Linear Programming • 3-SAT <P Graph Coloring • 3-SAT <P Subset Sum • Subset Sum <P Scheduling with Release times and deadlines

  9. Hamiltonian Circuit Problem • Hamiltonian Circuit – a simple cycle including all the vertices of the graph

  10. Minimum cost tour highlighted Traveling Salesman Problem • Given a complete graph with edge weights, determine the shortest tour that includes all of the vertices (visit each vertex exactly once, and get back to the starting point) 3 7 7 2 2 5 4 1 1 4

  11. Thm: HC <P TSP

  12. Number Problems • Subset sum problem • Given natural numbers w1,. . ., wn and a target number W, is their a subset that adds up to exactly W • Subset sum problem is NP-Complete • Subset Sum problem can be solved in O(nW) time

  13. Subset sum problem • The reduction to show Subset Sum is NP-complete involves numbers with n digits • In that case, the O(nW) algorithm is an exponential time and space algorithm

  14. Stable Matching Models of computation and efficiency Basic graph algorithms BFS, Bipartiteness, SCC, Cycles, Topological Sort Greedy Algorithms Interval Scheduling, HW Scheduling Correctness proofs Dijkstra’s Algorithm Minimum Spanning Trees Recurrences Divide and Conquer Algorithms Closest Pair, FFT Dynamic Programming Weighted interval scheduling, subset sum, knapsack, longest common subsequence, shortest paths Network Flow Ford Fulkerson, Maxflow/mincut, Applications NP-Completeness Course summaryWhat did we cover in the last 30 lectures?

More Related