The Levenshtein distance is a string metric for measuring the difference between two sequences. The Wagner–Fischer algorithm is a dynamic programming algorithm that computes the edit distance between two strings of characters.
Both using a matrix, and I don't see the difference? Is the difference the backtracking or is there no further difference by the fact that one is the "literature" and the other one is the programming?
Also I am just writing on a thesis, and I am not sure how to divide it- should I first get into explaining the Levenshtein distance first and afterwards the Wagner-Fisher algorithm or doing both in one? I got kinda confused here.
You actually answer the question yourself in the first paragraph. In the second paragraph you mix them up a bit.
Levenshtein distance is an edit distance metric named after Vladimir Levenshtein who considered this distance in 1965 and have nothing to do with the dynamic programming "matrix". And the Wagner–Fischer algorithm is a dynamic programming algorithm that computes the edit distance between two strings of characters.
However, the Levenshtein distance is normally computed using dynamic programming if what you need is a general purpose computation, that is, calculate the edit distance between two random input strings. But Levenshtein distance can also be used in a spell checker, when you compare one string with a dictionary. In cases like this its normally to slow to use a general purpose computation,and something like a Levenshtein Automaton can provide linear time to get all spelling suggestions. Btw, this is also used in the fuzzy search in Lucene since version 4.
About your thesis, well I think it depends. If its about the actual Levenshtein metric then I think thats where you should start, and if its about dynamic programming you should start with Wagner-Fischer. Anyway, thats my two cents about it. And good luck with you thesis.
Indeed, they are closely related, but they are not the same thing. The Levenshtein distance is a concept that is defined by a mathematical formula. However, trying to compute the Levenshtein distance by implementing the recursive formula directly will be horrendously slow. The Wagner-Fischer is a dynamic programming algorithm to compute it efficiently.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With