The.Algorithm.Design.Manual.Springer-Verlag.1998
The.Algorithm.Design.Manual.Springer-Verlag.1998 The.Algorithm.Design.Manual.Springer-Verlag.1998
Convex Hull Next: Triangulation Up: Computational Geometry Previous: Robust Geometric Primitives Convex Hull Input description: A set S of n points in d-dimensional space. Problem description: Find the smallest convex polygon containing all the points of S. Discussion: Finding the convex hull of a set of points is the most elementary interesting problem in computational geometry, just as minimum spanning tree is the most elementary interesting problem in graph algorithms. It arises because the hull quickly captures a rough idea of the shape or extent of a data set. Convex hull also serves as a first preprocessing step to many, if not most, geometric algorithms. For example, consider the problem of finding the diameter of a set of points, which is the pair of points a maximum distance apart. The diameter will always be the distance between two points on the convex hull. The algorithm for computing diameter proceeds by first constructing the convex hull, then for each hull vertex finding which other hull vertex is farthest away from it. This so-called ``rotatingcalipers'' method can be used to move efficiently from one hull vertex to another. There are almost as many convex hull algorithms as there are sorting algorithms. Answer the following questions to help choose between them: file:///E|/BOOK/BOOK4/NODE185.HTM (1 of 5) [19/1/2003 1:31:37]
Convex Hull ● How many dimensions are you working with? - Convex hulls in two and even three dimensions are fairly easy to work with. However, as the dimension of a space increases, certain assumptions that were valid in lower dimensions break down. For example, any n-vertex polygon in two dimensions has exactly n edges. However, the relationship between the numbers of faces and vertices is more complicated even in three dimensions. A cube has 8 vertices and 6 faces, while an octahedron has 8 faces and 6 vertices. This has implications for data structures that represent hulls - are you just looking for the hull points or do you need the defining polyhedron? The need to find convex hulls in high-dimensional spaces arises in many applications, so be aware of such complications if your problem takes you there. Gift-wrapping is the basic algorithm for constructing higher-dimensional convex hulls. Observe that a three-dimensional convex polyhedron is composed of two-dimensional faces, or facets, which are connected by one-dimensional lines, or edges. Each edge joins exactly two facets together. Gift-wrapping starts by finding an initial facet associated with the lowest vertex and then conducting a breadth-first search from this facet to discover new, additional facets. Each edge e defining the boundary of a facet must be shared with one other facet, so by running through each of the n points we can identify which point defines the next facet with e. Essentially, we ``wrap'' the points one facet at a time by bending the wrapping paper around an edge until it hits the first point. The key to efficiency is making sure that each edge is explored only once. Implemented properly in d dimensions, gift-wrapping takes , where is the number of facets and is the number of edges in the convex hull. Thus gift-wrapping can be very efficient when there is only a constant number of facets on the hull. However, this can be as bad as when the convex hull is very complex. Better convex hull algorithms are available for the important special case of three dimensions, where time in fact suffices. For three or higher dimensions, I recommend that you use one of the codes described below rather than roll your own. ● Is your data given as vertices or half-spaces? - The problem of finding the intersection of a set of n half-spaces in d dimensions is dual to that of computing convex hulls of n points in d dimensions. Thus the same basic algorithm suffices for both problems. The necessary duality transformation is discussed in Section . ● How many points are likely to be on the hull? - If your points are selected ``randomly'', it is likely that most of them lie within the interior of the hull. Planar convex hull programs can be made more efficient in practice using the observation than the leftmost, rightmost, topmost, and bottommost points must all be on the convex hull. Unless the topmost is leftmost and bottommost is rightmost, this gives a set of either three or four distinct points, defining a triangle or quadrilateral. Any point inside this region cannot be on the convex hull and can be discarded in a linear sweep through the points. Ideally, only a few points will then remain to run through the full convex hull algorithm. file:///E|/BOOK/BOOK4/NODE185.HTM (2 of 5) [19/1/2003 1:31:37]
- Page 509 and 510: Planarity Detection and Embedding N
- Page 511 and 512: Planarity Detection and Embedding p
- Page 513 and 514: Graph Problems: Hard Problems ● C
- Page 515 and 516: Clique approximate even to within a
- Page 517 and 518: Independent Set Next: Vertex Cover
- Page 519 and 520: Independent Set Related Problems: C
- Page 521 and 522: Vertex Cover Vertex cover and indep
- Page 523 and 524: Traveling Salesman Problem Next: Ha
- Page 525 and 526: Traveling Salesman Problem practice
- Page 527 and 528: Traveling Salesman Problem Size is
- Page 529 and 530: Hamiltonian Cycle Eulerian cycle, p
- Page 531 and 532: Graph Partition Next: Vertex Colori
- Page 533 and 534: Graph Partition annealing, is almos
- Page 535 and 536: Vertex Coloring Several special cas
- Page 537 and 538: Vertex Coloring Notes: An excellent
- Page 539 and 540: Edge Coloring The minimum number of
- Page 541 and 542: Graph Isomorphism Next: Steiner Tre
- Page 543 and 544: Graph Isomorphism vertices into equ
- Page 545 and 546: Steiner Tree Next: Feedback Edge/Ve
- Page 547 and 548: Steiner Tree The worst case for a m
- Page 549 and 550: Feedback Edge/Vertex Set Next: Comp
- Page 551 and 552: Feedback Edge/Vertex Set An interes
- Page 553 and 554: Computational Geometry complete bib
- Page 555 and 556: Robust Geometric Primitives Next: C
- Page 557 and 558: Robust Geometric Primitives ● Are
- Page 559: Robust Geometric Primitives Related
- Page 563 and 564: Convex Hull http://www.cs.att.com/n
- Page 565 and 566: Triangulation Next: Voronoi Diagram
- Page 567 and 568: Triangulation GEOMPACK is a suite o
- Page 569 and 570: Voronoi Diagrams Next: Nearest Neig
- Page 571 and 572: Voronoi Diagrams McDonald's, the ti
- Page 573 and 574: Nearest Neighbor Search Next: Range
- Page 575 and 576: Nearest Neighbor Search Implementat
- Page 577 and 578: Range Search Next: Point Location U
- Page 579 and 580: Range Search subdivisions in C++. I
- Page 581 and 582: Point Location the n edges for inte
- Page 583 and 584: Point Location More recently, there
- Page 585 and 586: Intersection Detection ● Do you w
- Page 587 and 588: Intersection Detection Implementati
- Page 589 and 590: Bin Packing Next: Medial-Axis Trans
- Page 591 and 592: Bin Packing approach for general sh
- Page 593 and 594: Medial-Axis Transformation Next: Po
- Page 595 and 596: Medial-Axis Transformation Implemen
- Page 597 and 598: Polygon Partitioning number of piec
- Page 599 and 600: Simplifying Polygons Next: Shape Si
- Page 601 and 602: Simplifying Polygons vertices and o
- Page 603 and 604: Shape Similarity Next: Motion Plann
- Page 605 and 606: Shape Similarity or how close it is
- Page 607 and 608: Motion Planning There is a wide ran
- Page 609 and 610: Motion Planning often arise in the
Convex Hull<br />
● How many dimensions are you working with? - Convex hulls in two and even three dimensions<br />
are fairly easy to work with. However, as the dimension of a space increases, certain assumptions<br />
that were valid in lower dimensions break down. For example, any n-vertex polygon in two<br />
dimensions has exactly n edges. However, the relationship between the numbers of faces and<br />
vertices is more complicated even in three dimensions. A cube has 8 vertices and 6 faces, while an<br />
octahedron has 8 faces and 6 vertices. This has implications for data structures that represent hulls<br />
- are you just looking for the hull points or do you need the defining polyhedron? <strong>The</strong> need to find<br />
convex hulls in high-dimensional spaces arises in many applications, so be aware of such<br />
complications if your problem takes you there.<br />
Gift-wrapping is the basic algorithm for constructing higher-dimensional convex hulls. Observe<br />
that a three-dimensional convex polyhedron is composed of two-dimensional faces, or facets,<br />
which are connected by one-dimensional lines, or edges. Each edge joins exactly two facets<br />
together. Gift-wrapping starts by finding an initial facet associated with the lowest vertex and then<br />
conducting a breadth-first search from this facet to discover new, additional facets. Each edge e<br />
defining the boundary of a facet must be shared with one other facet, so by running through each<br />
of the n points we can identify which point defines the next facet with e. Essentially, we ``wrap''<br />
the points one facet at a time by bending the wrapping paper around an edge until it hits the first<br />
point.<br />
<strong>The</strong> key to efficiency is making sure that each edge is explored only once. Implemented properly<br />
in d dimensions, gift-wrapping takes , where is the number of facets<br />
and is the number of edges in the convex hull. Thus gift-wrapping can be very efficient when<br />
there is only a constant number of facets on the hull. However, this can be as bad as<br />
when the convex hull is very complex.<br />
Better convex hull algorithms are available for the important special case of three dimensions,<br />
where time in fact suffices. For three or higher dimensions, I recommend that you use<br />
one of the codes described below rather than roll your own.<br />
● Is your data given as vertices or half-spaces? - <strong>The</strong> problem of finding the intersection of a set of<br />
n half-spaces in d dimensions is dual to that of computing convex hulls of n points in d<br />
dimensions. Thus the same basic algorithm suffices for both problems. <strong>The</strong> necessary duality<br />
transformation is discussed in Section .<br />
● How many points are likely to be on the hull? - If your points are selected ``randomly'', it is likely<br />
that most of them lie within the interior of the hull. Planar convex hull programs can be made<br />
more efficient in practice using the observation than the leftmost, rightmost, topmost, and<br />
bottommost points must all be on the convex hull. Unless the topmost is leftmost and bottommost<br />
is rightmost, this gives a set of either three or four distinct points, defining a triangle or<br />
quadrilateral. Any point inside this region cannot be on the convex hull and can be discarded in a<br />
linear sweep through the points. Ideally, only a few points will then remain to run through the full<br />
convex hull algorithm.<br />
file:///E|/BOOK/BOOK4/NODE185.HTM (2 of 5) [19/1/2003 1:31:37]