karp reductions – definition

17
1 Karp reductions – Definition IP 250, AB 42 A is polynomial-time reducible to B (denote A p B) If there exists a poly-time- computable function f:** s.t. for every w wA f(w)B

Upload: jodie

Post on 22-Feb-2016

111 views

Category:

Documents


0 download

DESCRIPTION

SIP 250, AB 42. Karp reductions – Definition. f. Karp Reductions – Ilustrated. B. F(A). A. F( *-A ). * - A. * - B. *. *. Reducing. Reductions and Efficiency. HAMPATH  p HAMCYCLE. u. Check list. Closeness Under Reductions: Definition. Observation. SIP 250, AB 88. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: 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

Page 2: Karp reductions – Definition

2

Karp Reductions –Ilustrated

*

A

* - A

f

* - B

B

*

F(A)

F(*-A)

Page 3: Karp reductions – Definition

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: !

Reducing

Page 4: Karp reductions – Definition

4

Reductions and Efficiency

Polynomial-time algorithm for A

f Polynomial-time algorithm for BW f(W

)

f(w)B

wA

f(w)B

wA

Page 5: Karp reductions – Definition

• 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

Page 6: Karp reductions – Definition

• 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

Page 7: Karp reductions – Definition

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

Page 8: Karp reductions – Definition

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:

?

Page 9: Karp reductions – Definition

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

Page 10: Karp reductions – Definition

10

Observation

• P, PSPACE and EXPTIME are closed under polynomial-time Karp reductions

Theorem:

• Do it yourself !!Proof:

Page 11: Karp reductions – Definition

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:f is a log-space reduction of A to B

Page 12: Karp reductions – Definition

12

Oracle machines

Page 13: Karp reductions – Definition

• Assuming an efficient procedure that decides B, construct one for A.

Cook Reduction:

13

Cook reduction

Page 14: Karp reductions – Definition

14

Cook reduction: an example

Claim: L* PL

Let L be a languageL* = { x | x=x1..xk , xi L }

Page 15: Karp reductions – Definition

•Let E’=E1

•If E’= reject2

• choose (any) <u, v> in E’3

•If HAMPATH ( <V+{w, z}, E’+{<w,u>, <v,z>}> ) accept4

•E’ = E’ – {<u, v>}5

•Go to step 2615

Cook red. : HAMCYCLEHAMPATH.

Page 16: Karp reductions – Definition

• For a class C of decision problems and a language LC, L is C-complete if: L’C L’ is reducible to L.

Definition: C-complete

• L is complete for classes C, C’ C=C’Theorem:

• All languages in C and in C’ are reducible to L, which is in both. Since both are closed under reductions, they’re the same

Proof:

• Any LNPC, LP P=NPTheorem:

Completeness

Page 17: Karp reductions – Definition

Discussed types of reductions:• Cook vs. Karp reductions• Poly-time vs. log-space

Defined:• “completeness”

17

Summary