Skip to main content

Efficient string matching on coded texts

  • Conference paper
  • First Online:
Combinatorial Pattern Matching (CPM 1995)

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

Included in the following conference series:

Abstract

The so called “four Russians technique” is often used to speed up algorithms by encoding several data items in a single memory cell. Given a sequence of n symbols over a constant size alphabet, one can encode the sequence into O(n/λ) memory cells in O(log λ) time using n/ log λ processors.

This paper presents an efficient CRCW-PRAM string-matching algorithm for coded texts that takes O(log log(m/λ)) time 4 making only O(n/λ) operations, an improvement by a factor of λ = O(log n) on the number of operations used in previous algorithms. Using this stringmatching algorithm one can test if a string is square-free and find all palindromes in a string in O(log log n) time using n/log log n processors.

Partially supported by ESPRIT Basic Research Action Program of the EC under contract #7141 (ALCOM II). Part of the research reported in the paper was carried out while this author was visiting at the Istituto di Elaborazione dell'Informazione, Consiglio Nazionale delle Ricerche, Pisa, Italy, with the support of the European Research Consortium for Informatics and Mathematics postdoctoral fellowship.

Supported by KBN grant 2-11-90-91-01 and EC Cooperative Action IC-1000 (project ALTEC).

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

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. A. Amir, G. Benson, and M. Farach. An alphabet-independent approach to twodimensional pattern-matching. SIAM J. Comput., 23(2):313–323, 1994.

    Article  Google Scholar 

  2. A. Apostolico. On context constrained squares and repetitions in a string. R.A.I.R.O. Informatique theorique, 18(2):147–159, 1984.

    Google Scholar 

  3. A. Apostolico. Optimal Parallel Detection of Squares in Strings. Algorithmica, 8:285–319, 1992.

    Article  Google Scholar 

  4. A. Apostolico and D. Breslauer. An Optimal O(log log n) Time Parallel Algorithm for Detecting all Squares in a String. SIAM J. Comput., to appear.

    Google Scholar 

  5. A. Apostolico, D. Breslauer, and Z. Galil. Optimal Parallel Algorithms for Periods, Palindromes and Squares. In Proc. 19th International Colloquium on Automata, Languages, and Programming, number 623 in Lecture Notes in Computer Science, pages 296–307. Springer-Verlag, Berlin, Germany, 1992.

    Google Scholar 

  6. A. Apostolico, D. Breslauer, and Z. Galil. Parallel Detection of all Palindromes in a String. Theoret. Comput. Sci., to appear.

    Google Scholar 

  7. A. Apostolico and F.P. Preparata. Optimal off-line detection of repetitions in a string. Theoret. Comput. Sci., 22:297–315, 1983.

    Google Scholar 

  8. V.L. Arlazarov, E.A. Dinic, M.A. Kronrod, and I.A. Faradzev. On economic construction of the transitive closure of a directed graph. Soviet Math. Dokl., 11:1209–1210, 1970.

    Google Scholar 

  9. R.P. Brent. Evaluation of general arithmetic expressions. J. Assoc. Comput. Mach., 21:201–206, 1974.

    Google Scholar 

  10. D. Breslauer and Z. Galil. An optimal O(log log n) time parallel string matching algorithm. SIAM J. Comput., 19(6):1051–1058, 1990.

    Article  Google Scholar 

  11. D. Breslauer and Z. Galil. A Lower Bound for Parallel String Matching. SIAM J. Comput., 21(5):856–862, 1992.

    Google Scholar 

  12. D. Breslauer and Z. Galil. Finding all Periods and Initial Palindromes of a String in Parallel. Algorithmica, to appear.

    Google Scholar 

  13. R. Cole, M. Crochemore, Z. Galil, L. Gasieniec, R. Hariharan, S. Muthukrishnan, K. Park, and W. Rytter. Optimally fast parallel algorithms for preprocessing and pattern matching in one and two dimensions. In Proc. 34th IEEE Symp. on Foundations of Computer Science, pages 248–258, 1993.

    Google Scholar 

  14. M. Crochemore. An optimal algorithm for computing the repetitions in a word. Inform. Process. Lett., 12(5):244–250, 1981.

    Google Scholar 

  15. M. Crochemore. Transducers and repetitions. Theoret. Comput. Sci., 12:63–86, 1986.

    Google Scholar 

  16. M. Crochemore, Z. Galil, L. Gasieniec, K. Park, and W. Rytter. Constant-Time Randomized Parallel String Matching. Manuscript, 1994.

    Google Scholar 

  17. M. Crochemore, L. Gasieniec, R. Hariharan, S. Muthukrishnan, and W. Rytter. A Constant Time Optimal Parallel Algorithm for Two Dimensional Pattern Matching. Manuscript, 1993.

    Google Scholar 

  18. M. Crochemore and W. Rytter. Efficient parallel algorithms to test square-freeness and factorize strings. Inform. Process. Lett., 38:57–60, 1991.

    Google Scholar 

  19. M. Crochemore and W. Rytter. Usefulness of the Karp-Miller-Rosenberg algorithm in parallel computations on strings and arrays. Theoret. Comput. Sci., 88:59–82, 1991.

    Google Scholar 

  20. F.E. Fich, R.L. Ragde, and A. Wigderson. Relations between concurrent-write models of parallel computation. SIAM J. Comput., 17(3):606–627, 1988.

    Google Scholar 

  21. M.J. Fischer and M.S. Paterson. String matching and other products. In R.M. Karp, editor, Complexity of Computation, pages 113–125. American Mathematical Society, Prividence, RI., 1974.

    Google Scholar 

  22. Z. Galil. Palindrome Recognition in Real Time by a Multitape Turing Machine. J. Comput. System Sci., 16(2):140–157, 1978.

    Google Scholar 

  23. Z. Galil. Optimal parallel algorithms for string matching. Inform. and Control, 67:144–157, 1985.

    Google Scholar 

  24. Z. Galil. A Constant-Time Optimal Parallel String-Matching Algorithm. In Proc. 24th ACM Symp. on Theory of Computing, pages 69–76, 1992.

    Google Scholar 

  25. Z. Galil and K. Park. Truly Alphabet-Independent Two-Dimensional Pattern Matching. In Proc. 33th IEEE Symp. on Foundations of Computer Science, pages 247–256, 1992.

    Google Scholar 

  26. T. Goldberg and U. Zwick. Faster parallel string matching via larger deterministic samples. J. Algorithms, 16(2):295–308, 1994.

    Google Scholar 

  27. D.E. Knuth, J.H. Morris, and V.R. Pratt. Fast pattern matching in strings. SIAM J. Comput., 6:322–350, 1977.

    Article  Google Scholar 

  28. S.R. Kosaraju. Computation of Squares in a String. In Proc. 5rd Symp. on Combinatorial Pattern Matching, number 807 in Lecture Notes in Computer Science, pages 146–150. Springer-Verlag, Berlin, Germany, 1994.

    Google Scholar 

  29. R.E. Ladner and M.J. Fischer. Parallel prefix computation. J. Assoc. Comput. Mach., 27(4):831–838, 1980.

    Google Scholar 

  30. R.C. Lyndon and M.P. Schützenberger. The equation a m=b n c p in a free group. Michigan Math. J., 9:289–298, 1962.

    Article  Google Scholar 

  31. G.M. Main and R.J. Lorentz. An O(n log n) algorithm for finding all repetitions in a string. J. Algorithms, 5:422–432, 1984.

    Article  Google Scholar 

  32. G.M. Main and R.J. Lorentz. Linear time recognition of squarefree strings. In A. Apostolico and Z. Galil, editors, Combinatorial Algorithms on Words, volume 12 of NATO ASI Series F, pages 271–278. Springer-Verlag, Berlin, Germany, 1985.

    Google Scholar 

  33. G. Manacher. A new Linear-Time “On-Line” Algorithm for Finding the Smallest Initial Palindrome of a String. J. Assoc. Comput. Mach., 22:346–351, 1975.

    Google Scholar 

  34. M.O. Rabin. Discovering Repetitions in Strings. In A. Apostolico and Z. Galil, editors, Combinatorial Algorithms on Words, volume 12 of NATO ASI Series F, pages 279–288. Springer-Verlag, Berlin, Germany, 1984.

    Google Scholar 

  35. A.O. Slisenko. Recognition of palindromes by multihead Turing machines. In V.P. Orverkov and N.A. Sonin, editors, Problems in the Constructive Trend in Mathematics VI (Proceedings of the Steklov Institute of Mathematics, No. 129), pages 30–202. Academy of Sciences of the USSR, 1973. English Translation by R.H. Silverman, pp. 25–208, Amer. Math. Soc., Providence, RI, 1976.

    Google Scholar 

  36. A. Thue. über unendliche zeichenreihen. Norske Vid. Selsk Skr. Mat. Nat. Kl. (Cristiania), (7): 1–22, 1906.

    Google Scholar 

  37. A. Thue. über die gegenseitige lage gleicher teile gewisser zeichenreihen. Norske Vid. Selsk. Skr. Mat. Nat. Kl. (Cristiania), (1):1–67, 1912.

    Google Scholar 

  38. U. Vishkin. Optimal parallel pattern matching in strings. Inform. and Control, 67:91–113, 1985.

    Article  Google Scholar 

  39. U. Vishkin. Deterministic sampling — a new technique for fast pattern matching. SIAM J. Comput., 20(1):22–40, 1990.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Zvi Galil Esko Ukkonen

Rights and permissions

Reprints and permissions

Copyright information

© 1995 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Breslauer, D., Gasieniec, L. (1995). Efficient string matching on coded texts. In: Galil, Z., Ukkonen, E. (eds) Combinatorial Pattern Matching. CPM 1995. Lecture Notes in Computer Science, vol 937. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-60044-2_32

Download citation

  • DOI: https://doi.org/10.1007/3-540-60044-2_32

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-60044-2

  • Online ISBN: 978-3-540-49412-6

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics