etc 2 P={problems that can be solved by deterministic algorithms in polynomial time} CSC310 NP-complete . N 5.NP-Complete Problems (Chapter 45) • A category of problems thought to be very hard to solve 2 best-known algorithms are exponential time ◦ T (N ) = Θ(αN ) for constant α > 1 ◦ impractical for non-trivial problems — “intractable” • Deterministic algorithms 2 only one step at a time 2 no “lucky guesses” 2 “ordinary” (serial) algorithms • Deterministic polynomial-time algorithms 2 deterministic algorithms that run in polynomial time 2 log(N ). N . N log(N ).1 . N 2.

choose correct solution non-deterministically 2 very powerful.2 ..e. but not real ◦ an analysis tool 2 run time is time required to check one possible solution • Example: Traveling Salesman Problem 2 find the shortest circuit in a weighted graph (circuit = cycle that visits every node once) 2 best known algorithm: try every possible ordering of nodes ◦ exponential time 2 non-deterministic algorithm: “guess” the best solution (and check it) ◦ polynomial time • NP={problems that can be solved by non-deterministic algorithms in polynomial time} CSC310 NP-complete .Non-Deterministic Algorithms • A non-deterministic algorithm can simultaneously check all possible solutions 2 i.

P = NP ? • P ⊆ NP • Many problems are known to be in P • Many problems known to be in NP are thought not to be in P • No problem in NP is known not to be in P • Most important open question in theoretical computer science: P = NP ? 2 most think the answer is “no” 2 verification requires finding a single problem in NP that can be proven unsolvable by a deterministic algorithm in polynomial time 2 answer this question and become rich and famous CSC310 NP-complete .3 .

4 .NP-Complete Problems • Problems in NP thought to be hard 2 “hard” means ∈ P • A problem Π in NP is said to be NP-complete if the discovery of a p-time (deterministic polynomial time) algorithm to solve Π would result in p-time solutions for every problem in NP NP-complete = {Π ∈ NP | (Π ∈ P) ⇒ (P = NP)} • If P = NP P NP NP−complete CSC310 NP-complete .

is NP-complete: 1.Identification of NP-Complete Problems • Steps to show that a problem.5 . as follows: 1. of Π can now be solved in p-time. π . thus: Π ∈ P ⇒ Π ∈ P ⇒ P = NP CSC310 NP-complete . describe a deterministic algorithm that can transform an arbitrary instance of Π into an instance of Π 4. select a problem Π known to be NP-complete 3. transform π into an instance. show that the above transformation algorithm is p-time • Suppose we find a p-time deterministic algorithm to solve Π 2 every instance. show that Π ∈ NP 2 find a non-deterministic polynomial time algorithm to solve Π 2 usually easy. Π. solve π (p-time) 2 p-time + p-time = p-time. since non-deterministic algorithms are very powerful 2 only “bizarre” problems are ∈ NP 2. of Π using the above transformation (p-time) 2. π.

The “First” NP-Complete Problem • Above proof technique requires at least one problem that is known to be NP-complete! • Satisfiability Problem (SAT): given a boolean expression. this algorithm can be used to solve any problem in NP 2 SAT is NP-complete 2 all other proofs of NP-completeness are based. on Cook’s result CSC310 NP-complete . directly or indirectly.6 . is there an assignment of truth values to the variables that renders the expression true? e = (x1 ∨ x3 ∨ x5) ∧ (x1 ∨ x2 ∨ x4) ∧ (x3 ∨ x6 ∨ x1) ¯ ¯ ¯ 2 are there values of x1 · · · x6 that result in e true? • SAT ∈ NP 2 try all combinations of truth values simultaneously • Cook (1971) proved: if a p-time algorithm to SAT is found.

Sign up to vote on this title
UsefulNot useful