External inverse pattern matching

  • Leszek Gasieniec
  • Piotr Indyk
  • Piotr Krysta
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1264)


In this paper we consider the external inverse pattern matching problem. Given a text T of length n over an ordered alphabet Σ and a number mn, the goal is to find a pattern \(\mathop {\mathcal{P}_{MAX} }\limits^ \sim\)Σ m which is not a subword of T and which maximizes the sum of Hamming distances between \(\mathop {\mathcal{P}_{MAX} }\limits^ \sim\) and all subwords of T of length m. We present an optimal O(n log σ)-time (where σ=∣Σ∣) algorithm for the external inverse pattern matching problem. This substantially improves the O(nm log σ)-time algorithm given in [2]. Moreover we discuss briefly fast parallel implementation of our algorithm on the CREW PRAM model.


Range Query Suffix Tree Lower Common Ancestor Internal Case Consecutive Window 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    K. Abrahamson, Generalized String Matching, SIAM Journal on Computing, 16(6):1039–1051, 1987.Google Scholar
  2. 2.
    Amihood Amir, Alberto Apostolico and Moshe Lewenstein, Inverse Pattern Matching, Manuscript, to appear in Journal of Algorithms.Google Scholar
  3. 3.
    A. Apostolico, C. Ilioppoulos, G.M. Landau, B. Schieber and U. Vishkin, Parallel construction of a suffix tree with applications, Algorithmica, 3:347–365, 1988.Google Scholar
  4. 4.
    R. Cole, Parallel merge sort, SIAM, J. Computing, 4(1988), pp 770–785.Google Scholar
  5. 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. 6.
    E. Fredkin, Trie Memory, Communications of the ACM, 3:490–499, 1962.Google Scholar
  7. 7.
    H.N. Gabow, J.L. Bentley and R.E. Tarjan, Scaling and related techniques for geometry problems, In Proceedings of 16th ACM Symposium on Theory of Computing (STOC), pp. 135–143, 1984.Google Scholar
  8. 8.
    A. Gibbons and W. Rytter, Efficient Parallel Algorithms, Cambridge University Press, 1988.Google Scholar
  9. 9.
    R.W. Hamming, Error detecting and error correcting codes, Bell. Sys. Tech. Journal, 26(2): 147–160, 1950.Google Scholar
  10. 10.
    D. Harel and R.E. Tarjan, Fast algorithms for finding nearest common ancestors, SIAM Journal on Computing, 13:338–355, 1984.Google Scholar
  11. 11.
    H. Karloff, Fast algorithms for approximately counting mismatches, Information Processing Letters, 48(2):53–60, 1993.Google Scholar
  12. 12.
    D.E. Knuth, J.H. Morris, and V.B. Pratt, Fast pattern matching in strings, SIAM J. Comput. 6 (1977), 323–350.Google Scholar
  13. 13.
    B. Schieber and U. Vishkin, On finding lower common ancestors: simplification and parallelization, In Proceedings of 3rd Aegean Workshop on VLSI Algorithms and Architecture, LNCS 319:111–123, 1988.Google Scholar
  14. 14.
    P. Weiner, Linear pattern matching algorithms, In Proceedings of 14th IEEE Symposium on Foundations of Computer Science (FOCS), pp. 1–11, 1973.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1997

Authors and Affiliations

  • Leszek Gasieniec
    • 1
  • Piotr Indyk
    • 2
  • Piotr Krysta
    • 3
  1. 1.Max-Planck Institut für Informatik, Im StadtwaldSaarbrückenGermany
  2. 2.Computer Science DepartmentStanford UniversityGates BuildingUSA
  3. 3.Institute of Computer ScienceUniversity of WrocławWrocklawPoland

Personalised recommendations