Skip to content

indel

indel(a, b): number

Compute the Indel distance between two strings.

The Indel distance counts the minimum number of insertions and deletions (no substitutions) required to transform one string into the other. It equals len(a) + len(b) - 2 * LCS_length(a, b).

Useful when substitutions are semantically two operations (one deletion + one insertion), such as in DNA sequence alignment.

Compares the Unicode code points of the strings as given: case, whitespace and Unicode normalization (NFC vs NFD) are not adjusted.

Parameter Type
a string
b string

number