Docsity

Computational Intractability: Polynomial Time Reductions and Complexity Classes, Study notes of Computer Science

Partial preview of the text

Download Computational Intractability: Polynomial Time Reductions and Complexity Classes and more Study notes Computer Science in PDF only on Docsity!

11/21/

A. Smith; based on slides by S. Raskhodnikova and K. Wayne

Adam Smith

Algorithm Design and Analysis

L

ECTURE

Computational

Intractability

ReductionsPolynomial Time

Polynomial-Time Reduction

Design algorithms. If XPurpose. Classify problems according to relative difficulty.

P^ Y and Y can be solved in polynomial-time,

Establish intractability. If Xthen X can also be solved in polynomial time.

P Y and X cannot be solved in

Establish equivalence. If Xpolynomial-time, then Y cannot be solved in polynomial time.

P Y and Y

P X, we use notation X

P Y.

up to cost of reduction

Polynomial Transformation

instances of problem X can be solved using:Def. Problem X polynomial reduces (Cook) to problem Y if arbitrary  

Polynomial number of standard computational steps, plus

 

Polynomial number of calls to oracle that solves problem Y.

input x to X, we can construct an input y such that x is aDef. Problem X polynomial transforms (Karp) to problem Y if given any

yes

instance

of X iff y is a

yes

instance of Y.

Open question. Are these two concepts the same?call to oracle for Y, exactly at the end of the algorithm for X.Note. Polynomial transformation is polynomial reduction with just one

we require |y| to be of size polynomial in |x|

Caution: KT abuses notation



p^

and blurs distinction

Reduction By Simple Equivalence

Basic reduction strategies.

Reduction by simple equivalence.

Reduction from special case to general case.

Reduction by encoding with gadgets.

Vertex Cover

VERTEX COVER

: Given a graph G = (V, E) and an integer k, is there a

subset of vertices S

V such that |S|

k, and for each edge, at least

Ex. Is there a vertex cover of sizeone of its endpoints is in S?

4? Yes.

Ex. Is there a vertex cover of size

3? No.

vertex cover

Vertex Cover and Independent Set

Claim.

VERTEX-COVER

P INDEPENDENT-SET

Pf. We show S is an independent set iff V - S is a vertex cover.

vertex coverindependent set

Reduction from Special Case to General Case

Basic reduction strategies.

Reduction by simple equivalence.

Reduction from special case to general case.

Reduction by encoding with gadgets.

Set Cover

SET COVER

: Given a set U of n elements, a collection S

1 , S

2 ,... , S

m

of

subsets of U, and an integer k, does there exist a collection of

k of

Sample application.these sets whose union is equal to U?  

m available pieces of software.

 

Set U of n capabilities that we would like our system to have.

 

The ith piece of software provides the set S

i 

U of capabilities.

 

Goal: achieve all n capabilities using fewest pieces of software.

Ex:

S k = 2U = { 1, 2, 3, 4, 5, 6, 7 } 1 = {3, 7}

S 4 = {2, 4}

S 2 = {3, 4, 5, 6}

S 5 = {5}

S

3

= {1}

S

6

= {1, 2, 6, 7}

Reductions by Encoding with Gadgets

Basic reduction strategies.  

Reduction by simple equivalence.

Reduction from special case to general case.

Reduction by encoding with gadgets.

Yes: xEx:

1

= true, x

2

= true x

3

= false.

Clause:Literal: A Boolean variable or its negation.

A disjunction (OR) of literals.

formulaConjunctive normal form: A propositional

that is the conjunction (AND) of clauses.

SAT

: Given CNF formula

, does it have a satisfying truth assignment?

3-SAT

: SAT where each clause contains exactly 3 literals.

Satisfiability

each corresponds to a different variable

3 Satisfiability Reduces to Independent Set

Claim. G contains independent set of size k = |

| iff

is satisfiable.

Pf.

Let S be independent set of size k.

 

S must contain exactly one vertex in each triangle.

 

Set these literals to true.

 

Truth assignment is consistent and all clauses are satisfied.

Pf

Given satisfying assignment, select one true literal from each

triangle. This is an independent set of size k.

k = 3 G

and any other variables in a consistent way

Review

Basic reduction strategies.  

Simple equivalence:

INDEPENDENT-SET

P VERTEX-COVER.

 

Special case to general case:

VERTEX-COVER

P SET-COVER.

 

Encoding with gadgets:

3-SAT

P INDEPENDENT-SET.

Transitivity. If X

P^ Y and Y

P Z, then X

P^ Z.

Ex: Pf idea. Compose the two algorithms.

3-SAT

P

INDEPENDENT-SET

P

VERTEX-COVER

P

SET-COVER