The.Algorithm.Design.Manual.Springer-Verlag.1998
The.Algorithm.Design.Manual.Springer-Verlag.1998 The.Algorithm.Design.Manual.Springer-Verlag.1998
Polygon Partitioning Next: Simplifying Polygons Up: Computational Geometry Previous: Medial-Axis Transformation Polygon Partitioning Input description: A polygon or polyhedron P. Problem description: How can P be partitioned into a small number of simple (typically convex) pieces? Discussion: Polygon partitioning is an important preprocessing step for many geometric algorithms, because most geometric problems are simpler and faster on convex objects than on nonconvex ones. We are better off whenever we can partition a nonconvex object into a small number of convex pieces, because it is easier to work with the pieces independently than with the original object. Several flavors of polygon partitioning arise, depending upon the particular application: ● Should all the pieces be triangles? - The mother of all polygon partitioning problems is triangulation, where the interior of the polygon is completely partitioned into triangles. Triangles are always convex and have only three sides, so any geometric operation performed on a triangle is destined to be as simple as it can be. Because triangles all have three sides, all triangulations of polygons contain exactly the same file:///E|/BOOK/BOOK5/NODE194.HTM (1 of 3) [19/1/2003 1:31:53]
Polygon Partitioning number of pieces. Therefore, triangulation cannot be the answer if we seek a small number of convex pieces. The goal of finding ``nice'' triangulations revolves around the shape of the triangles. See Section for a thorough discussion of triangulation. ● Do I want to cover or partition my polygon? - Partitioning a polygon means completely dividing the interior into nonoverlapping pieces. Covering a polygon means that our decomposition is permitted to contain mutually overlapping pieces. Both can be useful in different situations. In decomposing a complicated query polygon in preparation for range search (Section ), we seek a partitioning, so that each point we locate occurs in exactly one piece. In decomposing a polygon for painting purposes, a covering suffices, since there is no difficulty with filling in a region twice. We will concentrate here on partitioning, since it is simpler to do right, and any application needing a covering will accept a partitioning. The only potential drawback is that partitions can be somewhat larger than coverings. ● Am I allowed to add extra vertices? - A final issue associated with polygon decomposition is whether we are allowed to add Steiner vertices (either by splitting edges or adding interior points) or whether we are restricted to adding chords between two existing vertices. The former may result in a smaller number of pieces, at the cost of more complicated algorithms and perhaps messier results. The Hertel-Mehlhorn heuristic for convex decomposition using diagonals is simple, efficient, and always produces no more than four times the minimum number of convex pieces. It starts with an arbitrary triangulation of the polygon and then deletes a chord that leaves only convex pieces. The decision of whether a chord deletion will create a nonconvex piece can be made locally from the chords and edges surrounding the chord, in constant time. A vertex in a polygon is reflex if the internal angle is greater than 180 degrees. We can delete any chord that does not create a reflex vertex. I recommend using this heuristic unless it is critical for you to absolutely minimize the number of pieces. By experimenting with different triangulations and various deletion orders, you may be able to obtain somewhat better decompositions. Dynamic programming may be used to minimize the number of diagonals used in the decomposition. The simplest implementation, which maintains the number of pieces for all subpolygons split by a chord, runs in . Faster algorithms use fancier data structures, running in time, where r is the number of reflex vertices. An algorithm that further reduces the number of pieces by adding interior vertices is cited below, although it is complex and presumably difficult to implement. Implementations: Many triangulation codes start by finding a trapezoidal or monotone decomposition of polygons. Further, a triangulation is a simple form of convex decomposition. Check out the codes in Section as a starting point for most any decomposition problem. A triangulation code of particular relevance here is GEOMPACK, a suite of Fortran 77 codes by Barry Joe, for 2- and 3-dimensional triangulation and convex decomposition problems. In particular, it does file:///E|/BOOK/BOOK5/NODE194.HTM (2 of 3) [19/1/2003 1:31:53]
- 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 and 560: Robust Geometric Primitives Related
- Page 561 and 562: Convex Hull ● How many dimensions
- 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: Medial-Axis Transformation Implemen
- 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
- Page 611 and 612: Maintaining Line Arrangements Think
- Page 613 and 614: Maintaining Line Arrangements Next:
- Page 615 and 616: Minkowski Sum where x+y is the vect
- Page 617 and 618: Set and String Problems Next: Set C
- Page 619 and 620: Set Cover Next: Set Packing Up: Set
- Page 621 and 622: Set Cover Figure: Hitting set is du
- Page 623 and 624: Set Packing Next: String Matching U
- Page 625 and 626: Set Packing Notes: An excellent exp
- Page 627 and 628: String Matching shouldn't try. Furt
- Page 629 and 630: String Matching and texts, I recomm
- Page 631 and 632: Approximate String Matching This sa
- Page 633 and 634: Approximate String Matching http://
- Page 635 and 636: Text Compression Next: Cryptography
- Page 637 and 638: Text Compression code string. ASCII
- Page 639 and 640: Cryptography Next: Finite State Mac
- Page 641 and 642: Cryptography ● How can I validate
- Page 643 and 644: Cryptography MD5 [Riv92] is the sec
- Page 645 and 646: Finite State Machine Minimization F
Polygon Partitioning<br />
number of pieces. <strong>The</strong>refore, triangulation cannot be the answer if we seek a small number of<br />
convex pieces. <strong>The</strong> goal of finding ``nice'' triangulations revolves around the shape of the<br />
triangles. See Section for a thorough discussion of triangulation.<br />
● Do I want to cover or partition my polygon? - Partitioning a polygon means completely dividing<br />
the interior into nonoverlapping pieces. Covering a polygon means that our decomposition is<br />
permitted to contain mutually overlapping pieces. Both can be useful in different situations. In<br />
decomposing a complicated query polygon in preparation for range search (Section ), we seek<br />
a partitioning, so that each point we locate occurs in exactly one piece. In decomposing a polygon<br />
for painting purposes, a covering suffices, since there is no difficulty with filling in a region twice.<br />
We will concentrate here on partitioning, since it is simpler to do right, and any application<br />
needing a covering will accept a partitioning. <strong>The</strong> only potential drawback is that partitions can be<br />
somewhat larger than coverings.<br />
● Am I allowed to add extra vertices? - A final issue associated with polygon decomposition is<br />
whether we are allowed to add Steiner vertices (either by splitting edges or adding interior points)<br />
or whether we are restricted to adding chords between two existing vertices. <strong>The</strong> former may<br />
result in a smaller number of pieces, at the cost of more complicated algorithms and perhaps<br />
messier results.<br />
<strong>The</strong> Hertel-Mehlhorn heuristic for convex decomposition using diagonals is simple, efficient, and always<br />
produces no more than four times the minimum number of convex pieces. It starts with an arbitrary<br />
triangulation of the polygon and then deletes a chord that leaves only convex pieces. <strong>The</strong> decision of<br />
whether a chord deletion will create a nonconvex piece can be made locally from the chords and edges<br />
surrounding the chord, in constant time. A vertex in a polygon is reflex if the internal angle is greater<br />
than 180 degrees. We can delete any chord that does not create a reflex vertex.<br />
I recommend using this heuristic unless it is critical for you to absolutely minimize the number of pieces.<br />
By experimenting with different triangulations and various deletion orders, you may be able to obtain<br />
somewhat better decompositions.<br />
Dynamic programming may be used to minimize the number of diagonals used in the decomposition.<br />
<strong>The</strong> simplest implementation, which maintains the number of pieces for all subpolygons split by a<br />
chord, runs in . Faster algorithms use fancier data structures, running in time, where r is<br />
the number of reflex vertices. An algorithm that further reduces the number of pieces by adding<br />
interior vertices is cited below, although it is complex and presumably difficult to implement.<br />
Implementations: Many triangulation codes start by finding a trapezoidal or monotone decomposition of<br />
polygons. Further, a triangulation is a simple form of convex decomposition. Check out the codes in<br />
Section as a starting point for most any decomposition problem.<br />
A triangulation code of particular relevance here is GEOMPACK, a suite of Fortran 77 codes by Barry<br />
Joe, for 2- and 3-dimensional triangulation and convex decomposition problems. In particular, it does<br />
file:///E|/BOOK/BOOK5/NODE194.HTM (2 of 3) [19/1/2003 1:31:53]