edit distance
levenshtein distance is the cheapest way to turn one word into another by inserting, deleting or replacing letters. each cell answers that for the first few letters of both words, using only three cells it has already filled. the inked path is one cheapest answer.
try this
- flaw and lawn differ in all four positions, yet the distance is 2. follow the path to see why.
- pick kitten to sitting, then set replace to 2 under more. the distance goes from 3 to 5.
- press swap. the distance holds, and every insert becomes a delete.