skip to main content
article

Dynamic text and static pattern matching

Authors Info & Claims
Published:01 May 2007Publication History
Skip Abstract Section

Abstract

In this article, we address a new version of dynamic pattern matching. The dynamic text and static pattern matching problem is the problem of finding a static pattern in a text that is continuously being updated. The goal is to report all new occurrences of the pattern in the text after each text update. We present an algorithm for solving the problem where the text update operation is changing the symbol value of a text location. Given a text of length n and a pattern of length m, our algorithm preprocesses the text in time O(n log log m), and the pattern in time O(m log m). The extra space used is O(n + m log m). Following each text update, the algorithm deletes all prior occurrences of the pattern that no longer match, and reports all new occurrences of the pattern in the text in O(log log m) time. We note that the complexity is not proportional to the number of pattern occurrences, since all new occurrences can be reported in a succinct form.

References

  1. Alon, N., and Naor, M. 1996. Derandomization, witnesses for boolean matrix multiplication and construction of perfect hash functions. Algorithmica 16, 4-5, 434--449.Google ScholarGoogle ScholarCross RefCross Ref
  2. Alstrup, S., Brodal, G. S., and Rauhe, T. 2000. Pattern matching in dynamic texts. In Proceedings of the 11th ACM-SIAM Symposium on Discrete Algorithms (SODA). SIAM, 819--828. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Beame, P., and Fich, F. E. 2002. Optimal bounds for the predecessor problem and related problems. J. Comput. Syst. Sci. 65, 1, 38--72. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Berkman, O., and Vishkin, U. 1994. Finding level-ancestors in trees. J. Comput. Syst. Sci. 48, 2, 214--229. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Buchsbaum, A. L. 2006. Personal communication.Google ScholarGoogle Scholar
  6. Buchsbaum, A. L., Goodrich, M. T., and Westbrook, J. 2000. Range searching over tree cross products. In Proceedings of the 8th Annual European Symposium on Algorithms (ESA). Springer Verlag, Berlin. 120--131. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Cole, R., and Harihan, R. 1997. Tighter bounds on the exact complexity of string matching. SIAM J. Comput. 26, 3, 803--856. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Farach, M. 1997. Optimal suffix tree construction with large alphabets. In Proceedings of the 38th IEEE Symposium on Foundations of Computer Science (FOCS). 137--143. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Farach, M., and Muthukrishnan, S. 1996. Perfect hashing for strings: Formalization and algorithms. In Proceedings of the 7th Symposium on Combinatorial Pattern Matching (CPM). Springer Verlag, Berlin. 130--140. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Ferragina, P., and Grossi, R. 1995. Fast incremental text editing. In Proceedings of the 7th ACM-SIAM Symposium on Discrete Algorithms (SODA). 531--540. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Gabow, H. N., Bentley, J. L., and Tarjan, R. E. 1984. Scaling and related techniques for geometry problems. In Proceedings of the 16th ACM Symposium on Theory of Computing (STOC), vol. 67. 135--143. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Gu, M., Farach, M., and Beigel, R. 1994. An efficient algorithm for dynamic text indexing. In Proceedings of the 5th ACM-SIAM Symposium on Discrete Algorithms (SODA). 697--704. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Hagerup, T., Miltersen, P. B., and Pagh, R. 2001. Deterministic dictionaries. J. Alg. 41, 1, 69--85. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Harel, D., and Tarjan, R. 1984. Fast algorithms for finding nearest common ancestors. SIAM J. Comput. 13, 2, 338--355. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Kärkkäinen, J., and Sanders, P. 2003. Simple linear work suffix array construction. In Proceedings of the 30th International Colloquium on Automata, Languages and Programming (ICALP). Lecture Notes in Computer Science, vol. 2719. Springer Verlag, Berlin. 943--955.Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Knuth, D., Morris, J., and Pratt, V. 1977. Fast pattern matching in strings. SIAM J. Comput. 6, 323--350.Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Landau, G. M., and Vishkin, U. 1988. Fast string matching with k differences. J. Comput. Syst. Sci. 37, 1, 63--78. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Landau, G. M., and Vishkin, U. 1994. Pattern matching in a digitized image. Algorithmica 12, 4-5, 375--408.Google ScholarGoogle ScholarCross RefCross Ref
  19. Levenshtein, V. I. 1966. Binary codes capable of correcting, deletions, insertions and reversals. Soviet Phys. Dokl. 10, 707--710.Google ScholarGoogle Scholar
  20. Lowrance, R., and Wagner, R. A. 1975. An extension of the string-to-string correction problem. J. ACM 22, 2, 177--183. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. McCreight, E. M. 1976. A space-economical suffix tree construction algorithm. J. ACM 23, 262--272. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Sahinalp, S. C., and Vishkin, U. 1996. Efficient approximate and dynamic matching of patterns using a labeling paradigm. In Proceedings of the 37th IEEE Symposium on Foundations of Computer Science (FOCS). 320--328. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Schieber, B., and Vishkin, U. 1988. On finding lowest common ancestors: Simplification and parallelization. SIAM J. Comput. 17, 6, 1253--1262. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Smith, T., and Waterman, M. 1981. Identification of common molecular subsequences. J. Mol. Biol. 147, 195--197.Google ScholarGoogle ScholarCross RefCross Ref
  25. Ukkonen, E. 1995. On-Line construction of suffix trees. Algorithmica 14, 249--260.Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. van Emde Boas, P. 1974. An O(n log log n) online algorithm for the insert-extract min problem. Tech. Rep. TR 74-221, Cornell University, Department of Computer Science. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Weiner, P. 1973. Linear pattern matching algorithm. In Proceedings of the 14th IEEE Symposium on Switching and Automata Theory. 1--11.Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Willard, D. E. 1983. Log-Logarithmic worst-case range queries are possible in space Theta(n). Inf. Process. Lett. 17, 2, 81--84.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Dynamic text and static pattern matching

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM Transactions on Algorithms
        ACM Transactions on Algorithms  Volume 3, Issue 2
        May 2007
        338 pages
        ISSN:1549-6325
        EISSN:1549-6333
        DOI:10.1145/1240233
        Issue’s Table of Contents

        Copyright © 2007 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 1 May 2007
        Published in talg Volume 3, Issue 2

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader