String Powers in Trees

In this paper we consider substrings of an unrooted edge-labeled tree, which are defined as the composite labels of simple paths. We study how the number of distinct repetitive substrings depends on their exponent \(\alpha \). An \(\alpha \)-power is defined as a string U with an (integral, not necessarily shortest) period \(|U|/\alpha \). For example, squares are 2-powers and cubes are 3-powers. We investigate the asymptotic growth of the maximal number \(\textsf {powers}_{\alpha }(n)\) of distinct \(\alpha \)-powers occurring as substrings of a tree with n nodes. The maximum number of such powers behaves much unlike in strings. In a previous work (CPM 2012. LNCS, vol 7354. Springer, Berlin, pp 27–40, 2012. It was proved that the number of different squares in a tree is \(\textsf {powers}_2(n) = \varTheta (n^{4/3})\). We extend this result and analyze powers of arbitrary rational exponent \(\alpha \ge 1\). We identify two phase-transition thresholds: 1. \(\textsf {powers}_{\alpha }(n)\;=\;\varTheta (n^2)\) for \(1\le \alpha <2\); 2. \(\textsf {powers}_{\alpha }(n)\;=\; \varTheta (n^{4/3})\) for \(2\le \alpha <3\); 3. \(\textsf {powers}_{\alpha }(n)\;=\; \varTheta (n)\) for \(\alpha \ge 3\). This is a full version of a paper presented at CPM 2015. LNCS, vol 9133. Springer, Berlin, pp 284–294, 2015. Compared to the earlier version, we improve our main technical contribution, i.e., the upper bound on the number of cubes in a tree, from \(\mathcal {O}(n \log n)\) to \(\mathcal {O}(n)\). This lets us obtain a tight asymptotic characterization of the \(\textsf {powers}\) function.

[1]  Wojciech Rytter,et al.  Internal Pattern Matching Queries in a Text and Applications , 2013, SODA.

[2]  Jaroslaw Grytczuk,et al.  Thue type problems for graphs, points, and numbers , 2008, Discret. Math..

[3]  Moshe Lewenstein,et al.  Pattern Matching in Hypertext , 1997, J. Algorithms.

[4]  Maxime Crochemore,et al.  Algorithms on strings , 2007 .

[5]  Wojciech Rytter,et al.  Maximum number of distinct and nonequivalent nonstandard squares in a word , 2014, Theor. Comput. Sci..

[6]  Wojciech Rytter,et al.  Efficient counting of square substrings in a tree , 2014, Theor. Comput. Sci..

[7]  Lucian Ilie,et al.  A simple proof that a word of length n has at most 2n distinct squares , 2005, J. Comb. Theory A.

[8]  Sandi Klavzar,et al.  Nonrepetitive colorings of trees , 2007, Discret. Math..

[9]  Wojciech Rytter,et al.  Tight Bound for the Number of Distinct Palindromes in a Tree , 2015, SPIRE.

[10]  M. Lothaire,et al.  Combinatorics on words: Frontmatter , 1997 .

[11]  Lucian Ilie,et al.  A note on the number of squares in a word , 2007, Theor. Comput. Sci..

[12]  Zvi Galil,et al.  Finding all periods and initial palindromes of a string in parallel , 1992, Algorithmica.

[13]  Srecko Brlek,et al.  Palindromic Complexity of Trees , 2015, DLT.

[14]  Frantisek Franek,et al.  How many double squares can a string contain? , 2015, Discret. Appl. Math..

[15]  Aviezri S. Fraenkel,et al.  How Many Squares Can a String Contain? , 1998, J. Comb. Theory, Ser. A.

[16]  Wojciech Rytter,et al.  The Maximum Number of Squares in a Tree , 2012, CPM.

[17]  Wojciech Rytter,et al.  On the maximum number of cubic subwords in a word , 2013, Eur. J. Comb..

[18]  Giuseppe Pirillo,et al.  Episturmian words and some constructions of de Luca and Rauzy , 2001, Theor. Comput. Sci..