---
title: "minimum edit distance"
source: https://www.jemoka.com/posts/kbhminimum_edit_distance/
---

&ldquo;minimum edit distance&rdquo; is one approach to solving the problem of &ldquo;how similar are these two strings&rdquo;? minimum edit distance is defined by the smallest number of editing operations (insertion, deletion, substitution) needed to transform one string into another.
There are two technical definitions. Both definitions are grounded upon &ldquo;minimum number of operations it takes to transform a string into another, where&rdquo;
edit distance with DP
DP costs \(O(nm)\), backtrace costs \(O(n+m)\).
Standard Edit Distance insertion, deletion, and substitution cost 1
Levenshtein Distance insertion and deletion cost 1; substitution cost 2
Example For instance: &ldquo;graffe&rdquo;. Is&hellip;
graf graft grail giraffe the closest?
Common Use machine translation + speech recognition uses edit distance to evaluate output quality coreference and NER uses edit distance as a baseline check
