biology daily - the biology and biochemistry encyclopedia
biology daily articles and research Encyclopedia Dictionary Forums biology research links Weblinks Pictures Articles Blogs Newsletter

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, by the name of the author, and has O(NK) time complexity, where N is the number of points and K is the number of points on the convex hull. Its real-life performance compared with other convex hull algorithms is favorable when N is small or K is expected to be very small with respect to N. In general case the algorithm is outperformed by many others.

The gift wrapping algorithm begins with a point A known to be on the convex hull, e.g., the leftmost point, and selects the point B such that all points are to the right of the line AB. This point may be found on O(N) time by comparing polar angles of all points with respect to point A taken for the center of polar coordinates. Repeating with B and so on until one reaches A again yields the convex hull in K steps. The gift wrapping algorithm is exactly analogous to the process of winding a string (or wrapping paper) around the set of points.

Higher dimensions

The approach is extendable to higher dimensions.

Related articles



07-14-2008 23:18:10
The contents of this article are licensed from Wikipedia.org under the GNU Free Documentation License. How to see transparent copy
BiologyDaily.com 2005. Legal info   Privacy