DamerauLevenshtein
Damerau–Levenshtein distance is a string metric for measuring the difference between two sequences. It quantifies the minimum number of edit operations required to transform one string into the other. The standard operations are insertion, deletion, and substitution, and the Damerau extension adds the transposition of two adjacent characters as a single operation. This makes the distance more permissive than the Levenshtein distance for strings that differ by swapped letters.
Two related variants are commonly discussed. The true Damerau–Levenshtein distance allows arbitrarily many edits on overlapping
Computationally, both versions can be computed by dynamic programming. The standard DP algorithm runs in O(nm)
Origin and usage: the method is named after Frederick J. Damerau and Vladimir Levenshtein; Damerau proposed