Chan's algorithm

A 2D demo for Chan's algorithm.

In computational geometry, Chan's algorithm,[1] named after Timothy M. Chan, is an optimal output-sensitive algorithm to compute the convex hull of a set of points, in 2- or 3-dimensional space. The algorithm takes time, where is the number of vertices of the output (the convex hull). In the planar case, the algorithm combines an algorithm (Graham scan, for example) with Jarvis march (), in order to obtain an optimal time. Chan's algorithm is notable because it is much simpler than the Kirkpatrick–Seidel algorithm, and it naturally extends to 3-dimensional space. This paradigm[2] has been independently developed by Frank Nielsen in his Ph.D. thesis.[3]

Algorithm

Initially, we assume that the value of is known and make a parameter . This assumption is not realistic, but we remove it later. The algorithm starts by arbitrarily partitioning into at most subsets with at most points each. Then, it computes the convex hull of each subset using an algorithm (for example, Graham scan). Note that, as there are subsets of points each, this phase takes time.

The second phase consists of executing Jarvis's march algorithm and using the precomputed convex hulls to speed up the execution. At each step in Jarvis's march, we have a point in the convex hull, and need to find a point such that all other points of are to the right of the line . If we know the convex hull of a set of points, then we can compute in time, by using binary search. We can compute for all the subsets in time. Then, we can determine using the same technique as normally used in Jarvis's march, but only considering the points that are for some subset . As Jarvis's march repeats this process times, the second phase also takes time, and therefore time if .

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

If we increase the value of 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 too quickly, we risk making much larger than , also increasing the execution time. Similar to strategy used by Chazelle and Matoušek's,[4] algorithm, Chan's algorithm squares the value of at each iteration, and makes sure that is never larger than . In other words, at iteration (starting at 1), we have . The total running time of the algorithm is

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

Implementation

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

Extensions

Chan's paper contains some other problems whose known algorithms can be made optimal output sensitive using his technique, for example:

References

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.