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 $\mbox{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 $\mbox{powers}_2(n)=\Theta(n^{4/3})$. We extend this result and analyze powers of arbitrary rational exponent $\alpha\ge 1$. We identify two phase-transition thresholds: 1. $\mbox{powers}_\alpha(n)=\Theta(n^2)$ for $\alpha<2$; 2. $\mbox{powers}_\alpha(n)=\Theta(n^{4/3})$ for $2\le \alpha<3$; 3. $\mbox{powers}_\alpha(n)=O(n\log n)$ for $\alpha>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 $O(n\log n)$ to $O(n)$. This lets us obtain a tight asymptotic characterization of the $\mbox{powers}$ function.

Publication

Algorithmica 79(3):814-834 (2017)

Date

October, 2017

Type

Journal
(see conference version)

Links