18.04.2013 Views

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Minimum Weight Triangulation<br />

Next: Limitations of Dynamic Programming Up: Dynamic Programming Previous: Longest Increasing Sequence<br />

Minimum Weight Triangulation<br />

Figure: Two different triangulations of a given convex seven-gon<br />

A triangulation of a polygon is a set of non-intersecting diagonals that partitions the polygon into<br />

triangles. We say that the weight of a triangulation is the sum of the lengths of its diagonals. As shown in Figure ,<br />

any given polygon may have many different triangulations. For any given polygon, we seek to find its minimum weight<br />

triangulation. Triangulation is a fundamental component of most geometric algorithms, as discussed in Section .<br />

To apply dynamic programming, we need a way to carve up the polygon into smaller pieces. A first idea might be to try<br />

all possible chords, each of which partitions the polygon into two smaller polygons. Using dynamic programming,<br />

this will work to give a polynomial-time algorithm. However, there is a slicker approach.<br />

Figure: Selecting the vertex k to pair with an edge (i,j) of the polygon<br />

Observe that every edge of the input polygon must be involved in exactly one triangle. Turning this edge into a triangle<br />

means identifying the third vertex, as shown in Figure . Once we find the correct connecting vertex, the polygon<br />

will be partitioned into two smaller pieces, both of which need to be triangulated optimally. Let T[i,j] be the cost of<br />

triangulating from vertex to vertex , ignoring the length of the chord from to . <strong>The</strong> latter clause avoids<br />

double counting these internal chords in the following recurrence:<br />

<strong>The</strong> basis condition applies when i and j are immediate neighbors, as T[i,i+1] = 0.<br />

Since the number of vertices in each subrange of the right side of the recurrence is smaller than that on the left side,<br />

evaluation can proceed in terms of the gap size from i to j:<br />

Minimum-Weight-Triangulation(P)<br />

file:///E|/BOOK/BOOK2/NODE48.HTM (1 of 2) [19/1/2003 1:28:49]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!