A new model to solve the swap matching problem and efficient algorithms for short patterns

  • Authors:
  • Costas S. Iliopoulos;M. Sohel Rahman

  • Affiliations:
  • Algorithm Design Group, Department of Computer Science, King's College London, Strand, London, England;Algorithm Design Group, Department of Computer Science, King's College London, Strand, London, England

  • Venue:
  • SOFSEM'08 Proceedings of the 34th conference on Current trends in theory and practice of computer science
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

In this paper, we revisit the much studied problem of Pattern matching with Swaps (Swap Matching problem, for short). We first present a new graph-theoretic approach to model the problem, which opens a new and so far unexplored avenue to solve the problem. Then, using the model, we devise an efficient algorithm to solve the swap matching problem. The resulting algorithm is an adaptation of the classic shiftor algorithm. For patterns having length similar to the word-size of the target machine, the algorithm runs in O(n log m) time, where n and m are the length of the text and the pattern respectively.