Karp reductions – Definition
description
Transcript of Karp reductions – Definition
1
Karp reductions –DefinitionSIP 250, AB 42
A is polynomial-time reducible to B(denote ApB)
If there exists
a
poly-time-computable
function f:**
s.t. for every
wwA f(w)B
2
Karp Reductions –Ilustrated
*
A
* - A
f
* - B
B
*
F(A)
F(*-A)
3
Don’t Panic
Come up with a reduction-function f
Show f is polynomial time computable
• wA f(w)B• wA f(w)B
Prove f is a reduction, i.e., show:
• We’ll use reductions that, by default, would
be of this type, which is called:
• Polynomial-time mapping reduction
• Polynomial-time many-one reduction
• Polynomial-time Karp reduction
!
Reducing
4
Reductions and Efficiency
Polynomial-time algorithm for A
fPolynomial-time algorithm for BW f(W)
f(w)B wA
f(w)B wA
• A directed graph G=(V,E)
Hamiltonian Path Instance:
• Is there a path in G, which goes through every vertex exactly once?
Decision Problem:
5
• a directed graph G=(V,E).
Hamiltonian Cycle Instance:
• Is there a simple cycle in G that paths through each vertex exactly once?
Decision Problem:
6
G p G
uVEuVEVf ,,
HAMPATH p HAMCYCLE
• Given a Hamiltonian path (v0,…,vn) in G, (v0,…,vn,u) is a Hamiltonian cycle in G’
Completeness:
• Given a Hamiltonian cycle (v0,…,vn,u) in G’, removing u yields a Hamiltonian path.
Soundness:
7
u
8
Check list
Come up with a reduction-function f
Show f is polynomial time computable
• wHAMPATH f(w)HAMCYCLE • wHAMPATH f(w)HAMCYCLE
Prove f is a reduction, i.e., show:
?
A complexity class C is closed under poly-time reductions if:
• L is reducible to L’ and L’C L is also in C.
9
Closeness Under Reductions: Definition
L ≤p L’
C
C
10
Observation
• P, PSPACE and EXPTIME are closed under polynomial-time Karp reductions
Theorem:
• Do it yourself !!
Proof:
11
Log-space ReductionsSIP 250, AB 88
A is log-space reducible to B(denote ALB)
If there exists
a
log-space-computable
function f:**
s.t. for every
wwA f(w)B
• L, P, PSPACE and EXPTIME are closed under log-space reductions.
Theorem:
i.e., log-space
TM that outputs
f(w) on input w
f is a log-space reduction of A to B
• For a class C of decision problems and a language L, L is C-complete if LC and L’C L’ is reducible to L.
Definition: C-complete
• If C,C’ are closed under reductions and L is complete for classes C, C’ C=C’
Theorem:
Completeness
• Assuming an efficient procedure that decides B, construct one for A.
Cook Reduction:
13
Cook reduction
Karp is a special case of Cook
reduction:
It allows only 1 call to B,
whose outcome must be
outputted as is.
14
Oracle machines
An oracle Turing machine M has one extra “query tape” and three special states qquery,qyes,qno.
To execute M we specify a language O {0,1}*, that is used as the “oracle”.
When MO enters qquery, it either moves to qyes or qno according to whether the string on the query tape belongs to O or not.
An oracle call counts as one step.
• L’ is polynomial-time Cook reducible to L, if L’ PL.
Cook Reduction:
15
Cook reduction - II
16
Cook reduction: an example
Claim: L* PL
Proof: On input x {0,1}n, Create a graph G=(V,E) with n vertices and an edge (i,j) E iff xi+1,..,xj L.
Solve the directed stConnectivity for G=(V,E),s=0,t=n.
Let L be a languageL* = { x | x=x1..xk , xi L }
17
Diagonalization yet again
Claim: For every oracle O, PO ≠EXPO.Proof: Same proof. Simulating machine simulates also the oracle calls.
Coroolary: If there exists an oracle O such that AO =BO, then one cannot separate A from B with a diagonalization argument.Prove: PPSPACE =PSPACEPSPACE
Discussed types of reductions:• Cook vs. Karp reductions• Poly-time vs. log-space
Defined:• “completeness”
18
Summary
Fin
d
L and C s.t. L is C-complete