Problem Reduction
Problem Reduction
- A transformation and conquer technique (chapter 6)
- An important part of P and NP analysis (chapter 11)
Problem Reduction: Definition
- To solve an instance of problem A:
- Transform the instance of problem A into an instance of
problem B
- Solve the instance of problem B
- Transform the solution to problem B into a solution of
problem A
- We say that problem A reduces to problem B
Example 1
- Finding the Least Common Multiple (LCM) of 2 integers
- Example: LCM(24, 36) = 72
- Solution technique: reduce LCM to Greatest Common Divisor (GCD):
- Instance of Problem A: LCM(24, 36)
- Instance of Problem B: GCD(24, 36)
- Solution of B: GCD(24, 36) = 12 (by Euclid's algorithm)
- Transform solution of B into solution of A:
- LCM(24, 36) = 24*36 / GCD(24, 36) = 24*36 / 12 = 72
Example 2
- Solve Element Uniqueness problem: given a set of two dimensional
points, are all elements unique?
- Solution technique:
- Reduce Element Uniqueness to Closest Pair
- Solve Closest Pair
- Transform solution of Closest Pair to solution of
Uniqueness:
- Answer to Element Uniqueness is yes if Closest Pair distance > 0
Problem Reduction and Performance
- If A reduces to B then
- If A = Ω(f(n)) then B = Ω(f(n))
- In other words, B can have a higher lower bound than A, but
not a lower one
- For example:
- Element Uniqueness is known to be Ω(n lg n).
- Therefore, Closest Pair is also Ω(n lg n)
- More detail on Closest Pair:
- Closest Pair = Ω(n lg n) is still true
if Closest Pair's lowest bound is actually
higher (eg Ω(n^2))
- But the lower bound for Closest Pair can not be lower
(eg it can't be Ω(n))
- Actually, the lower bound for Closest Pair
can be proved using decision trees, to be Ω(n lg n),
which is also the upper and tight bound.
- Truth in advertising: Some fine points about the performance of
the reduction should be considered
Careful!
- This is NOT CORRECT:
- If A reduces to B and B=Ω(f(n)), then A=Ω(f(n))
Remember
- Remember this: If A reduces to B, then the lower bound for B
can't be less than the lower bound for A
- B's lower bound can be higher, but not lower.