Skip to main content

String Covers of a Tree

  • Conference paper
  • First Online:
String Processing and Information Retrieval (SPIRE 2021)

Abstract

We consider covering labeled trees by a collection of paths with the same string label, called a (string) cover of a tree. We show how to compute all covers of a directed (rooted) labeled tree in \({\mathcal {O}}(n \log n/\log \log n)\) time and all covers of an undirected labeled tree in \({\mathcal {O}}(n^2)\) time and space or in \({\mathcal {O}}(n^2 \log n)\) time and \({\mathcal {O}}(n)\) space. We also show several essential differences between covers in standard strings and covers in trees.

Work supported by the Polish National Science Center, grant no. 2018/31/D/ST6/03991.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Alatabbi, A., Rahman, M.S., Smyth, W.F.: Computing covers using prefix tables. Discret. Appl. Math. 212, 2–9 (2016). https://doi.org/10.1016/j.dam.2015.05.019

    Article  MathSciNet  MATH  Google Scholar 

  2. Alstrup, S., Husfeldt, T., Rauhe, T.: Marked ancestor problems. In: 39th Annual Symposium on Foundations of Computer Science, FOCS ’98, pp. 534–544. IEEE Computer Society, Palo Alto, California, USA (1998). https://doi.org/10.1109/SFCS.1998.743504

  3. Antoniou, P., Crochemore, M., Iliopoulos, C.S., Jayasekera, I., Landau, G.M.: Conservative string covering of indeterminate strings. In: Holub, J., Zdárek, J. (eds.) Proceedings of the Prague Stringology Conference 2008, Prague, Czech Republic, 1–3 September 2008, pp. 108–115. Prague Stringology Club, Department of Computer Science and Engineering, Faculty of Electrical Engineering, Czech Technical University in Prague (2008). http://www.stringology.org/event/2008/p10.html

  4. Apostolico, A., Farach, M., Iliopoulos, C.S.: Optimal superprimitivity testing for strings. Inf. Process. Lett. 39(1), 17–20 (1991). https://doi.org/10.1016/0020-0190(91)90056-N

    Article  MathSciNet  MATH  Google Scholar 

  5. Barton, C., Kociumaka, T., Liu, C., Pissis, S.P., Radoszewski, J.: Indexing weighted sequences: neat and efficient. Inf. Comput. 270, 104462 (2020). https://doi.org/10.1016/j.ic.2019.104462

    Article  MathSciNet  MATH  Google Scholar 

  6. Bender, M.A., Farach-Colton, M.: The level ancestor problem simplified. In: Rajsbaum, S. (ed.) LATIN 2002. LNCS, vol. 2286, pp. 508–515. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45995-2_44

    Chapter  Google Scholar 

  7. Breslauer, D.: An on-line string superprimitivity test. Inf. Process. Lett. 44(6), 345–347 (1992). https://doi.org/10.1016/0020-0190(92)90111-8

    Article  MathSciNet  MATH  Google Scholar 

  8. 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

    Chapter  Google Scholar 

  9. Charalampopoulos, P., Radoszewski, J., Rytter, W., Waleń, T., Zuba, W.: Computing covers of 2D-strings. In: Gawrychowski, P., Starikovskaya, T. (eds.) 32nd Annual Symposium on Combinatorial Pattern Matching, CPM 2021, 5–7 July 2021, Wrocław, Poland. LIPIcs, vol. 191, pp. 12:1–12:20. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2021). https://doi.org/10.4230/LIPIcs.CPM.2021.12

  10. 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

    Chapter  Google Scholar 

  11. Crochemore, M., Iliopoulos, C.S., Kociumaka, T., Radoszewski, J., Rytter, W., Waleń, T.: Covering problems for partial words and for indeterminate strings. Theor. Comput. Sci. 698, 25–39 (2017). https://doi.org/10.1016/j.tcs.2017.05.026

    Article  MathSciNet  MATH  Google Scholar 

  12. 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). http://www.stringology.org/event/2019/p02.html

  13. Gawrychowski, P., Kociumaka, T., Rytter, W., Waleń, T.: Tight bound for the number of distinct palindromes in a tree. In: Iliopoulos, C.S, 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

  14. Gawrychowski, P., Kociumaka, T., Rytter, W., Waleń, T.: Tight bound for the number of distinct palindromes in a tree. CoRR abs/2008.13209 (2020). arXiv:2008.13209

  15. Harary, F.: Graph Theory. Reading, Addison-Wesley, Boston, MA (1994)

    Google Scholar 

  16. Iliopoulos, C.S., Mohamed, M., Mouchard, L., Perdikuri, K., Smyth, W.F., Tsakalidis, A.K.: String regularities with don’t cares. Nordic J. Comput. 10(1), 40–51 (2003)

    MathSciNet  MATH  Google Scholar 

  17. Kikuchi, N., Hendrian, D., Yoshinaka, R., Shinohara, A.: Computing covers under substring consistent equivalence relations. In: Boucher, C., Thankachan, S.V. (eds.) SPIRE 2020. LNCS, vol. 12303, pp. 131–146. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-59212-7_10

    Chapter  Google Scholar 

  18. 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). https://doi.org/10.1016/j.tcs.2014.04.015

    Article  MathSciNet  MATH  Google Scholar 

  19. Kociumaka, T., Radoszewski, J., Rytter, W., Waleń, T.: String powers in trees. Algorithmica 79(3), 814–834 (2017). https://doi.org/10.1007/s00453-016-0271-3

    Article  MathSciNet  MATH  Google Scholar 

  20. Kociumaka, T., Radoszewski, J., Wiśniewski, B.: Subquadratic-time algorithms for abelian stringology problems. In: Kotsireas, I.S., Rump, S.M., Yap, C.K. (eds.) MACIS 2015. LNCS, vol. 9582, pp. 320–334. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-32859-1_27

    Chapter  Google Scholar 

  21. Kociumaka, T., Radoszewski, J., Wiśniewski, B.: Subquadratic-time algorithms for abelian stringology problems. AIMS Med. Sci. 4(3), 332–351 (2017). https://doi.org/10.3934/ms.2017.3.332

    Article  MATH  Google Scholar 

  22. Kosaraju, S.R.: Efficient tree pattern matching (preliminary version). In: 30th Annual Symposium on Foundations of Computer Science, Research Triangle Park, North Carolina, USA, 30 October–1 November 1989, pp. 178–183. IEEE Computer Society (1989). https://doi.org/10.1109/SFCS.1989.63475

  23. Matsuda, S., Inenaga, S., Bannai, H., Takeda, M.: Computing abelian covers and abelian runs. In: Holub, J., Zdárek, J. (eds.) Proceedings of the Prague Stringology Conference 2014, Prague, Czech Republic, 1–3 September 2014, pp. 43–51. Department of Theoretical Computer Science, Faculty of Information Technology, Czech Technical University in Prague (2014). http://www.stringology.org/event/2014/p05.html

  24. Moore, D.W.G., Smyth, W.F.: An optimal algorithm to compute all the covers of a string. Inf. Process. Lett. 50(5), 239–246 (1994). https://doi.org/10.1016/0020-0190(94)00045-X

    Article  MathSciNet  MATH  Google Scholar 

  25. 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). https://doi.org/10.1016/0020-0190(94)00235-Q

  26. Popa, A., Tanasescu, A.: An output-sensitive algorithm for the minimization of 2-dimensional string covers. In: Gopal, T.V., Watada, J. (eds.) TAMC 2019. LNCS, vol. 11436, pp. 536–549. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-14812-6_33

    Chapter  MATH  Google Scholar 

  27. Radoszewski, J., Straszyński, J.: Efficient computation of 2-covers of a string. In: Grandoni, F., Herman, G., Sanders, P. (eds.) 28th Annual European Symposium on Algorithms, ESA 2020, 7–9 September 2020, Pisa, Italy (Virtual Conference). LIPIcs, vol. 173, pp. 77:1–77:17. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2020). https://doi.org/10.4230/LIPIcs.ESA.2020.77

  28. Shibuya, T.: Constructing the suffix tree of a tree with a large alphabet. IEICE Trans. Fundam. Electron. Commun. Comput. Sci. E86–A(5), 1061–1066 (2003)

    Google Scholar 

  29. Sugahara, R., Nakashima, Y., Inenaga, S., Bannai, H., Takeda, M.: Computing runs on a trie. In: Pisanti, N., Pissis, S.P. (eds.) 30th Annual Symposium on Combinatorial Pattern Matching, CPM 2019, June 18–20, 2019, Pisa, Italy. LIPIcs, vol. 128, pp. 23:1–23:11. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2019). https://doi.org/10.4230/LIPIcs.CPM.2019.23

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jakub Radoszewski .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Radoszewski, J., Rytter, W., Straszyński, J., Waleń, T., Zuba, W. (2021). String Covers of a Tree. In: Lecroq, T., Touzet, H. (eds) String Processing and Information Retrieval. SPIRE 2021. Lecture Notes in Computer Science(), vol 12944. Springer, Cham. https://doi.org/10.1007/978-3-030-86692-1_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-86692-1_7

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-86691-4

  • Online ISBN: 978-3-030-86692-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics