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 comparison of the naive versus greedy heuristics for several triangular meshes<br />

How much better did the greedy heuristic do than the naive heuristic? Consider the table in Figure . In<br />

all cases, the greedy heuristic led to a set of strips that cost less, as measured by the total size of the<br />

strips. <strong>The</strong> savings ranged from about 10% to 50%, quite remarkable, since the greatest possible<br />

improvement (going from three vertices per triangle down to one) could yield a savings of only 66.6%.<br />

After implementing the greedy heuristic with our priority queue data structure, our complete algorithm<br />

ran in time, where n is the number of triangles and k is the length of the average strip. Thus the<br />

torus, which consisted of a small number of very long strips, took longer than the jaw, even though the<br />

latter contained over three times as many triangles.<br />

<strong>The</strong>re are several lessons to be gleaned from this story. First, whenever we are working with a large<br />

enough data set, only linear or close to linear algorithms (say ) are likely to be fast enough.<br />

Second, choosing the right data structure is often the key to getting the time complexity down to this<br />

point. Finally, using a greedy or somewhat smarter heuristic over the naive approach is likely to<br />

significantly improve the quality of the results. How much the improvement is likely to be can be<br />

determined only by experimentation. Our final, optimized triangle strip program is described in [ESV96].<br />

Next: War Story: Mystery of Up: Data Structures and Sorting Previous: Bucketing Techniques<br />

<strong>Algorithm</strong>s<br />

Mon Jun 2 23:33:50 EDT 1997<br />

file:///E|/BOOK/BOOK/NODE37.HTM (4 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!