Handouts:
2/9/09: Triangulations of simple polygons: more properties and algorithms
More Properties of Triangulations of Simple polygons
Last time I covered in detail: Lem 1.2.1, 1.2.2, Thm 1.2.3
More properties of triangulations of simple polygons:
Lem 1.2.4, Cor 1.2.5, Lem 1.2.6, Thm 1.2.7 (Meister's 2-Ear Theorem), Thm 1.2.8
Algorithms for triangulation
Bottom line: One can triangulate a simple polygon in linear time (O(n)).
However, this algorithm, by Chazelle, is VERY complex and we
do not cover it. (It is assumed not to be at all practical.)
You are expected to know,
though, from a theoretical point of view, the time it takes
to triangulate a simple polygon (no holes) is O(n).
Later, we will cover Chapter 2 material, which includes
an O(n log n) time algorithm for triangulation (which applies even for a polygon with holes).
We discuss a sequence of algorithms:
Algorithm 1 ("SuperSlow") is O(n^4), and simply checks all O(n^2) candidate
diagonals, testing each in time O(n); thus, in time O(n^3), we find
a diagonal (which we know exists), and then repeat, in order to find all
n-3 diagonals in total O(n^4).
Algorithm 2 ("Slow") is O(n^3), based on the observation
that we can limit ourselves to O(n) candidates corresponding to ear diagonals.
Algorithm 3 is an
ear-clipping algorithm having worst-case time O(n^2), based on the
observation that once one ear is clipped, we can update the "ear tip status"
of just the O(1) nearby vertices; it is implemented in the text
as Triangulate(). We manually show in detail how this procedure works
on an example.