Skip to main content

Efficient special cases of pattern matching with swaps

  • Session V
  • Conference paper
  • First Online:
  • 122 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1448))

Abstract

Let a text string of n symbols and a pattern string P of m symbols from alphabet Σ be given. A swapped version T′ of T is a length n string derived from T by a series of local swaps, (i.e. t t ℓ+1 and t ℓ+1 t ) where each element can participate in no more than one swap.

The Pattern Matching with Swaps problem is that of finding all locations i for which there exists a swapped version T′ of T where there is an exact matching of P in location i of T′.

It was recently shown that the Pattern Matching with Swaps problem has a solution in time O(nm 1/3 log m log2 σ), where σ = min(|Σ|, m). We consider some interesting special cases of patterns, namely, patterns where there is no length-one run, i.e. there are no a, b, c ∈ Σ where b # a and b # c and where the substring abc appears in the pattern. We show that for such patterns the pattern matching with swaps problem can be solved in time O(n log2 m).

Partially supported by NSF grant CCR-96-10170 and the Israel Ministry of Science and the Arts grants 6297 and 8560.

partially supported by NSF grants CCR-9305873 and CCR-9610238.

Partially supported by the Israel Ministry of Science and the Arts grant 8560.

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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. K. Abrahamson. Generalized string matching. SIAM J. Computing, 16(6):1039–1051, 1987.

    Google Scholar 

  2. A. Amir, Y. Aumann, G. Landau, M. Lewenstein, and N. Lewenstein.Pattern matching with swaps. Proc. 38th IEEE FOCS, pages 144–153, 1997.

    Google Scholar 

  3. A. Amir and M. Farach. Efficient 2-dimensional approximate matching of halfrectangular figures. Information and Computation, 118(1):1–11, April 1995.

    Google Scholar 

  4. R.S. Boyer and J.S. Moore. A fast string searching algorithm. Comm. ACM, 20:762–772, 1977.

    Google Scholar 

  5. M.J. Fischer and M.S. Paterson. String matching and other products. Complexity of Computation, R.M. Karp (editor), SIAM-AMS Proceedings, 7:113–125, 1974.

    Google Scholar 

  6. R. Karp, R. Miller, and A. Rosenberg. Rapid identification of repeated patterns in strings, arrays and trees. Symposium on the Theory of Computing, 4:125–136, 1972.

    Google Scholar 

  7. D.E. Knuth, J.H. Morris, and V.R. Pratt. Fast pattern matching in strings. SIAM J. Computing, 6:323–350, 1977.

    Google Scholar 

  8. S. Rao Kosaraju. Efficient string matching. Manuscript, 1987.

    Google Scholar 

  9. V. I. Levenshtein. Binary codes capable of correcting, deletions, insertions and reversals. Soviet Phys. Dokl., 10:707–710, 1966.

    Google Scholar 

  10. R. Lowrance and R. A. Wagner. An extension of the string-to-string correction problem. J. of the ACM, pages 177–183, 1975.

    Google Scholar 

  11. S. Muthukrishnan and H. Ramesh. String matching under a general matching relation. Information and Computation, 122(1):140–148, 1995.

    Google Scholar 

  12. A. Pentland. Invited talk. NSF Institutional Infrastructure Workshop, 1992.

    Google Scholar 

  13. R. Y. Pinter. Efficient string matching with don't care patterns. In Z. Galil A. Apostolico, editor, Combinatorial Algorithms on Words, volume 12, pages 11–29. NATO ASI Series F, 1985.

    Google Scholar 

  14. P. Weiner. Linear pattern matching algorithm. Proc. 14 IEEE Symposium on Switching and Automata Theory, pages 1–11, 1973.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Martin Farach-Colton

Rights and permissions

Reprints and permissions

Copyright information

© 1998 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Amir, A., Landau, G.M., Lewenstein, M., Lewensteint, N. (1998). Efficient special cases of pattern matching with swaps. In: Farach-Colton, M. (eds) Combinatorial Pattern Matching. CPM 1998. Lecture Notes in Computer Science, vol 1448. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0030791

Download citation

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

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-64739-3

  • Online ISBN: 978-3-540-69054-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics