Handouts:
2/25/08: More on triangulating polygons: An O(n log n) Algorithm
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).