









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










11/21/
A. Smith; based on slides by S. Raskhodnikova and K. Wayne
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
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
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
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
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.
each corresponds to a different variable
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
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