Learn Before
Concept
Minimum edit distance algorithm
The minimum edit distance algorithm is a dynamic programming algorithm commonly used in evaluating the similarity between strings.
Given two strings, the source string of length n, and target string of length m, we’ll define D[i, j] as the edit distance between X[1..i] and Y[1.. j].
- Initialization: the zeroth row and column is the distance from the empty string
- for each row i from 1 to n do: D[i,0] leftarrow D[i-1,0] +del-cost
- for each column j from 1 to m do: D[0,j] leftarrow D[0, j-1] +ins-cost
- Recurrence relation:
- for each row i from 1 to n do:
- for each column j from 1 to m do:
- for each row i from 1 to n do:

0
1
Updated 2020-08-02
Tags
Data Science