Chan's algorithm

Chan's algorithm

In computational geometry, Chan's algorithm, named after Timothy M. Chan, is an optimal output-sensitive algorithm to compute the convex hull of a set P of n points, in 2 or 3 dimensional space. The algorithm takes O(n log h) time, where h is the number of vertices of the output (the convex hull). In the planar case, the algorithm combines an O(n log n) algorithm (Graham scan, for example) with Jarvis march, in order to obtain an optimal O(n log h) time. Chan's algorithm is notable because it is much simpler than the ultimate planar convex hull algorithm, and it naturally extends to 3-dimensional space.

Algorithm

Initially, we assume that the value of h is known and make a parameter m=h. This assumption is not realistic, but we remove it later. The algorithm starts by arbitrarily partitioning P into at most 1+n/m subsets Q with at most m points each. Then, it computes the convex hull of each subset Q using an O(n log n) algorithm. Note that, as there are O(n/m) subsets of O(m) points each, this phase takes O(n/m)O(m log m) = O(n log m) time.

The second phase consists of executing Jarvis march and using the precomputed convex hulls to speed up the execution. At each step in the Jarvis march algorithm, we have a point pi in the convex hull, and need to find a point pi+1 = f(pi,P) such that all other points of P are to the right of the line pi pi+1. If we know the convex hull of a set Q of m points, then we can compute f(pi,Q) in O(log m) time, by using binary search. We can compute f(pi,Q) for all the O(n/m) subsets Q in O(n/m log m) time. Then, we can determine f(pi,P) using the same technique as normally used in Jarvis March, but only considering the points that are f(pi,Q) for some subset Q. As the Jarvis march algorithm repeats this process O(h) times, the second phase also takes O(n log m) time, and if m=h, O(n log h) time.

By running the two phases described above, we can compute the convex hull of n points in O(n log h) time, assuming that we know the value of h. If we make m<h, we can abort the execution after m+1 steps, therefore spending only O(n log m) time (but not computing the convex hull). We can initially set m as a small constant (we use 2 for our analysis, but in practice numbers around 5 may work better), and increase the value of m until m>h, in which case we obtain the convex hull as a result.

If we increase the value of m too slowly, we may need to repeat the steps mentioned before too many times, and the execution time will be large. On the other hand, if we increase the value of m too quickly, we risk making m much larger than h, also increasing the execution time. Chan's algorithm squares the value of m at each iteration, and makes sure that m is never larger than n. In other words, at iteration t (starting at 0), we have m = \min(n,2^{2^t}). The total running time of the algorithm is

 \sum_{t=0}^{O(\log\log h)} O\left(n \log(2^{2^t})\right) = O(n) \sum_{t=0}^{O(\log\log h)} O(2^t) = O\left(n \cdot 2^{1+O(\log\log h)}\right) = O(n \log h).

To generalize this construction for the 3-dimensional case, an O(n log n) algorithm to compute the 3-dimensional convex hull should be used instead of Graham scan, and a 3-dimensional version of Jarvis march needs to be used. The time complexity remains O(n log h).

Implementation

Chan's paper contains several suggestions that may improve the practical performance of the algorithm, for example:

  • When computing the convex hulls of the subsets, eliminate the points that are not in the convex hull from consideration in subsequent executions.
  • The convex hulls of larger point sets can be obtained by merging previously calculated convex hulls, instead of recomputing from scratch.

References


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • Timothy M. Chan — (born 1976, in Michigan) is Professor in Computer Science at the University of Waterloo, where he currently holds a University Research Chair.He graduated with BA ( summa cum laude ) from Rice University in 1992 and completed his Ph.D. in… …   Wikipedia

  • Gift wrapping algorithm — The gift wrapping algorithm is a simple algorithm for computing the convex hull of a given set of points. Planar case In the two dimensional case the algorithm is also known as Jarvis march, after R. A. Jarvis, who published it in 1973; it has O( …   Wikipedia

  • Output-sensitive algorithm — In computer science, an output sensitive algorithm is an algorithm whose running time depends not only on the size of the input but also on the size of the output. For certain problems where the output size varies widely, for example from linear… …   Wikipedia

  • Prime-factor FFT algorithm — The Prime factor algorithm (PFA), also called the Good Thomas algorithm (1958/1963), is a fast Fourier transform (FFT) algorithm that re expresses the discrete Fourier transform (DFT) of a size N = N 1 N 2 as a two dimensional N 1 times; N 2 DFT …   Wikipedia

  • Kirkpatrick–Seidel algorithm — The Kirkpatrick–Seidel algorithm, called by its authors the ultimate planar convex hull algorithm is an algorithm for computing the convex hull of a set of points in the plane, with O( n log h ) time complexity, where n is the number of input… …   Wikipedia

  • Convex hull algorithms — Algorithms that construct convex hulls of various objects have a broad range of applications in mathematics and computer science, see Convex hull applications . In computational geometry, numerous algorithms are proposed for computing the convex… …   Wikipedia

  • List of algorithms — The following is a list of the algorithms described in Wikipedia. See also the list of data structures, list of algorithm general topics and list of terms relating to algorithms and data structures.If you intend to describe a new algorithm,… …   Wikipedia

  • List of mathematics articles (C) — NOTOC C C closed subgroup C minimal theory C normal subgroup C number C semiring C space C symmetry C* algebra C0 semigroup CA group Cabal (set theory) Cabibbo Kobayashi Maskawa matrix Cabinet projection Cable knot Cabri Geometry Cabtaxi number… …   Wikipedia

  • Context of computational complexity — In computational complexity theory and analysis of algorithms, a number of metrics are defined describing the resources, such as time or space, that a machine needs to solve a particular problem. Interpreting these metrics meaningfully requires… …   Wikipedia

  • Algorithms for calculating variance — play a major role in statistical computing. A key problem in the design of good algorithms for this problem is that formulas for the variance may involve sums of squares, which can lead to numerical instability as well as to arithmetic overflow… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”