2000 character limit reached
A fast implementation of the good-suffix array for the Boyer-Moore string matching algorithm (2402.16469v1)
Published 26 Feb 2024 in cs.DS
Abstract: String matching is the problem of finding all the occurrences of a pattern in a text. It has been intensively studied and the Boyer-Moore string matching algorithm is probably one of the most famous solution to this problem. This algorithm uses two precomputed shift tables called the good-suffix table and the bad-character table. The good-suffix table is tricky to compute in linear time. Text book solutions perform redundant operations. Here we present a fast implementation for this good-suffix table based on a tight analysis of the pattern. Experimental results show two versions of this new implementation are the fastest in almost all tested situations.
- A. Apostolico and R. Giancarlo. The Boyer–Moore–Galil string searching strategies revisited. SIAM J. Comput., 15(1):98–105, 1986.
- A fast string searching algorithm. Commun. ACM, 20(10):762–772, 1977.
- C. Charras and T. Lecroq. Handbook of exact string matching algorithms. King’s College Publications, 2004.
- Algorithms on strings. Cambridge University Press, 2007.
- S. Faro and T. Lecroq. The Exact String Matching Problem: a Comprehensive Experimental Evaluation. Report arXiv:1012.2547, 2010.
- S. Faro and T. Lecroq. The exact online string matching problem: a review of the most recent results. ACM Computing Surveys, 45(2):13, 2013.
- Z. Galil. On improving the worst case running time of the Boyer–Moore string searching algorithm. Commun. ACM, 22(9):505–508, 1979.
- R. N. Horspool. Practical fast searching in strings. Software – Practice & Experience, 10(6):501–506, 1980.
- A. Hume and D. M. Sunday. Fast string searching. Software – Practice & Experience, 21(11):1221–1248, 1991.
- Fast pattern matching in strings. SIAM J. Comput., 6(1):323–350, 1977.
- T. Lecroq. A variation on the Boyer-Moore algorithm. Theoretical Computer Science, 92(1):119–144, 1992.
- W. Rytter. A correct preprocessing algorithm for Boyer–Moore string searching. SIAM J. Comput., 9(3):509–512, 1980.