levenshtein fuzzy search algorithm visual

Color Scheme:

background info:

the levenshtein fuzzy search algorithm is a string matching algorithm that returns the "edit distance", or the number of edits done to get one string to the other.

the 3 types of edits include:

for example, for the word kitten, and the word sitting, the edit distance would be 3, because:

  1. kitten → sitten (substitution of "s" for "k")
  2. sitten → sittin (substitution of "i" for "e")
  3. sittin → sitting (insertion of "g" at the end)

this is the algorithm behind the approach, using matrices and dynamic programming

visualizer:

enter string 1:
enter string 2: