Skip to main content

A Bit-Parallel Exact String Matching Algorithm for Small Alphabet

  • Conference paper
Frontiers in Algorithmics (FAW 2009)

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

Included in the following conference series:

Abstract

This paper concentrates on the problem of finding all the occurrences of a pattern in a text. A novel bit-parallel exact string matching algorithm for small alphabet (SABP) is proposed based on a position related character matching table, which is deduced according to the matching matrix of the pattern and the text. A 2-base logarithm table consisting of 216 items is employed to locate the leftmost “1” bit of an unsigned integer flag, which indicates a latest probable occurrence of the pattern in the text. Safe shifts are obtained through combining the 2-base logarithm table value of current flag and the bad character shift which is adopted in Boyer-Moore algorithm. Our algorithm suits to the situation that the pattern length is more than the word size of a computer. Experimental results on random generated texts show that it is the fastest in many cases, particularly, on long patterns with a small alphabet.

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. Charras, C., Lecroq, T.: Exact string matching algorithms. King’s College Publications (2004)

    Google Scholar 

  2. Knuth, D.E., Morris, J., Pratt, V.: Fast pattern matching in strings. SIAM Journal on Computing 6, 323–350 (1977)

    Article  MathSciNet  MATH  Google Scholar 

  3. Baeza-Yates, R., Gonnet, G.: A new approach to text searching. Communications of the ACM 35, 74–82 (1992)

    Article  Google Scholar 

  4. Boyer, R., Moore, S.: A fast string searching algorithm. Communications of the ACM 20, 762–772 (1977)

    Article  MATH  Google Scholar 

  5. Horspool, R.N.: Practical fast searching in strings. Software Practice and Experience 10, 501–506 (1980)

    Article  Google Scholar 

  6. Crochemore, M., Czumaj, A., Gąsieniec, L., Jarominek, S., Lecroq, T., Plandowski, W., Rytter, W.: Speeding up two string-matching algorithms. Algorithmica 12, 247–267 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  7. Navarro, G., Raffinot, M.: Fast and flexible string matching by combining bit-parallelism and suffix automata. ACM Journal of Experimental Algorithmics 5 (2000), http://www.jea.acm.org/2000/NavarroString

  8. Ďurian, B., Holub, J., Peltola, H., Tarhio, J.: Tuning BNDM with q-Grams. In: Proc. ALENEX 2009, Tenth Workshop on Algorithm Engineering and Experiments. SIAM 2009, pp. 29–37 (2009)

    Google Scholar 

  9. Allauzen, C., Crochemore, M., Raffinot, M.: Efficient experimental string matching by weak factor recognition. In: Amir, A., Landau, G.M. (eds.) CPM 2001. LNCS, vol. 2089, pp. 51–72. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  10. Faro, S., Lecroq, T.: Efficient Variants of the Backward-Oracle-Matching Algorithm. In: Prague Stringology Conference 2008, pp. 146–160 (2008)

    Google Scholar 

  11. Karp, R.M., Rabin, M.O.: Efficient randomized pattern-matching algorithms. IBM J. Res. Dev. 31, 249–260 (1987)

    Article  MathSciNet  MATH  Google Scholar 

  12. Lecroq, T.: Fast exact string matching algorithms. Information Processing Letters 102, 229–235 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  13. Fredriksson, K.: Shift-or string matching with super-alphabets. Information Processing Letters 87, 201–204 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  14. Fredriksson, K., Grabowski, S.: Practical and optimal string matching. In: Consens, M.P., Navarro, G. (eds.) SPIRE 2005. LNCS, vol. 3772, pp. 376–387. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  15. Prasad, R., Agarwal, S.: A new parameterized string matching algorithm by combining bit-parallelism and suffix automata. In: Institute of Electrical and Electronics Engineers Computer Society, Piscataway, NJ 08855-1331, United States, pp. 778–783 (2008)

    Google Scholar 

  16. Külekci, M.O.: TÜBİTAK-UEKAE: A Method to Overcome Computer Word Size Limitation in Bit-Parallel Pattern Matching. In: Hong, S.-H., Nagamochi, H., Fukunaga, T. (eds.) ISAAC 2008. LNCS, vol. 5369, pp. 496–506. Springer, Heidelberg (2008)

    Google Scholar 

  17. Canterbury Corpus Database (2009), http://corpus.canterbury.ac.nz/descriptions/

  18. Navarro, G., Raffinot, M.: String Matching. Flexible Pattern Matching in Strings: Practical On-line Search Algorithms for Texts and Biological Sequences. Cambridge University Press, Cambridge (2002)

    Book  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Zhang, G., Zhu, E., Mao, L., Yin, M. (2009). A Bit-Parallel Exact String Matching Algorithm for Small Alphabet. In: Deng, X., Hopcroft, J.E., Xue, J. (eds) Frontiers in Algorithmics. FAW 2009. Lecture Notes in Computer Science, vol 5598. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-02270-8_34

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-02270-8_34

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-02269-2

  • Online ISBN: 978-3-642-02270-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics