Presentation is loading. Please wait.

Presentation is loading. Please wait.

NP-Completeness Proofs

Similar presentations


Presentation on theme: "NP-Completeness Proofs"— Presentation transcript:

1 NP-Completeness Proofs
Since L’ is NPC, for all L” in NP we have L” <=p L’ L’ <=p L is given, so by transitivity we have L” <=p L Therefore L is NP-hard; moreover if L is NP then by definition L is NPC

2 Formula Satisfiability
An instance of SAT is a boolean formula composed of A particular truth value assignment to variables satisfies the formula if the result is true Our goal is to prove SAT is NP-complete, but first we look at a sample problem

3 An Example of SAT Since there are 2n possible assignments to n boolean variables, we do not suspect a polynomial algorithm will exist to prove satisfiability

4 Reduction to CIRCUIT-SAT - 1
First we claim verification can happen in polynomial time simply by replacing all variable in the formula with the given constant value and find if the final result is 1 We now show any instance of circuit satisfiability can be reduced to formula satisfiability in polynomial time Each wire is labeled with a variable and the operation of each gate is expressed as a formula, such as x1 x2 x3 x4 for The circuit  is the AND of all the individual circuit components

5 Reduction to CIRCUIT-SAT - 2
Here is an example with a complete circuit The AND of the logical operation of all gates gives us the desired formula This formula can be produced in polynomial time

6 3-CNF Satisfiability Definition
a literal is a variable or its negation a formula in conjunctive normal form is expressed as an AND of clauses each of which contains the OR of one or more literals

7 Reduction - Step 1 Construct a binary parse tree for the formula
use associativity to insure only 1 or 2 children introduce variables on the branches and write the formula as we have done before

8 Reduction - Step 2 The rows with 0 result are used to form the DNF
Each clause has at most three terms

9 Reduction - Step 3 The final task is to insure exactly 3 terms per clause All three steps preserve satisfiability The formula is polynomial in length because step 1 introduces at most 1 variable and 1 clause per connective; step 2 introduces at most 23 = 8 clauses step 3 introduces at most 4 clauses per connective


Download ppt "NP-Completeness Proofs"

Similar presentations


Ads by Google