Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems.

Similar presentations


Presentation on theme: "Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems."— Presentation transcript:

1 Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems

2 Homework Realprime proof? Other problems?

3 Reprise on P, verifiers & NP P is the set of problems that can be decided in polynomial time. NP defined in two ways: –Problems defined by a procedure, possibly non-deterministic (think of guessing among a finite set of choices) in which the guesses that work only take up polynomial time. –Problem in which there is a way to verify the answer, given some extra information, with the verification taking only polynomial time.

4 Recall: COMPOSITES COMPOSITES= {x|x = p*q, where p,q>1} Problem is factoring. Does x have a non- trivial factorization? Is x prime? Problem is HARD, meaning no polynomial time algorithm has been found BUT Verifying is easy! If we are given the factoring, we can check it.

5 Clique Graph problem: Consider graphs (vertices, simple edges) A k-clique is a subgraph with k vertices, in which each vertex is connected to every other vertex in the subgraph. Problem is: Does graph G contain a k- clique? CLIQUE is in NP –Using nondeterminism, keep guessing subgraphs and check each one. –If you have a candidate, check it out. The candidate serves as the information for the verifier.

6 Satisfiability SAT Consider Boolean formulas: variables and & and | and NOT operators, along with parentheses. A Boolean formula is satisfiable if some assignments of TRUE (1) and FALSE (0) makes the formula evaluate to TRUE.

7 Examples Find assignment of x, y and z for which the formula is true –(NOTx & y) | (x | NOTz) –(x|y) & (x|NOTy) & (NOTx|y) & (NOTx|NOTy)

8 SAT SAT = {formula f | f is satisfiable} SAT is NP –Can be verified using the information of the assignment of variables

9 Cook-Levin theorem SAT is in P if and only if P = NP Informally, if there is a polynomial algorithm for determining if any particular formula has an assignment that is TRUE, then there is a polynomial algorithm for ALL the problems that are NP. The other direction is automatic: if NP = P, then there is a polynomial algorithm for SAT.

10 Reducibility Consider two problems, A and B. A is reducible to B if there exist a polynomial-time function that translates a problem in A to one in B. If A can be reduced to B and B can be solved in polynomial time, then so can A.

11 Aside The general principle of reducibility –turning one problem into another problem Is a good technique. –NOT always the most efficient. You may be turning a simpler problem into a more complex problem. –Be aware of adage: if the only tool you have is a hammer, everything looks like a nail.

12 NP-Complete A problem (language) B is NP-complete if – B is in NP and –every problem A in NP is polynomial reducible to B.

13 SAT is NP complete This is equivalent to proving Cook-Levin. Go back to Turing Machines Consider a language A for which there is a non-deterministic TM that decides if a string w is in A. The reduction of A to SAT is to show a method that takes each w and constructs a Boolean formula f that simulates TM acting on w. Show method is polynomial. w is in A if and only if f is satisfiable.

14 How to prove anything NP- complete???? Accept that SAT is NP-complete For any problem B, show SAT is reducible to B.

15 NP complete problems Known set –Added to all the time. If there is a polynomial solution to any of them, there is a polynomial solution to all of them.

16 NP complete problems CLIQUE HAMPATH 3SAT –Formulas restricted to special format literals (single variables or negated single variable) Conjunctive normal form: clauses connected by ANDs 3cnf formula is one in CNF in which each clause has exactly 3 literals.

17 Homework Find other NP-complete problems!!! –Do it. –Come prepared to explain problem to class.


Download ppt "Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems."

Similar presentations


Ads by Google