AI engineering glossary · Data structures algorithms

What is edit distance?

Edit distance (also called Levenshtein distance): The minimum number of single-character insertions, deletions and substitutions needed to turn one string into another. It is computed by dynamic programming and used in spell checking and fuzzy matching.

Level: advancedTopic: Data structures algorithms

Edit distance: an example

Turning 'kitten' into 'sitting' takes 3 edits: replace k with s, replace e with i, and add g.

Related terms

More Data structures algorithms terms

Where you learn it

Edit distance is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.