Fast and linear-time string matching algorithms based on the distances of q-gram occurrences

arXiv:2002.08004 First posted 2020-02-19 v2 14 pages, accepted to SEA 2020
Cite this paper ×
BibTeX
@misc{kobayashi2020fast,
  title = {Fast and linear-time string matching algorithms based on the distances of q-gram occurrences},
  author = {Satoshi Kobayashi and Diptarama Hendrian and Ryo Yoshinaka and Ayumi Shinohara},
  year = {2020},
  eprint = {2002.08004},
  archivePrefix = {arXiv},
  primaryClass = {cs.DS},
  url = {https://arxiv.org/abs/2002.08004}
}
APA 7
Kobayashi, S., Hendrian, D., Yoshinaka, R., & Shinohara, A. (2020). Fast and linear-time string matching algorithms based on the distances of q-gram occurrences [Preprint]. arXiv. https://doi.org/10.48550/arXiv.2002.08004
GB/T 7714
KOBAYASHI S, HENDRIAN D, YOSHINAKA R, et al. Fast and linear-time string matching algorithms based on the distances of q-gram occurrences[EB/OL]. (2020-02-19)[2026-11-30]. https://arxiv.org/abs/2002.08004.

Abstract

Given a text T of length n and a pattern P of length m, the string matching problem is a task to find all occurrences of P in T. In this study, we propose an algorithm that solves this problem in O((n + m)q) time considering the distance between two adjacent occurrences of the same q-gram contained in P. We also propose a theoretical improvement of it which runs in O(n + m) time, though it is not necessarily faster in practice. We compare the execution times of our and existing algorithms on various kinds of real and artificial datasets such as an English text, a genome sequence and a Fibonacci string. The experimental results show that our algorithm is as fast as the state-of-the-art algorithms in many cases, particularly when a pattern frequently appears in a text.

Post #1 · the paper

Discussion

No comments yet. Start the discussion!