Skip to main content
Log in

Finding all periods and initial palindromes of a string in parallel

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract

An optimalO(log logn)-time CRCW-PRAM algorithm for computing all period lengths of a string is presented. Previous parallel algorithms compute the period only if it is shorter than half of the length of the string. The algorithm can be used to find all initial palindromes of a string in the same time and processor bounds. Both algorithms are the fastest possible over a general alphabet. We derive a lower bound for finding initial palindromes by modifying a known lower bound for finding the period length of a string [9]. Whenp processors are available the bounds become Θ(⌈n/p⌉+log⌈1+p/n2p).

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. A. Apostolico and D. Breslauer. An optimalO(log logn) time parallel algorithm for detecting all squares in a string.SIAM J. Comput., to appear.

  2. A. Apostolico, D. Breslauer, and Z. Galil. Optimal parallel algorithms for periods, palindromes and squares.Proc. 19th Internat. Colloq. on Automata, Languages, and Programming. Lecture Notes in Computer Science, Vol. 623. Springer-Verlag, Berlin, 1992, pages 296–307.

    Google Scholar 

  3. H. W. Bergerson.Palindromes and Anagrams. Dover. New York, 1973.

    Google Scholar 

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

    Google Scholar 

  5. D. Breslauer. Efficient String Algorithmics. Ph.D. thesis, Department of Computer Science, Columbia University, New York, 1992.

    Google Scholar 

  6. D. Breslauer. Fast parallel string prefix-matching.Theoret. Comput. Sci., 137(2):269–278, 1995.

    Google Scholar 

  7. D. Breslauer. Testing string superprimitivity in parallel.Inform. Process. Lett., 49:5 235–241, 1994.

    Google Scholar 

  8. D. Breslauer and Z. Galil. An optimalO(log logn) time parallel string matching algorithm.SIAM J. Comput., 19(6): 1051–1058, 1990.

    Google Scholar 

  9. D. Breslauer and Z. Galil. A lower bound for parallel string matching.SIAM J. Comput., 21(5):856–862. 1992.

    Google Scholar 

  10. 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 

  11. F. E. Fich, R. L. Radge, and A. Wigderson. Relations between concurrent-write models of parallel computation.Proc. 3rd ACM Symp. on Principles of Distributed Computing, 1984, pages 179–189.

  12. M. J. Fischer and M. S. Paterson. Sring matching and other produces. In R. M. Karp, editor,Complexity of Computation. American Mathematical Society, Providence, RI, 1974, pages 113–125.

    Google Scholar 

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

    Google Scholar 

  14. J. E. Hopcroft and J. D. Ullman.Introduction to Automata Theory, Languages and Computation. Addison-Wesley, Reading, MA, 1979.

    Google Scholar 

  15. R. M. Karp, R. E. Miller, and A. L. Rosenberg. Rapid identification of repeated patterns in strings, trees and arrays.Proc. 4th ACM Symp. on Theory of Computing, 1972, pages 125–136.

  16. Z. Kedem, G. M. Landau, and K. Palem. Optimal parallel suffix-prefix matching algorithm and applications.Proc. 1st ACM Symp. on Parallel Algorithms and Architectures, 1989, pages 388–398.

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

    Google Scholar 

  18. M. Lothaire.Combinatorics on Words. Addison-Wesley, Reading, MA, 1983.

    Google Scholar 

  19. R. C. Lyndon and M. P. Schutzenberger. The equation am=bncp in a free group.Michigan Math. J., 9:289–298, 1962.

    Google Scholar 

  20. 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 

  21. L. G. Valiant. Parallelism in comparison models.SIAM J. Comput., 4:348–355, 1975.

    Google Scholar 

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

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

Communicated by F. T. Leighton.

This work was partially supported by NSF Grant CCR-90-14605. D. Breslauer was partially supported by an IBM Graduate Fellowship while studying at Columbia University and by a European Research Consortium for Informatics and Mathematics postdoctoral fellowship.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Breslauer, D., Galil, Z. Finding all periods and initial palindromes of a string in parallel. Algorithmica 14, 355–366 (1995). https://doi.org/10.1007/BF01294132

Download citation

  • Received:

  • Revised:

  • Issue Date:

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

Key words

Navigation