08 - Edit distance - | | x | | | \ \ \ \ x \ \ a b a b a a...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
2/15/08 - Edit distance Homework 2 in Upson 360 by 2pm today Prelim next week, Thursday evening - 2 algorithm questions, questions about lectures Dynamic programming review questions Techniques: (1) Greedy (2) Div. + Conq (3) Dyn. Prog. Ch. 4-6 Important alg's (1) Gale-Shapley (2) Kruskal + Prim (3) [FFT] (4) Bellman-Ford Edit Distance Klinburg K l i n b u r g Kleinberg K l e i n b u r g Joachims If is a ±nite alphabet and x, y * then EdDist(x, y) = min # of single-character insert, delete, or change op's to transform x into y. Klinburg vs. Klinbqrg If is a ±nite alphabet and x, y * then EdDist(x, y) = min cost of single-character insert, delete, or change op's to transform x into y. cost of insert/delete = δ cost of changing p to q is α pq Given: , δ , ( α pq ) p,q and x, y *, compute EdDist(x,y) 14-1 14
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
a b b b a a b b b b a a b
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: | | x | | | \ \ \ \ x \ \ a b a b a a a b b b b b a b EdDist = min-cost non-crossing matching between chars of x and y. Cost of matching p to q is pq . Cost (unmatched) = . Lemma: Let m=|x|, n=|y|. In every alignment of x and y either (A) x m , y n are matched (B) x m is unmatched (C) y n is unmatched (A) Cost is xmyn + EdDist(x 1...m-1 , y 1...n-1 ) (B) Cost is + EdDist(x 1...m-1 , y 1...n ) (C) Cost is + EdDist(x 1...m , y 1...n-1 ) Example: ab aa =1 ab =3 +EdDist(a,aa) = + ab a +EdDist(ab,a) = + DeFne OPT(i,j) := EdDist(x 1...i , y 1...j ) OPT(0, j) = j; OPT(i, 0) = i for i = 0, 1, . .., m 14-2 for j = 0, 1, . .., n { xiyj + OPT(i-1, j-1) OPT(i,j) = min{ + OPT(i, j-1) { + OPT(i-1, j) endfor endfor 14-3...
View Full Document

Page1 / 3

08 - Edit distance - | | x | | | \ \ \ \ x \ \ a b a b a a...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online