English

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

Data Structures and Algorithms 2020-04-14 v2

Abstract

Given a text TT of length nn and a pattern PP of length mm, the string matching problem is a task to find all occurrences of PP in TT. In this study, we propose an algorithm that solves this problem in O((n+m)q)O((n + m)q) time considering the distance between two adjacent occurrences of the same qq-gram contained in PP. We also propose a theoretical improvement of it which runs in O(n+m)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.

Keywords

Cite

@article{arxiv.2002.08004,
  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},
  journal= {arXiv preprint arXiv:2002.08004},
  year   = {2020}
}

Comments

14 pages, accepted to SEA 2020