FFT-based algorithms for the string matching with mismatches problem

  • Authors:
  • Tor Schoenmeyr;David Yu Zhang

  • Affiliations:
  • California Institute of Technology;California Institute of Technology

  • Venue:
  • Journal of Algorithms
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

The string matching with mismatches problem requires finding the Hamming distance between a pattern P of length m and every length m substring of text T with length n. Fischer and Paterson's FFT-based algorithm solves the problem without error in O(σn log m), where σ is the size of the alphabet Σ [SIAM-AMS Proc. 7 (1973) 113-125]. However, this in the worst case reduces to O(nm logm). Atallah, Chyzak and Dumas used the idea of randomly mapping the letters of the alphabet to complex roots of unity to estimate the score vector in time O (n log m) [Algorithmica 29 (2001) 468-486]. We show that the algorithm's score variance can be substantially lowered by using a bijective mapping, and specifically to zero in the case of binary and ternary alphabets. This result is extended via alphabet remappings to deterministically solve the string matching with mismatches problem with a constant factor of 2 improvement over Fischer-Paterson's method.