Skip to main content

Adaptive Computation of the Swap-Insert Correction Distance

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 9309))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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)

    Article  MathSciNet  MATH  Google Scholar 

  2. Barbay, J., Pérez-Lantero, P.: Adaptive computation of the Swap-Insert Edition Distance. arXiv preprint arXiv:1504.07298 (2015)

  3. Cormen, T.H., Leiserson, C.E., Rivest, R. L., Stein, C.: Introduction to Algorithms, 3rd edn. The MIT Press (2009)

    Google Scholar 

  4. Meister, Daniel: Using swaps and deletes to make strings match. Theoretical Computer Science (TCS) 562, 606–620 (2015)

    Article  MathSciNet  MATH  Google Scholar 

  5. Spreen, T.D.: The Binary String-to-String Correction Problem. Master’s thesis, University of Victoria, Canada (2013)

    Google Scholar 

  6. 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)

    Google Scholar 

  7. Wagner, R.A., Fischer, M.J.: The String-to-String Correction Problem. Journal of the ACM (JACM) 21(1), 168–173 (1974)

    Article  MathSciNet  MATH  Google Scholar 

  8. Wagner, R.A., Lowrance, R.: An extension of the String-to-String Correction Problem. Journal of the ACM (JACM) 22(2), 177–183 (1975)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Jérémy Barbay or Pablo Pérez-Lantero .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics