1 / 9

Minimum Edit Distance

Minimum Edit Distance. Backtrace for Computing Alignments. Computing alignments. Edit distance isn’t sufficient We often need to align each character of the two strings to each other We do this by keeping a “ backtrace ” Every time we enter a cell, remember where we came from

lelia
Download Presentation

Minimum Edit Distance

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Minimum Edit Distance Backtrace for Computing Alignments

  2. Computing alignments • Edit distance isn’t sufficient • We often need to align each character of the two strings to each other • We do this by keeping a “backtrace” • Every time we enter a cell, remember where we came from • When we reach the end, • Trace back the path from the upper right corner to read off the alignment

  3. Edit Distance

  4. MinEdit with Backtrace

  5. Adding Backtrace to Minimum Edit Distance deletion insertion substitution insertion deletion substitution • Base conditions: Termination: D(i,0) = i D(0,j) = j D(N,M) is distance • Recurrence Relation: For each i = 1…M For each j = 1…N D(i-1,j) + 1 D(i,j)= min D(i,j-1) + 1 D(i-1,j-1) + 2; if X(i) ≠ Y(j) 0; if X(i) = Y(j) LEFT ptr(i,j)= DOWN DIAG

  6. The Distance Matrix Every non-decreasing path from (0,0) to (M, N) corresponds to an alignment of the two sequences x0…………………… xN An optimal alignment is composed of optimal subalignments y0……………………………… yM Slide adapted from SerafimBatzoglou

  7. Result of Backtrace Two strings and their alignment:

  8. Performance • Time: O(nm) • Space: O(nm) • Backtrace O(n+m)

  9. Minimum Edit Distance Backtrace for Computing Alignments

More Related