CPM 2012: Combinatorial Pattern Matching pp 27-40

# The Maximum Number of Squares in a Tree

• Maxime Crochemore
• Costas S. Iliopoulos
• Tomasz Kociumaka
• Marcin Kubica
• Wojciech Rytter
• Wojciech Tyczyński
• Tomasz Waleń
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7354)

## Abstract

We show that the maximum number of different square substrings in unrooted labelled trees behaves much differently than in words. A substring in a tree corresponds (as its value) to a simple path. Let $$\textsf{sq}(n)$$ be the maximum number of different square substrings in a tree of size n. We show that asymptotically $$\textsf{sq}(n)$$ is strictly between linear and quadratic orders, for some constants c 1,c 2 > 0 we obtain:
$$c_1n^{4/3} \le \textsf{sq}(n) \le c_2n^{4/3}.$$

## References

1. 1.
Alon, N., Grytczuk, J.: Breaking the rhythm on graphs. Discrete Mathematics 308(8), 1375–1380 (2008)
2. 2.
Alon, N., Grytczuk, J., Haluszczak, M., Riordan, O.: Nonrepetitive colorings of graphs. Random Struct. Algorithms 21(3-4), 336–346 (2002)
3. 3.
Blanchet-Sadri, F., Mercas, R., Scott, G.: Counting distinct squares in partial words. Acta Cybern. 19(2), 465–477 (2009)
4. 4.
Bresar, B., Grytczuk, J., Klavzar, S., Niwczyk, S., Peterin, I.: Nonrepetitive colorings of trees. Discrete Mathematics 307(2), 163–172 (2007)
5. 5.
Crochemore, M., Hancart, C., Lecroq, T.: Algorithms on Strings. Cambridge University Press (2007)Google Scholar
6. 6.
Crochemore, M., Rytter, W.: Jewels of Stringology. World Scientific (2003)Google Scholar
7. 7.
Fraenkel, A.S., Simpson, J.: How many squares can a string contain? J. of Combinatorial Theory Series A 82, 112–120 (1998)
8. 8.
Grytczuk, J., Przybylo, J., Zhu, X.: Nonrepetitive list colourings of paths. Random Struct. Algorithms 38(1-2), 162–173 (2011)
9. 9.
Ilie, L.: A simple proof that a word of length n has at most 2n distinct squares. J. Comb. Theory, Ser. A 112(1), 163–164 (2005)
10. 10.
Ilie, L.: A note on the number of squares in a word. Theor. Comput. Sci. 380(3), 373–376 (2007)
11. 11.

## Authors and Affiliations

• Maxime Crochemore
• 1
• 3
• Costas S. Iliopoulos
• 1
• 4
• Tomasz Kociumaka
• 2
• Marcin Kubica
• 2
• 2
• Wojciech Rytter
• 2
• 5
• Wojciech Tyczyński
• 2
• Tomasz Waleń
• 2
• 6
1. 1.Dept. of InformaticsKing’s College LondonLondonUK
2. 2.Faculty of Mathematics, Informatics and MechanicsUniversity of WarsawWarsawPoland
3. 3.Université Paris-EstFrance
4. 4.Faculty of Engineering, Computing and MathematicsUniversity of Western AustraliaPerthAustralia
5. 5.Faculty of Mathematics and Computer ScienceCopernicus UniversityToruńPoland
6. 6.Laboratory of Bioinformatics and Protein EngineeringInternational Institute of Molecular and Cell BiologyWarsawPoland