Handouts:
2/16/09: Monotone polygons and monotone mountains; linear-time triangulation of special polygons.
I answer questions from HW2.

Notes on special classes of simple polygons:
  • (a) Convex (trivial to triangulate with a "fan triangulation" in O(n) time);
  • (b) Star-shaped: They can be recognized in O(n) time (in fact, in O(n) time, one can construct the "kernel" of a simple polygon, which is the (possibly empty) convex polygon of possible locations for a single guard to see all of the polygon). It is easy to get an O(n) time algorithm for a "Steiner triangulation" of a star-shaped polygon, in which we create a Steiner point anywhere in the kernel, and join it to each vertex, to create a Steiner fan triangulation. This is not, however, a "triangulation" as we define it. There are, however, O(n)-time relatively simple algorithms to triangulate star-shaped polygons. (I do not give details.)
  • (c) Monotone polygons, chains: I defined what it means to be d-monotone or strictly d-monotone for a chain and for a polygon. Examples. Note that a polygon is convex if and only if it is monotone with respect to ALL directions d. Monotone polygons will have relatively simple O(n)-time triangulations. (We will focus first on a special case of monotone polygons: monotone mountains.)

    Definitions of monotone polygons: d-monotone, monotone, strictly d-monotone, strictly monotone polygons. Examples. Definition of monotone mountains. More examples.

    Overview of O(n) algorithm to triangulate monotone mountains. We do examples and discuss complexity carefully. Note that I make the algorithm specific (unlike the book): We always cut off the strictly convex (non-base-endpoint) that has max y-coordinate (assuming the polygon is a monotone mountain wrt y).

    Outline of the O(n log n) triangulation algorithm: (1) triangulate monotone mountains in O(n) time; (2) use plane sweep to decompose P into horizontal trapezoids, then into monotone mountains.
    Detailed description of plane sweep algorithm to compute a horizontal trapezoidal decomposition of a polygon P (and possibly its exterior too): (1) events, stored in an Event Queue (EQ); (2) Sweep Line Status (SLS). We do an example.
    We show how to use the horizontal trapezoidalization to decompose the polygon into (1) monotone polygons and (2) monotone mountains using diagonals. In case (1) (not yet shown in class), we draw a diagonal joining the vertex (generator) of the top of the trapezoid to the vertex (generator) of the bottom of the trapezoid whenever either one (or both) of the vertices lies in the interior of the top/bottom. This resolves all "cusps" and guarantees that the resulting set of diagonals partitions the domain into monotone polygons.

    In case (2), we draw a diagonal joining the vertex (generator) of the top of the trapezoid to the vertex (generator) of the bottom of the trapezoid whenever we can do so without this segment being an edge of the polygon (edges are not diagonals!): i.e., we join them if they are not both left and not both right endpoints of the top/bottom. Lemma 2.3.2 proves that these diagonals result in a partition into monotone mountains.

    Summary: Simple polygons can be triangulated in time O(n), using Chazelle's (very complicated) algorithm; you are expected to know this exists, but we did not cover it. Polygons with holes (and also polygons without holes (simple polygons)) can be triangulated in time O(n log n), using the algorithm we have covered in class (Chapter 2).
    LOWER BOUND (next time): For the problem of triangulating a polygon with holes, Omega(n log n) is a lower bound; I sketch a bit of the proof (from SORTING, which I show also has an Omega(n log n) lower bound).