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: Evolution of the Lobster<br />

Figure: Morphing a lobster into a head via dynamic programming<br />

● Full run match: We may match run i on top to run j on the bottom for a cost that is a function of<br />

the difference in the lengths of the two runs and their positions.<br />

● Merging runs: We may match a string of consecutive runs on top to a run on the bottom. <strong>The</strong> cost<br />

will be a function of the number of runs, their relative positions, and their lengths.<br />

● Splitting runs: We may match a big run on top to a string of consecutive runs on the bottom. This<br />

is just the converse of the merge. Again, the cost will be a function of the number of runs, their<br />

relative positions, and their lengths.<br />

``For each pair of runs (i,j) and all the cases that apply, we compute the cost of the edit operation and add<br />

to the (already computed and stored) edit cost to the left of the start of the edit. <strong>The</strong> cheapest of these<br />

cases is what we will take for the cost of c[i,j].''<br />

<strong>The</strong> pair of graduate students scribbled this down, then frowned. ``So we are going to have a cost<br />

measure for matching two runs that is a function of their lengths and positions. How do we decide what<br />

the relative costs should be?''<br />

file:///E|/BOOK/BOOK2/NODE50.HTM (3 of 4) [19/1/2003 1:28:52]

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

Saved successfully!

Ooh no, something went wrong!