Jump to content

Gift wrapping algorithm

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Timwi (talk | contribs) at 15:40, 8 December 2003 (moved out from convex hull). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

The gift wrapping algorithm is a simple (yet somewhat inefficient) algorithm for computing the convex hull of a given set of points. It has O(NK) complexity, where N is the number of points and K is the number of points on the convex hull.

The gift wrapping algorithm begins with a point A known to be on the convex hull (such as the leftmost point) and selects the point B such that all points are to the left (or right) of the line AB. Repeating with B and so on until one reaches A again yields the convex hull. The gift wrapping algorithm is exactly analogous to the process of winding a string (or wrapping paper) around the set of points.

This article is a stub. You can help Wikipedia by fixing it.