Improved Time and Space Complexities for Transposition Invariant String Matching
Gonzalo Navarro, Szymon Grabowski, Sebastian Deorowicz · 2004
Given strings A = a1a2...am and B = b1b2...bn over a finite alphabet Σ ⊂ Z of size O(σ), and a distance d() defined among strings, the transposition invariant version of d() is d t (A,B) = mint∈Z d(A+t,B), where A+t = (a1+t)(a2+t)...(am+t). Distances d() of most interest are Levenshtein distance and indel distance (the dual of the Longest Common Subsequence), which can be computed in O(mn) time. Recent algorithms compute d t (A,B) in O(mn log log min(m,n)) time for those distances. In this paper we show how those complexities can be reduced to O(mn log log σ). Furthermore, we reduce the space requirements from O(mn) to O(σ 2 + min(m,n)).