Docsity

Efficiently Solvable Problems in CS: Independent Set, Vertex Cover, Set Cover, SAT, 3-SAT , Study notes of Algorithms and Programming

Partial preview of the text

Download Efficiently Solvable Problems in CS: Independent Set, Vertex Cover, Set Cover, SAT, 3-SAT and more Study notes Algorithms and Programming in PDF only on Docsity!

CS 473ug: Algorithms

Chandra Chekuri [email protected] 3228 Siebel Center

University of Illinois, Urbana-Champaign

Fall 2007

Sat and 3-SAT

Part I

Reductions Continued

Sat and 3-SAT

A More General Reduction

Turing Reduction (the one given in the book)

Problem X polynomial time reduces to Y if there is an algorithm A for X that has the following properties: on any given instance IX of X , A uses polynomial in |IX | “steps” a step is either a standard computation step or a sub-routine call to an algorithm that solves Y

Sat and 3-SAT

A More General Reduction

Turing Reduction (the one given in the book)

Problem X polynomial time reduces to Y if there is an algorithm A for X that has the following properties: on any given instance IX of X , A uses polynomial in |IX | “steps” a step is either a standard computation step or a sub-routine call to an algorithm that solves Y Note: In making sub-routine call to algorithm to solve Y , A can only ask questions of size polynomial in |IX |. Why?

Above reduction is called a Turing reduction.

Sat and 3-SAT

Propositional Formulas

Definition Consider a set of boolean variables x 1 , x 2 ,... xn A literal is either a boolean variable xi or its negation ¬xi

Sat and 3-SAT

Propositional Formulas

Definition Consider a set of boolean variables x 1 , x 2 ,... xn A literal is either a boolean variable xi or its negation ¬xi A clause is a disjunction of literals.

Sat and 3-SAT

Propositional Formulas

Definition Consider a set of boolean variables x 1 , x 2 ,... xn A literal is either a boolean variable xi or its negation ¬xi A clause is a disjunction of literals. For example, x 1 ∨ x 2 ∨ ¬x 4 is a clause A formula in conjunctive normal form (CNF) is propositional formula which is a conjuction of clauses

Sat and 3-SAT

Propositional Formulas

Definition Consider a set of boolean variables x 1 , x 2 ,... xn A literal is either a boolean variable xi or its negation ¬xi A clause is a disjunction of literals. For example, x 1 ∨ x 2 ∨ ¬x 4 is a clause A formula in conjunctive normal form (CNF) is propositional formula which is a conjuction of clauses (x 1 ∨ x 2 ∨ ¬x 4 ) ∧ (x 2 ∨ ¬x 3 ) ∧ x 5 is a formula in CNF

Sat and 3-SAT

Propositional Formulas

Definition Consider a set of boolean variables x 1 , x 2 ,... xn A literal is either a boolean variable xi or its negation ¬xi A clause is a disjunction of literals. For example, x 1 ∨ x 2 ∨ ¬x 4 is a clause A formula in conjunctive normal form (CNF) is propositional formula which is a conjuction of clauses (x 1 ∨ x 2 ∨ ¬x 4 ) ∧ (x 2 ∨ ¬x 3 ) ∧ x 5 is a formula in CNF A formula ϕ is in 3CNF if it is a CNF formula such that every clause has exactly 3 literals (x 1 ∨ x 2 ∨ ¬x 4 ) ∧ (x 2 ∨ ¬x 3 ∨ x 1 ) is a 3CNF formula, but (x 1 ∨ x 2 ∨ ¬x 4 ) ∧ (x 2 ∨ ¬x 3 ) ∧ x 5 is not.

Sat and 3-SAT

Satisfiability

SAT

Given a CNF formula ϕ, is there a truth assignment to variables such that ϕ evaluates to true?

Sat and 3-SAT

Satisfiability

SAT

Given a CNF formula ϕ, is there a truth assignment to variables such that ϕ evaluates to true?

Example (x 1 ∨ x 2 ∨ ¬x 4 ) ∧ (x 2 ∨ ¬x 3 ) ∧ x 5 is satisfiable; take x 1 , x 2 ,... x 5 to be all true (x 1 ∨ ¬x 2 ) ∧ (¬x 1 ∨ x 2 ) ∧ (¬x 1 ∨ ¬x 2 ) ∧ (x 1 ∨ x 2 ) is not satisfiable

3-SAT

Given a 3-CNF formula ϕ, is there a satisfying truth assignment for ϕ?

Sat and 3-SAT

3-SAT ≤P Independent Set

Input Given a 3-CNF formula ϕ Goal Construct a graph Gϕ and number k such that Gϕ has an independent set of size k iff ϕ is satisfiable.

Sat and 3-SAT

Interpreting 3-SAT

There are two ways to think about 3-SAT

Sat and 3-SAT

Interpreting 3-SAT

There are two ways to think about 3-SAT Find a way to assign 0/1 (false/true) to the variables such that the formula evaluates to true, that is each clause evaluates to true