The Max-Shift Algorithm for Approximate String Matching

  • Authors:
  • Costas S. Iliopoulos;Laurent Mouchard;Yoan J. Pinzon

  • Affiliations:
  • -;-;-

  • Venue:
  • WAE '01 Proceedings of the 5th International Workshop on Algorithm Engineering
  • Year:
  • 2001

Quantified Score

Hi-index 0.01

Visualization

Abstract

The approximate string matching problem is to find all locations which a pattern of length m matches a substring of a text of length n with at most k differences. The program agrep is a simple and practical bit-vector algorithm for this problem. In this paper we consider the following incremental version of the problem: given an appropriate encoding of a comparison between A and bB, can one compute the answer for A and B, and the answer for A and Bc with equal efficiency, where b and c are additional symbols? Here we present an elegant and veryeasy to implement bit-vector algorithm for answering these questions that requires only O(n⌈m/w⌉) time, where n is the length of A, m is the length of B and w is the number of bits in a machine word. We also present an O(nm⌈h/w⌉) algorithm for the fixed-length approximate string matching problem: given a text t, a pattern p and an integer h, compute the optimal alignment of all substrings of p of length h and a substring of t.