intelligence_src_f9879f264b7a8ec1d7
- Source-provided label
- Publisher RSS metadata
- Evidence class
- mentioned in report
- Confidence
- Not reported
- Observed
- Dec 02, 2026 09:05 UTC
- Retrieved
- Dec 02, 2026 14:10 UTC
In our previous blog post, Implementing a Levenshtein Distance Function in KQL, we went through the Levenshtein Distance algorithm, explained how it works, and provided an implementation of the algorithm as a function in KQL.While the Levenshtein distance is useful for measuring string similarity, a later variation of the algorithm is better suited to our needs.Damerau-Levenshtein vs LevenshteinThe Damerau-Levenshtein Distance was introduced by a computer scientist named Frederick J. Damerau in 1964 as an extension of the classic Levenshtein Distance algorithm. The algorithm was developed to address common spelling errors, particularly those caused by accidentally swapping two adjacent characters.Consider the following example: comparing the strings form and from. The two strings contain exactly the same characters, but the adjacent characters o and r have swapped positions. Using the standard Levenshtein distance, we need 2 edit operations to transform form into from:Delete the character o: form → frmInsert o after r: frm → fromTherefore, the Levenshtein distance is 2.The Damerau-Levenshtein distance, on the other hand, extends the original algorithm by introducing an additional edit operation: the transposition of two adjacent characters allowing the swapping of o and r as a single operation. Consequently, the Damerau-Levenshtein distance between the two strings is 1.Optimal String Alignment (OSA) vs Unrestricted Damerau-LevenshteinThe Damerau-Levenshtein distance has two main variations: Optimal String Alignment (OSA) and Unrestricted Damerau-Levenshtein. Both measure the minimum number of edits required to transform one string into another, allowing insertions, deletions, substitutions, and transpositions of adjacent characters. However, OSA restricts each substring to being edited only once, which can produce a higher distance in certain cases.In contrast, unrestricted Damerau-Levenshtein allows edits to be applied without this restriction, producing the true minimum edit distance. The Lowrance-Wagner algorithm (1975) provides an efficient way for calculating the unrestricted Damerau-Levenshtein by keeping track of the last occurrences of characters in both strings, allowing it to correctly calculate transpositions even when other edit operations have occurred between them. This additional tracking enables it to consider all valid sequences of insertions, deletions, substitutions, and adjacent transpositions, without the restriction that a substring can only be edited once.To demonstrate the difference between those two algorithms consider the following example. Suppose that we want to compare the string CA with the string ABC. Let’s see how this would be performed using the two different implementations.Unrestricted Damerau-Levenshtein:The unrestricted Damerau-Levenshtein algorithm allows characters or substrings to be involved in multiple edit operations so we can do the folowing:Transpose the adjacent characters: CA → ACInsert B between A and C: AC → ABCTherefore, the unrestricted Damerau-Levenshtein distance is 2.Optimal String Alignment (OSA) Distance:The OSA algorithm does not allow the same substring to be edited more than once. In our example, although we can initially transpose CA into AC, we cannot then insert B to obtain ABC, because this would involve editing a substring that has already been modified by the transposition. Consequently, we need three operations:Delete C: CA → AInsert B: A → ABInsert C: AB → ABCTherefore, the OSA distance is 3.So why does the difference between those two variations matter you may ask? Well in mathematics there is something called triangle inequality which states that the direct distance between two points cannot be greater than the sum of the distances through an intermediate point.Triangle inequalityIn other words, transforming A into C directly should never require more operations
19a7c265665f9416a5c3d6f2bc1f6b1d3bb48b52befeb4f24330c03c21d55827Network indicators are visibly defanged. This page does not make them clickable or send them to another service.
No validated file hashes or network indicators are stored for this record.
This record contains metadata and attribution only. It does not host, download, unpack, render, or execute malware samples.
Sources represented on this page. Publication and observation dates describe the content; successful batch dates describe local collection. A recent batch does not certify complete coverage or current provider availability.
1 sources: 0 stale, 0 needing attention, 0 paused, 0 unverified.
Stale means older than twice the recorded collection interval, with a minimum of one hour; without an interval, the threshold is 24 hours. Cached content remains available while a feed is stale, paused, or unverified.