Skip to main content
Log in

Detecting False Matches in String-Matching Algorithms

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract.

Consider a text string of length n, a pattern string of length m, and a match vector of length n which declares each location in the text to be either a mismatch (the pattern does not occur beginning at that location in the text) or a potential match (the pattern may occur beginning at that location in the text). Some of the potential matches could be false, i.e., the pattern may not occur beginning at some location in the text declared to be a potential match. We investigate the complexity of two problems in this context, namely, checking if there is any false match, and identifying all the false matches in the match vector.

We present an algorithm on the CRCW PRAM that checks if there exists a false match in O(1) time using O(n) processors. This algorithm does not require preprocessing the pattern. Therefore, checking for false matches is provably simpler than string matching since string matching takes \(\Omega(\log\log m)\) time on the CRCW PRAM. We use this simple algorithm to convert the Karp—Rabin Monte Carlo type string-matching algorithm into a Las Vegas type algorithm without asymptotic loss in complexity. We also present an efficient algorithm for identifying all the false matches and, as a consequence, show that string-matching algorithms take \(\Omega(\log\log m)\) time even given the flexibility to output a few false matches.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

Author information

Authors and Affiliations

Authors

Additional information

Received January 28, 1995; revised January 17, 1996.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Muthukrishnan, S. Detecting False Matches in String-Matching Algorithms . Algorithmica 18, 512–520 (1997). https://doi.org/10.1007/PL00009168

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1007/PL00009168

Navigation