Skip to main content

The Max-Shift Algorithm for Approximate String Matching

  • Conference paper
  • First Online:
Algorithm Engineering (WAE 2001)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2141))

Included in the following conference series:

Abstract

The approximate string matching problem is to find all locations which a pattern of length m matches a substring of a text of length n with at most k differences. The program agrep is a simple and practical bit-vector algorithm for this problem. In this paper we consider the following incremental version of the problem: given an appropriate encoding of a comparison between A and bB, can one compute the answer for A and B, and the answer for A and Bc with equal efficiency, where b and c are additional symbols? Here we present an elegant and very easy to implement bit-vector algorithm for answering these questions that requires only O(n⌈m/w⌉) time, where n is the length of A, m is the length of B and w is the number of bits in a machine word. We also present an O(nm⌈h/w⌉) algorithm for the fixed-length approximate string matching problem: given a text t, a pattern p and an integer h, compute the optimal alignment of all substrings of p of length h and a substring of t.

Partially supported by a Marie Curie fellowship and NATO, Wellcome and Royal Society grants.

Partially supported by the C.N.R.S. Program “Génomes”.

Partially supported by an ORS studentship and EPSRC Project GR/L92150.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. R. A. Baeza-Yates and G. H. Gonnet, A new approach to text searching, CACM, Vol 35, (1992), pp. 74–82.

    Google Scholar 

  2. R. A. Baeza-Yates and G. Navarro, A faster algorithm for approximate string matching, in Proceedings of the 7th Symposium on Combinatorial Pattern Matching, LNCS, Vol. 1075, Springer-Verlag, New York, (1996), pp. 1–23.

    Google Scholar 

  3. R. A. Baeza-Yates and G. Navarro, Analysis for algorithm engineering: Improving an algorithm for approximate pattern matching. Unpublished manuscript.

    Google Scholar 

  4. Z. Galil and K. Park, An improved algorithm for approximate string matching, SI AM Journal on Computing, 19 (1990), pp. 989–999.

    Article  MATH  MathSciNet  Google Scholar 

  5. P. A. Hall and G. R. Dowling, Approximate string matching, Computing Surveys, Vol 12, (1980), pp. 381–402.

    Article  MathSciNet  Google Scholar 

  6. J. W. Hunt and T. G. Szymanski, An algorithm for differential file comparison, Comm. of the ACM, Vol 20, (1977), pp. 350–353.

    Article  MATH  MathSciNet  Google Scholar 

  7. G. M. Landau, E. Myers and J. P. Schmidt, Incremental string comparison, SIAM Journal on Computing 27,2 (1998), 557–582.

    Article  MATH  MathSciNet  Google Scholar 

  8. G. M. Landau and U. Vishkin, Fast string matching with k differences, Journal of Computer and Systems Sciences, 37 (1988), pp. 63–78.

    Article  MATH  MathSciNet  Google Scholar 

  9. M. Maes, On a cyclic string-to-string correction problem, in Info. Proc. Lett., Vol. 35, (1990), pp. 73–78.

    Article  MATH  MathSciNet  Google Scholar 

  10. W. J. Masek and M. S. Paterson, A Fast algorithm for computing string edit distances. in J. Comput. Sy. Sci., Vol. 20, (1980), pp. 18–31.

    Article  MATH  MathSciNet  Google Scholar 

  11. E. W. Myers, A Fast Bit-Vector Algorithm for Approximate String Matching Based on Dynamic Progamming, in Journal of the ACM 46,3 (1999) pp. 395–415.

    Article  MATH  MathSciNet  Google Scholar 

  12. S. B. Needleman and C. D. Wunsch, A general method applicable to the search for similarities in the amino acid sequence of the two proteins, in J. of Mol. Bio., Vol 48 (1970), pp. 443–453.

    Article  Google Scholar 

  13. P.H. Seller, The theory and computation of evolutionary distances: Pattern recognition, in Journal of Algorithms, Vol 1, (1980), pp. 359–373.à.

    Article  MathSciNet  Google Scholar 

  14. T. F. Smith and M. S. Waterman, Identification of common molecular subsequences, in Journal of Molecular Biology, Vol 147, No. 2 (1981), pp. 195–197.

    Article  Google Scholar 

  15. E. Ukkonen, Finding approximate patterns in strings, in J. of Algorithms, Vol 6, (1985), pp. 132–137.

    Article  MATH  MathSciNet  Google Scholar 

  16. R. A. Wangner and M. J. Fischer, The string-to-string correction problem, in J. of the ACM, Vol 21, No. 1 (1974), pp. 168–173.

    Article  Google Scholar 

  17. A. H. Wright, Approximate string matching using within-word parallelism. in Soft. Pract. Exper., Vol 24, (1994), pp. 337–362.

    Article  MATH  Google Scholar 

  18. S. Wu and U. Manber, Fast text searching allowing errors, CACM, Vol 35, (1992), pp. 83–91.

    Google Scholar 

  19. S. Wu, U. Manber and G. Myers, A subquadratic algorithm for approximate limited expression matching, in Algorithmica, Vol. 15, (1996), pp. 50–67.

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2001 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Iliopoulos, C.S., Mouchard, L., Pinzon, Y.J. (2001). The Max-Shift Algorithm for Approximate String Matching. In: Brodal, G.S., Frigioni, D., Marchetti-Spaccamela, A. (eds) Algorithm Engineering. WAE 2001. Lecture Notes in Computer Science, vol 2141. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44688-5_2

Download citation

  • DOI: https://doi.org/10.1007/3-540-44688-5_2

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-42500-7

  • Online ISBN: 978-3-540-44688-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics