Abstract
The Swap-Insert Correction distance from a string S of length n to another string L of length \(m\ge n\) on the alphabet [1..d] is the minimum number of insertions, and swaps of pairs of adjacent symbols, converting S into L. Contrarily to other correction distances, computing it is NP-Hard in the size d of the alphabet. We describe an algorithm computing this distance in time within \(O(d^2 nm g^{d-1})\), where there are \(n_\alpha \) occurrences of \(\alpha \) in S, \(m_\alpha \) occurrences of \(\alpha \) in L, and where \(g=\max _{\alpha \in [1..d]} \min \{n_\alpha ,m_\alpha -n_\alpha \}\) measures the difficulty of the instance. The difficulty g is bounded by above by various terms, such as the length of the shortest string S, and by the maximum number of occurrences of a single character in S. The latter bound yields a running time within \(O(d(n+m)+(d/(d-1)^{d-2})\cdot n^{d}(m-n))\) in the worst case over instances of fixed lengths n and m for S and L, which further simplifies to within \(O(n^d(m-n)+m)\) when d is fixed, the state of the art for this problem. This illustrates how, in many cases, the correction distance between two strings can be easier to compute than in the worst case scenario.
J. Barbay and P. Pérez-Lantero—Partially supported by Millennium Nucleus Information and Coordination in Networks ICM/FIC RC130003.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Abu-Khzam, F.N., Fernau, H., Langston, M.A., Lee-Cultura, S., Stege, U.: Charge and reduce: A fixed-parameter algorithm for String-to-String Correction. Discrete Optimization (DO) 8(1), 41–49 (2011)
Barbay, J., Pérez-Lantero, P.: Adaptive computation of the Swap-Insert Edition Distance. arXiv preprint arXiv:1504.07298 (2015)
Cormen, T.H., Leiserson, C.E., Rivest, R. L., Stein, C.: Introduction to Algorithms, 3rd edn. The MIT Press (2009)
Meister, Daniel: Using swaps and deletes to make strings match. Theoretical Computer Science (TCS) 562, 606–620 (2015)
Spreen, T.D.: The Binary String-to-String Correction Problem. Master’s thesis, University of Victoria, Canada (2013)
Wagner, R.A.: On the complexity of the extended String-to-String Correction Problem. In: Proceedings of the Seventh Annual ACM Symposium on Theory Of Computing (STOC), pp. 218–223. ACM (1975)
Wagner, R.A., Fischer, M.J.: The String-to-String Correction Problem. Journal of the ACM (JACM) 21(1), 168–173 (1974)
Wagner, R.A., Lowrance, R.: An extension of the String-to-String Correction Problem. Journal of the ACM (JACM) 22(2), 177–183 (1975)
Author information
Authors and Affiliations
Corresponding authors
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer International Publishing Switzerland
About this paper
Cite this paper
Barbay, J., Pérez-Lantero, P. (2015). Adaptive Computation of the Swap-Insert Correction Distance. In: Iliopoulos, C., Puglisi, S., Yilmaz, E. (eds) String Processing and Information Retrieval. SPIRE 2015. Lecture Notes in Computer Science(), vol 9309. Springer, Cham. https://doi.org/10.1007/978-3-319-23826-5_3
Download citation
DOI: https://doi.org/10.1007/978-3-319-23826-5_3
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-23825-8
Online ISBN: 978-3-319-23826-5
eBook Packages: Computer ScienceComputer Science (R0)