Docsity

Polynomial-Time Reduction: Problem X to Problem Y, Lecture notes of Algorithms and Programming

Partial preview of the text

Download Polynomial-Time Reduction: Problem X to Problem Y and more Lecture notes Algorithms and Programming in PDF only on Docsity!

NP and Computational

Intractability

Functions

Constant^ Logarithmic^ Poly Logarithmic^ Polynomial^ Exponential

5 5 log n (log n)^5 n^5 2 5n

Factorial

n!

Recap: Asymptotic Growth

Outline of today’s lecture

• Reduction: polynomial time

• Reduction by simple equivalence.

• Reduction from special case to general

case.

• Reduction by encoding with gadgets.

• Definition of P and NP

• NP-completeness

• Coping with hardness

Classify Problems According to Computational

Requirements

Question: Which problems will we be able to solve in practice?

A working definition. [Cobham 1964, Edmonds 1965, Rabin 1966]. Those with polynomial-time algorithms.

Yes Probably no Shortest path Longest path

Min cut Max cut 2-SAT 3-SAT

Matching 3D-matching

Planar 4-color Planar 3-color Bipartite vertex cover Vertex cover

8.1 Polynomial-Time Reductions

Polynomial-Time Reduction

Suppose we could solve problem Y in polynomial-time. What else could we solve in polynomial time?

Reduction. Problem X polynomial reduces to problem Y, denoted X ≤ (^) P Y, if arbitrary instances of problem X can be solved using:

  • Polynomial number of standard computational steps, plus
  • Polynomial number of calls to an oracle that solves problem Y.

Polynomial-Time Reduction

Suppose we could solve problem Y in polynomial-time. What else could we solve in polynomial time?

Reduction. Problem X polynomial reduces to problem Y, denoted X ≤ (^) P Y, if arbitrary instances of problem X can be solved using:

  • Polynomial number of standard computational steps, plus
  • Polynomial number of calls to an oracle that solves problem Y.

Input to TC

G=(V,E)

Polynomial-Time Reduction

Suppose we could solve problem Y in polynomial-time. What else could we solve in polynomial time?

Reduction. Problem X polynomial reduces to problem Y, denoted X ≤ (^) P Y, if arbitrary instances of problem X can be solved using:

  • Polynomial number of standard computational steps, plus
  • Polynomial number of calls to an oracle that solves problem Y.

Transforms instance for X to instance(s) for Y

Input to TC

G=(V,E)

The University of Sydney Page 13

Polynomial-Time Reduction

Suppose we could solve problem Y in polynomial-time. What else could we solve in polynomial time?

Reduction. Problem X polynomial reduces to problem Y, denoted X ≤ (^) P Y, if arbitrary instances of problem X can be solved using:

  • Polynomial number of standard computational steps, plus
  • Polynomial number of calls to an oracle that solves problem Y.

Transforms instance for X to instance(s) for Y

Solves Y Solves Y

Solves Y

Input to TC

f 1 (X)

f 2 (X)

fn (X)

Solution to Y on input fi (X).

G=(V,E)

f (^) i (X)=(G,vi ) vertices reachable from v (^) i in G.

The University of Sydney Page 14

Polynomial-Time Reduction

Suppose we could solve problem Y in polynomial-time. What else could we solve in polynomial time?

Reduction. Problem X polynomial reduces to problem Y, denoted X ≤ (^) P Y, if arbitrary instances of problem X can be solved using:

  • Polynomial number of standard computational steps, plus
  • Polynomial number of calls to an oracle that solves problem Y.

Transforms instance for X to instance(s) for Y

Transform solutions for Y to a solution for X

Solves Y Solves Y

Solves Y

Input to TC

f 1 (X)

f 2 (X)

fn (X)

Solution to Y on input fi (X).

G=(V,E)

f (^) i (X)=(G,vi ) vertices reachable from v (^) i

Merge info into G’ = TC(G)

The University of Sydney Page 16

Polynomial-Time Reduction

Suppose we could solve problem Y in polynomial-time. What else could we solve in polynomial time?

Reduction. Problem X polynomial reduces to problem Y, denoted X ≤ (^) P Y, if arbitrary instances of problem X can be solved using:

  • Polynomial number of standard computational steps, plus
  • Polynomial number of calls to an oracle that solves problem Y.

Transforms instance for X to instance(s) for Y

Transform solutions for Y to a solution for X

Solves Y Solves Y

Solves Y

Input to TC

f 1 (X)

f 2 (X)

fk (X)

n·Time(Y)

Solution to Y on input fi (X).

Output for TC

Reduction time?

O(n)

O(n^2 )

TC ≤ (^) P BFS

The University of Sydney Page 17

Polynomial-Time Reduction

Suppose we could solve problem Y in polynomial-time. What else could we solve in polynomial time?

Reduction. Problem X polynomial reduces to problem Y, denoted X ≤ (^) P Y, if arbitrary instances of problem X can be solved using:

  • Polynomial number of standard computational steps, plus
  • Polynomial number of calls to an oracle that solves problem Y.

Transforms instance for X to instance(s) for Y

Transform solutions for Y to a solution for X

Solves Y Solves Y

Solves Y

Input to TC

f 1 (X)

f 2 (X)

fk (X)

k=O(nc)

Solution to Y on input fi (X).

Output for TC

Polynomial-Time Reduction

Purpose. Classify problems according to relative difficulty.

  1. Design algorithms. If X ≤ (^) P Y and Y can be solved in polynomial-time, then X can also be solved in polynomial time.
  2. Establish intractability. If X ≤ (^) P Y and X cannot be solved in polynomial-time, then Y cannot be solved in polynomial time.

Establish equivalence: If X ≤ (^) P Y and Y ≤ (^) P X, then X ≡ (^) P Y.

Reductions we have already seen

  • Transitive closure reduces to breadth-first search
  • Bipartite matching reduces to max flow
  • Max flow reduces to min cut
  • Circulation reduces to max flow
  • Circulation with lower bounds reduces to circulation
  • … Sorting reduces to convex hull (not discussed)