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.

War Story: Stripping Triangulations<br />

Figure: A bounded height priority queue for triangle strips<br />

● Priority Queue - Since we were repeatedly interested in identifying the longest possible next strip,<br />

we needed a priority queue to store the strips, ordered according to length. <strong>The</strong> next strip to peel<br />

would always be the top of the queue. Our priority queue had to permit reducing the priority of<br />

arbitrary elements of the queue whenever we updated the strip lengths to reflect what triangles<br />

were peeled away. Because all of the strip lengths were bounded by a fairly small integer<br />

(hardware constraints prevent any strip from having more than 256 vertices), we used a bounded<br />

height priority queue (shown in Figure and described in Section ). An ordinary heap would<br />

also have worked just fine.<br />

To update a queue entry associated with a triangle, we needed to be able to quickly find where it<br />

was. This meant that we also needed a ...<br />

● Dictionary - For each triangle in the mesh, we needed a way to find where it was in the queue.<br />

This meant storing a pointer for each triangle. Since each triangle was defined by three integer<br />

vertex numbers, either a hash table or an array of lists of triangles would suffice. By integrating<br />

this dictionary with the priority queue, we built a data structure capable of a wider range of<br />

operations.<br />

Although there were various other complications, such as quickly recalculating the length of the strips<br />

affected by the peeling, the key idea needed to obtain better performance was to use the priority queue.<br />

Run time improved by several orders of magnitude after employing these data structures.<br />

file:///E|/BOOK/BOOK/NODE37.HTM (3 of 4) [19/1/2003 1:28:34]

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

Saved successfully!

Ooh no, something went wrong!