Tighter upper bounds on the exact complexity of string matching

Richard Cole, Ramesh Hariharan

Research output: Contribution to journalArticle

Abstract

This paper considers how many character comparisons are needed to find all occurrences of a pattern of length m in a text of length n. The main contribution is to show an upper bound of the form of n + O(n/m) character comparisons, following preprocessing. Specifically, we show an upper bound of n + 8/3(m+1)(n - m) character comparisons. This bound is achieved by an online algorithm which performs O(n) work in total and requires O(m) space and O(m 2) time for preprocessing. The current best lower bound for online algorithms is n + 16/7m+27(n - m) character comparisons for m = 16k + 19, for any integer k ≥ 1, and for general algorithms is n + 2/m+3 (n - m) character comparisons, for m = 2k + 1, for any integer k ≥ 1.

Original languageEnglish (US)
Pages (from-to)803-856
Number of pages54
JournalSIAM Journal on Computing
Volume26
Issue number3
StatePublished - Jun 1997

Fingerprint

String Matching
Upper bound
Online Algorithms
Preprocessing
Integer
Character
Lower bound

Keywords

  • Comparisons
  • Exact complexity
  • Periodicity
  • String matching

ASJC Scopus subject areas

  • Theoretical Computer Science
  • Computational Theory and Mathematics
  • Applied Mathematics

Cite this

Tighter upper bounds on the exact complexity of string matching. / Cole, Richard; Hariharan, Ramesh.

In: SIAM Journal on Computing, Vol. 26, No. 3, 06.1997, p. 803-856.

Research output: Contribution to journalArticle

@article{12bcf6d7c13a402b9e84f8a6f55879ce,
title = "Tighter upper bounds on the exact complexity of string matching",
abstract = "This paper considers how many character comparisons are needed to find all occurrences of a pattern of length m in a text of length n. The main contribution is to show an upper bound of the form of n + O(n/m) character comparisons, following preprocessing. Specifically, we show an upper bound of n + 8/3(m+1)(n - m) character comparisons. This bound is achieved by an online algorithm which performs O(n) work in total and requires O(m) space and O(m 2) time for preprocessing. The current best lower bound for online algorithms is n + 16/7m+27(n - m) character comparisons for m = 16k + 19, for any integer k ≥ 1, and for general algorithms is n + 2/m+3 (n - m) character comparisons, for m = 2k + 1, for any integer k ≥ 1.",
keywords = "Comparisons, Exact complexity, Periodicity, String matching",
author = "Richard Cole and Ramesh Hariharan",
year = "1997",
month = "6",
language = "English (US)",
volume = "26",
pages = "803--856",
journal = "SIAM Journal on Computing",
issn = "0097-5397",
publisher = "Society for Industrial and Applied Mathematics Publications",
number = "3",

}

TY - JOUR

T1 - Tighter upper bounds on the exact complexity of string matching

AU - Cole, Richard

AU - Hariharan, Ramesh

PY - 1997/6

Y1 - 1997/6

N2 - This paper considers how many character comparisons are needed to find all occurrences of a pattern of length m in a text of length n. The main contribution is to show an upper bound of the form of n + O(n/m) character comparisons, following preprocessing. Specifically, we show an upper bound of n + 8/3(m+1)(n - m) character comparisons. This bound is achieved by an online algorithm which performs O(n) work in total and requires O(m) space and O(m 2) time for preprocessing. The current best lower bound for online algorithms is n + 16/7m+27(n - m) character comparisons for m = 16k + 19, for any integer k ≥ 1, and for general algorithms is n + 2/m+3 (n - m) character comparisons, for m = 2k + 1, for any integer k ≥ 1.

AB - This paper considers how many character comparisons are needed to find all occurrences of a pattern of length m in a text of length n. The main contribution is to show an upper bound of the form of n + O(n/m) character comparisons, following preprocessing. Specifically, we show an upper bound of n + 8/3(m+1)(n - m) character comparisons. This bound is achieved by an online algorithm which performs O(n) work in total and requires O(m) space and O(m 2) time for preprocessing. The current best lower bound for online algorithms is n + 16/7m+27(n - m) character comparisons for m = 16k + 19, for any integer k ≥ 1, and for general algorithms is n + 2/m+3 (n - m) character comparisons, for m = 2k + 1, for any integer k ≥ 1.

KW - Comparisons

KW - Exact complexity

KW - Periodicity

KW - String matching

UR - http://www.scopus.com/inward/record.url?scp=4043113631&partnerID=8YFLogxK

UR - http://www.scopus.com/inward/citedby.url?scp=4043113631&partnerID=8YFLogxK

M3 - Article

AN - SCOPUS:4043113631

VL - 26

SP - 803

EP - 856

JO - SIAM Journal on Computing

JF - SIAM Journal on Computing

SN - 0097-5397

IS - 3

ER -