A Bit-Parallel Exact String Matching Algorithm for Small Alphabet

  • Authors:
  • Guomin Zhang;En Zhu;Ling Mao;Ming Yin

  • Affiliations:
  • School of Computer Science, National University of Defense Technology, Changsha, China 410073;School of Computer Science, National University of Defense Technology, Changsha, China 410073;School of Electronic Science and Engineering, National University of Defense Technology, Changsha, China 410073;School of Software, Tsinghua University, Beijing, China 100084

  • Venue:
  • FAW '09 Proceedings of the 3d International Workshop on Frontiers in Algorithmics
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

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.