Gift Wrapping Algorithm Article Index for
Gift
Website Links For
Gift
 

Information About

Gift Wrapping Algorithm





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 Angle s 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.

The approach is extendable to higher dimensions.


REFERENCES




SEE ALSO