Monday, July 4, 2011

Introduction to Algorithms by Thomas H. Cormen, Charles E. Leiserson and Ronald L. Rivest and Clifford Stein : Chapter 33

The authors define line segment, vector, directed segment and endpoints. The authors also define cross-product of two vector. The authors describe a method to determine whether consecutive segments turn left or right and whether two line segments intersect.

The authors then provide pseudocode implementation of algorithm to determine whether two segments interact and prove its correctness. The authors define the concept of sweeping, and provides the general steps carried out in algorithms that use this method. The authors then provide pseudocode implementation of algorithm to determine if any of the segments intersect, prove its correctness and proves its running time to be $O(n \lg n)$.

The authors defines the concept of convex hull and discuss following methods to determine convex hull of a set of points:
  1. Graham's scan: This takes $O(n \lg n)$ time.
  2. Jarvis' march: This takes $O(n \times h)$ time.
  3. Incremental method: This takes $O(n \lg n)$ time.
  4. Divide and Conquer method: This takes $O(n \lg n)$ time.
  5. Prune and Search method: This takes $O(n \lg h)$ time.
The authors provide pseudocode implementation of Graham's scan and prove its correctness.

The authors then discuss the problem of finding the closest pair of points. The authors provide pseudocode implementation of Divide and Conquer approach, prove its correctness and derive its running time to be $O(n \lg n)$.

No comments:

Post a Comment