Set Intersection and Sequence Matching with mismatch counting

Ariel Shiftan, Ely Porat

Research output: Contribution to journalArticlepeer-review

1 Scopus citations

Abstract

In the classical pattern-matching problem, one is given a text and a pattern both of which are sequences of letters. The requirement is to find all occurrences of the pattern in the text. We studied two modifications of the classical problem, where each letter in the text and pattern is a set (Set Intersection Matching problem) or a sequence (Sequence Matching problem). Two "letters" are found to match if the intersection of the corresponding sets is not empty or if the two sequences have a common element in the same index. We first show that the two problems are similar by establishing a linear time reduction between them. We then show the first known non-trivial and efficient algorithms for these problems, when the maximum set/sequence size d is small. The first is a Monte Carlo randomized algorithm for Set Intersection Matching, that takes Θ(4dnlog nlog m) time, where n and m are the lengths of the text and the pattern, respectively; the failure probability is less than 1n2. This algorithm can also be used, with slight modifications, when up to k mismatches is allowed. In addition, it can be used to maintain an approximation of factor 1 ± ε of the mismatch count in Θ(1ε24dnlog nlog m) time; the failure probability is bounded by 1n. The second is a deterministic algorithm for Set Intersection Matching that can be used to count the number of matches at each index of the text in a total running time Θ(∑i=1d(σi)nlog m)=O(σdnlog m), where σ is the size of the alphabet. The third algorithm, also deterministic, solves the Sequence Matching problem in Θ(4dnlog m) time.

Original languageEnglish
Pages (from-to)3-10
Number of pages8
JournalTheoretical Computer Science
Volume638
DOIs
StatePublished - 25 Jul 2016

Bibliographical note

Publisher Copyright:
© 2016 Elsevier B.V.

Keywords

  • Generalized strings
  • Pattern matching
  • Sequence Matching
  • Set Intersection Matching

Fingerprint

Dive into the research topics of 'Set Intersection and Sequence Matching with mismatch counting'. Together they form a unique fingerprint.

Cite this