Abstract
Kosaraju in “Computation of squares in a string” briefly described a linear-time algorithm for computing the minimal squares starting at each position in a word. Using the same construction of suffix trees, we generalize his result and describe in detail how to compute the minimal α power, with a period of length longer than s, starting at each position in a word w for arbitrary exponent α> 1 and integer s ≥ 0. The algorithm runs in O(α|w|)-time for s = 0 and in O(|w|2)-time otherwise. We provide a complete proof of the correctness and computational complexity of the algorithm. The algorithm can be used to detect certain types of pseudo-patterns in words, which was our original goal in studying this generalization.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Apostolico, A., Preparata, F.P.: Optimal off-line detection of repetitions in a string. Theoret. Comput. Sci. 22, 297–315 (1983)
Beauquier, D., Nivat, M.: On translating one polyomino to tile the plane. Discrete Comput. Geom. 6(1), 575–592 (1991)
Chiniforooshan, E., Kari, L., Xu, Z.: Pseudo-power avoidance. CoRR abs/0911. 2233 (2009), http://arxiv.org/abs/0911.2233
Crochemore, M.: Optimal algorithm for computing the repetitions in a word. Info. Proc. Lett. 12(5), 244–250 (1981)
Crochemore, M.: Recherche linéaire d’un carré dans un mot. Comptes Rendus Acad. Sci. Paris Sér. I 296, 781–784 (1983)
Crochemore, M., Ilie, L., Rytter, W.: Repetitions in strings: Algorithms and combinatorics. Theoret. Comput. Sci. 410(50), 5227–5235 (2009)
Duval, J., Kolpakov, R., Kucherov, G., Lecroq, T., Lefebvre, A.: Linear-time computation of local periods. Theoret. Comput. Sci. 326, 229–240 (2004)
Fraenkel, A.S., Simpson, J.: How many squares can a string contain? J. Combin. Theory Ser. A 82(1), 112–120 (1998)
Gusfield, D.: Algorithms on strings, trees, and sequences: computer science and computational biology. Cambridge University Press, Cambridge (1997)
Gusfield, D., Stoye, J.: Linear time algorithms for finding and representing all the tandem repeats in a string. J. Comput. Syst. Sci. 69(4), 525–546 (2004)
Harel, D., Tarjan, R.E.: Fast algorithms for finding nearest common ancestors. SIAM J. Comput. 13(2), 338–355 (1984)
Ilie, L.: A note on the number of squares in a word. Theoret. Comput. Sci. 380(3), 373–376 (2007)
Knuth, D., Morris, J., Pratt, V.: Fast pattern matching in strings. SIAM J. Comput. 6(2), 323–350 (1977)
Kolpakov, R., Kucherov, G.: Finding maximal repetitions in a word in linear time. In: Proc. 40th Ann. Symp. Found. Comput. Sci (FOCS 1999), pp. 596–604. IEEE Computer Society Press, Los Alamitos (1999)
Kosaraju, S.R.: Computation of squares in a string. In: Crochemore, M., Gusfield, D. (eds.) Proc. 5th Combinat. Patt. Matching, pp. 146–150. Springer, Heidelberg (1994)
Main, M., Lorentz, R.: An O(nlogn) algorithm for finding all repetitions in a string. J. Algorithms 5(3), 422–432 (1984)
Main, M., Lorentz, R.: Linear time recognition of square free strings. In: Apostolico, A., Galil, Z. (eds.) Combinat. Algor. on Words, pp. 272–278. Springer, Heidelberg (1985)
Main, M.G.: Detecting leftmost maximal periodicities. Discrete Appl. Math. 25(1–2), 145–153 (1989)
McCreight, E.M.: A space-economical suffix tree construction algorithm. J. Assoc. Comput. Mach. 23(2), 262–272 (1976)
Schieber, B., Vishkin, U.: On finding lowest common ancestors: Simplification and parallelization. SIAM J. Comput. 17(6), 1253–1262 (1988)
Slisenko, A.O.: Detection of periodicities and string-matching in real time. J. Math. Sci (N. Y.) 22(3), 1316–1387 (1983)
Stoye, J., Gusfield, D.: Simple and flexible detection of contiguous repeats using a suffix tree preliminary version. In: Farach-Colton, M. (ed.) Proc. 9th Combinat. Patt. Matching, pp. 140–152. Springer, Heidelberg (1998)
Thue, A.: Über unendliche Zeichenreihen. Norske Vid. Selsk. Skr. I. Mat.-Nat. Kl (7), 1–22 (1906)
Ukkonen, E.: Constructing suffix trees on-line in linear time. In: Leeuwen, J.V. (ed.) Proc. Infor. Proces. 92, IFIP Trans. A-12., Vol. 1. pp. 484–492. Elsevier, Amsterdam (1992)
Weiner, P.: Linear pattern matching algorithms. In: Proc. 14th IEEE Ann. Symp. on Switching and Automata Theory (SWAT), pp. 1–11 (1973)
Xu, Z.: http://www.csd.uwo.ca/~zhi_xu/demons/cpm2010xu.html (2010)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2010 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Xu, Z. (2010). A Minimal Periods Algorithm with Applications. In: Amir, A., Parida, L. (eds) Combinatorial Pattern Matching. CPM 2010. Lecture Notes in Computer Science, vol 6129. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-13509-5_6
Download citation
DOI: https://doi.org/10.1007/978-3-642-13509-5_6
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-13508-8
Online ISBN: 978-3-642-13509-5
eBook Packages: Computer ScienceComputer Science (R0)