Lecture 14 Lower Bounds Decision tree model Linear-time reduction
Lower & Upper Bounds Upper bounds of a problem A: there is an algorithm for the problem that is O(f(n)). Lower bounds of a problem A: ALL algorithms for the problem that are Ω(f(n)). An optimal algorithm for some problem is an algorithm with its upper bound asymptotically equivalent to the lower bound of this problem.
Trivial lower bounds Finding the maximum element of a list of n elements: Ω(n). Multiplying two n × n matrix: Ω(n2).
Roadmap Decision tree model Linear-time reduction
Decision tree model Definition: Decision Tree Model Decision tree model is the model of computation in which an algorithm is considered to be a decision tree, i.e., a sequence of branching operations based on comparisons of some quantities.
Algorithm ⇔ Decision tree Linear Search Depth = worst time complexity A[1] = x? tests 1 A[2] = x? T F 2 A[2] = x? T F n A[n] = x? ...... T F
Algorithm ⇔ Decision tree Binary Search A[n/2] ? x n/2 A[n/4] = x? A[3n/4] = x? < = > n/4 A[n/8] = x? ....... < = > 3n/4 ...... A[7n/8] = x? A[n/n] = x? ...... A[i] = x? A[j] = x? A[n] = x? ... < = > n j i 1
Lower bounds based on Decision Tree Model How many leaves? Lower bound = the smallest depth
Searching problem ⎡log(n+1)⎤ = Θ(logn) Problem: Search Input: A array A[1..n] of n elements, and an element a Output: The index i if A[i]=a, 0 otherwise Any search algorithm a1 a2 a3 an ...... n+1 leaves ⎡log(n+1)⎤ = Θ(logn)
Sorting problem ⎡log(n!)⎤ = Θ(nlogn) Problem: Sorting Input: An array A[1..n] of n elements Output: The sorted array of A[1..n] a1a2...an Any sort algorithm a2a1...an a3a1...an a4a1...an anan-1...a1 anan-1...a2 ...... n! leaves ⎡log(n!)⎤ = Θ(nlogn)
Decision trees Definition: Simple Decision tree model Every decision is based on the comparison of two numbers within constant time Definition: Algebra Decision tree model Every decision is based on some polynomial function: f(x1,x2,...,xn) = 0?
Element uniqueness Theorem Problem: ElementUniqueness Input: A set of n numbers Output: yes, if there does not exist two of them that are equal; no, otherwise Theorem Any algorithm base on algebraic decision tree model to determine element uniqueness requires Ω(nlogn) comparisons in the worst case.
Roadmap Decision tree model Linear-time reduction
Polynomial-time reduction Q is polynomially reduced to Q’ An algorithm for Q An algorithm for problem Q’ yes Input of Q Transform Input of Q’ no Review (P v.s. NP) Polynomial-time Q∝p Q’ : Q’ is harder than Q
Linear-time reductions An algorithm for A Input of A Transform Input of B Linear-time Any algorithm for problem B Output of B Output of A Transform f(n) = Ω(n) A∝nB: A has lower bound Ω(f(n)) implies B has lower bound Ω(f(n))
The convex hull problem Sorting∝nConvexHull
The closest pair problem ElementUniqueness ∝n ClosestPair
The Euclidean minimum spanning tree problem Sorting ∝n EuclideanMinSpan
Conclusion Theorem In algebraic decision tree model for computation, any algorithm that solves sorting problem, or element uniqueness problem, or convex hull problem, or the closest pair problem, or the Euclidean minimum spanning tree problem requires Ω(nlogn) operations in the worst case.