08 - Edit distance

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

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

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

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

View Full Document
a b b b a a b b b b a a b
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

{[ snackBarMessage ]}

### Page1 / 3

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

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

View Full Document
Ask a homework question - tutors are online