Abstract
We consider covering labeled trees with a collection of paths with the same string label, called a (string) cover of a tree. This problem was originated by Radoszewski et al. (SPIRE 2021), who show how to compute all covers of a directed rooted labeled tree in \(O(n \log n / \log \log n)\) time and all covers of an undirected labeled tree in \(O(n^2)\) time and space, or \(O(n^2 \log n)\) time and O(n)-space. (Here n denotes the number of nodes of a given tree). We improve those results by proposing a linear time algorithm for reporting all covers of a directed tree, and showing an \(O(n^2)\) time and O(n)-space algorithm for computing undirected tree covers. Both algorithms assume that labeling characters come from an integer alphabet.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Alstrup, S., Husfeldt, T., Rauhe, T.: Marked ancestor problems. In: 39th Annual Symposium on Foundations of Computer Science, FOCS 1998, 8–11 November 1998, Palo Alto, California, USA, pp. 534–544. IEEE Computer Society (1998)
Apostolico, A., Ehrenfeucht, A.: Efficient detection of quasiperiodicities in strings. Theor. Comput. Sci. 119(2), 247–265 (1993)
Apostolico, A., Farach, M., Iliopoulos, C.S.: Optimal superprimitivity testing for strings. Inf. Process. Lett. 39(1), 17–20 (1991)
Breslauer, D.: An on-line string superprimitivity test. Inf. Process. Lett. 44(6), 345–347 (1992)
Brlek, S., Lafrenière, N., Provençal, X.: Palindromic complexity of trees. In: Potapov, I. (ed.) DLT 2015. LNCS, vol. 9168, pp. 155–166. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21500-6_12
Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 2nd edn. The MIT Press, Cambridge (2001)
Crochemore, M., et al.: The maximum number of squares in a tree. In: Kärkkäinen, J., Stoye, J. (eds.) CPM 2012. LNCS, vol. 7354, pp. 27–40. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-31265-6_3
Czajka, P., Radoszewski, J.: Experimental evaluation of algorithms for computing quasiperiods. Theor. Comput. Sci. 854, 17–29 (2021)
Funakoshi, M., Nakashima, Y., Inenaga, S., Bannai, H., Takeda, M.: Computing maximal palindromes and distinct palindromes in a trie. In: Holub, J., Zdárek, J. (eds.) Prague Stringology Conference 2019, Prague, Czech Republic, 26–28 August 2019, pp. 3–15. Czech Technical University in Prague, Faculty of Information Technology, Department of Theoretical Computer Science (2019)
Gawrychowski, P., Kociumaka, T., Rytter, W., Waleń, T.: Tight bound for the number of distinct palindromes in a tree. In: Iliopoulos, C., Puglisi, S., Yilmaz, E. (eds.) SPIRE 2015. LNCS, vol. 9309, pp. 270–276. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-23826-5_26
Gawrychowski, P., Kociumaka, T., Rytter, W., Waleń, T.: Tight bound for the number of distinct palindromes in a tree. Electron. J. Comb. 30, 04 (2023)
Kociumaka, T., Pachocki, J., Radoszewski, J., Rytter, W., Waleń, T.: Efficient counting of square substrings in a tree. Theor. Comput. Sci. 544, 60–73 (2014)
Kociumaka, T., Radoszewski, J., Rytter, W., Waleń, T.: String powers in trees. Algorithmica 79(3), 814–834 (2017)
Mhaskar, N., Smyth, W.F.: String covering: a survey. CoRR, abs/2211.11856 (2022)
Moore, D.W.G., Smyth, W.F.: A correction to “an optimal algorithm to compute all the covers of a string’’. Inf. Process. Lett. 54(2), 101–103 (1995)
Radoszewski, J., Rytter, W., Straszyński, J., Waleń, T., Zuba, W.: String covers of a tree. In: Lecroq, T., Touzet, H. (eds.) SPIRE 2021. LNCS, vol. 12944, pp. 68–82. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-86692-1_7
Shibuya, T.: Constructing the suffix tree of a tree with a large alphabet. In: ISAAC 1999. LNCS, vol. 1741, pp. 225–236. Springer, Heidelberg (1999). https://doi.org/10.1007/3-540-46632-0_24
Stroustrup, B.: The C++ Programming Language - Special Edition, 3rd edn. Addison-Wesley (2007)
Sugahara, R., Nakashima, Y., Inenaga, S., Bannai, H., Takeda, M.: Efficiently computing runs on a trie. Theor. Comput. Sci. 887, 143–151 (2021)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Kondraciuk, Ł. (2023). String Covers of a Tree Revisited. In: Nardini, F.M., Pisanti, N., Venturini, R. (eds) String Processing and Information Retrieval. SPIRE 2023. Lecture Notes in Computer Science, vol 14240. Springer, Cham. https://doi.org/10.1007/978-3-031-43980-3_24
Download citation
DOI: https://doi.org/10.1007/978-3-031-43980-3_24
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-43979-7
Online ISBN: 978-3-031-43980-3
eBook Packages: Computer ScienceComputer Science (R0)