Alternative Algorithms for Bit-Parallel String Matching

  • Hannu Peltola
  • Jorma Tarhio
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2857)


We consider bit-parallel algorithms of Boyer-Moore type for exact string matching. We introduce a two-way modification of the BNDM algorithm. If the text character aligned with the end of the pattern is a mismatch, we continue by examining text characters after the alignment. Besides this two-way variation, we present a simplified version of BNDM without prefix search and an algorithm scheme for long patterns. We also study a different bit-parallel algorithm, which keeps the history of examined characters in a bit-vector and where shifting is based on this bit-vector. We report experiments where we compared the new algorithms with existing ones. The simplified BNDM is the most promising of the new algorithms in practice.


String Match English Text Alternative Algorithm Text Character Zero Padding 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Arndt, J.: Jörgs useful and ugly BIT WIZARDRY page,
  2. 2.
    Boyer, R.S., Moore, J.S.: A Fast String Searching Algorithm. Communications of the ACM 20(10), 762–772 (1977)CrossRefGoogle Scholar
  3. 3.
    Crochemore, M., Rytter, W.: Text algorithms. Oxford University Press, Oxford (1994)zbMATHGoogle Scholar
  4. 4.
    Galil, Z.: On Improving the Worst Case Running Time of the Boyer–Moore String Matching Algorithm. Communications of the ACM 22(9), 505–508 (1979)CrossRefMathSciNetzbMATHGoogle Scholar
  5. 5.
    Horspool, R.N.: Practical Fast Searching in Strings. Software — Practice and Experience 10(6), 501–506 (1980)CrossRefGoogle Scholar
  6. 6.
    Hume, A., Sunday, D.: Fast String Searching. Software — Practice and Experience 21(11), 1221–1248 (1991)CrossRefGoogle Scholar
  7. 7.
    Kytöjoki, J., Salmela, L., Tarhio, J.: Tuning string matching for huge pattern sets. In: Baeza-Yates, R., Chávez, E., Crochemore, M. (eds.) CPM 2003. LNCS, vol. 2676, pp. 211–224. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  8. 8.
    Navarro, G., Raffinot, M.: A Bit-parallel Approach to Suffix Automata: Fast Extended String Matching. In: Farach-Colton, M. (ed.) CPM 1998. LNCS, vol. 1448, pp. 14–33. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  9. 9.
    Navarro, G., Raffinot, M.: Fast and Flexible String Matching by Combining Bitparallelism and Suffix automata. ACM Journal of Experimental Algorithms 5(4), 1–36 (2000)MathSciNetGoogle Scholar
  10. 10.
    Sunday, D.M.: A Very Fast Substring Search Algorithm. Communications of the ACM 33(8), 132–142 (1990)CrossRefGoogle Scholar
  11. 11.
    Tarhio, J., Peltola, H.: String Matching in the DNA Alphabet. Software — Practice and Experience 27(7), 851–861 (1997)CrossRefGoogle Scholar
  12. 12.
    Vishkin, U.: Deterministic Sampling—a New Technique for Fast Pattern Matching. SIAM Journal of Computing 20(1), 22–40 (1991)CrossRefMathSciNetzbMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2003

Authors and Affiliations

  • Hannu Peltola
    • 1
  • Jorma Tarhio
    • 1
  1. 1.Department of Computer Science and EngineeringHelsinki University of TechnologyFinland

Personalised recommendations