Faster Path Queries in Colored Trees via Sparse Matrix Multiplication and Min-Plus Product

Authors Younan Gao, Meng He



PDF
Thumbnail PDF

File

LIPIcs.ESA.2022.59.pdf
  • Filesize: 0.73 MB
  • 15 pages

Document Identifiers

Author Details

Younan Gao
  • Faculty of Computer Science, Dalhousie University, Halifax, Canada
Meng He
  • Faculty of Computer Science, Dalhousie University, Halifax, Canada

Acknowledgements

The authors would like to thank the anonymous reviewers for their valueable comments and suggestions.

Cite AsGet BibTex

Younan Gao and Meng He. Faster Path Queries in Colored Trees via Sparse Matrix Multiplication and Min-Plus Product. In 30th Annual European Symposium on Algorithms (ESA 2022). Leibniz International Proceedings in Informatics (LIPIcs), Volume 244, pp. 59:1-59:15, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2022)
https://doi.org/10.4230/LIPIcs.ESA.2022.59

Abstract

Let T be an ordinal tree on n nodes in which each node is assigned a color. We consider the batched colored path counting problem and the batched path mode/least frequent element query problem, in which given n query paths, each identified by a pair of nodes in T, one is asked to answer queries of the following forms: How many distinct colors are there on each query path (i.e. the colored path counting problem); what is the color on each query path that occurs at least/most as frequently as any other colors (i.e. the path mode/least frequent element query problem). By reducing the batched colored path counting problem to sparse matrix multiplication, we design a solution that answers n colored path counting queries in Õ(n^{2ω/(ω+1)}) = O(n^1.40704) time in total, while we reduce batched path mode/least frequent element query to the min-plus-query-witness problem so that we can answer a batch of n queries in Õ(n^{{24+2ω}/{17+ω}}) = O(n^1.483814) time. Previously, both problems could only be solved in Õ(n^1.5) time. Based on similar techniques, we design a dynamic colored path counting structure supporting both queries and updates in Õ(n^{{ω+1}/{ω+3}}) = O(n^0.627759) time, while our dynamic path mode/least frequent element query structures support each operation in Õ(n^{{16+ω(1,2,1)}/{26+ω(1,2,1)}}) = O(n^0.658139) time, where ω(1, 2, 1) denotes the minimum value such that the product of an n × n² matrix and an n² × n matrix can be computed in O(n^{ω(1, 2, 1)+ε}) time for any constant ε > 0. We also solve batched range mode/least frequent element query problems over arrays in Õ(n^{{18+2ω}/{13+ω}}) = O(n^1.479603) time. Both problems can be viewed as special cases of these batched path queries, and previously, the fastest algorithm for batched range mode queries and batched range least frequent element queries use O(n^1.4805) and Õ(n^1.5) time, respectively.

Subject Classification

ACM Subject Classification
  • Theory of computation → Data structures design and analysis
  • Information systems → Data structures
Keywords
  • min-plus product
  • range mode queries
  • range least frequent queries
  • path queries
  • colored path counting
  • path mode queries
  • path least frequent queries

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads

References

  1. Josh Alman and Virginia Vassilevska Williams. A refined laser method and faster matrix multiplication. In Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 522-539. SIAM, 2021. Google Scholar
  2. Stephen Alstrup and Jacob Holm. Improved algorithms for finding level ancestors in dynamic trees. In International Colloquium on Automata, Languages, and Programming, pages 73-84. Springer, 2000. Google Scholar
  3. Djamal Belazzougui, Fabio Cunial, Juha Kärkkäinen, and Veli Mäkinen. Linear-time string indexing and analysis in small space. ACM Transactions on Algorithms (TALG), 16(2):1-54, 2020. Google Scholar
  4. Djamal Belazzougui and Gonzalo Navarro. Optimal lower and upper bounds for representing sequences. ACM Transactions on Algorithms (TALG), 11(4):1-21, 2015. Google Scholar
  5. Gerth Stølting Brodal, Pooya Davoodi, and S Srinivasa Rao. Path minima queries in dynamic weighted trees. In Workshop on Algorithms and Data Structures, pages 290-301. Springer, 2011. Google Scholar
  6. Timothy M Chan, Stephane Durocher, Kasper Green Larsen, Jason Morrison, and Bryan T Wilkinson. Linear-space data structures for range mode query in arrays. Theory of Computing Systems, 55(4):719-741, 2014. Google Scholar
  7. Timothy M Chan, Stephane Durocher, Matthew Skala, and Bryan T Wilkinson. Linear-space data structures for range minority query in arrays. Algorithmica, 4(72):901-913, 2015. Google Scholar
  8. Timothy M Chan, Meng He, J Ian Munro, and Gelin Zhou. Succinct indices for path minimum, with applications. Algorithmica, 78(2):453-491, 2017. Google Scholar
  9. Bernard Chazelle. Computing on a free tree via complexity-preserving mappings. Algorithmica, 2(1):337-361, 1987. Google Scholar
  10. Erik D Demaine, Gad M Landau, and Oren Weimann. On cartesian trees and range minimum queries. In International Colloquium on Automata, Languages, and Programming, pages 341-353. Springer, 2009. Google Scholar
  11. Stephane Durocher, Rahul Shah, Matthew Skala, and Sharma V Thankachan. Linear-space data structures for range frequency queries on arrays and trees. Algorithmica, 74(1):344-366, 2016. Google Scholar
  12. Hicham El-Zein, Meng He, J Ian Munro, and Bryce Sandlund. Improved time and space bounds for dynamic range mode. In 26th Annual European Symposium on Algorithms (ESA 2018). Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 2018. Google Scholar
  13. Travis Gagie, Meng He, Gonzalo Navarro, and Carlos Ochoa. Tree path majority data structures. Theoretical Computer Science, 833:107-119, 2020. Google Scholar
  14. Travis Gagie, Juha Kärkkäinen, Gonzalo Navarro, and Simon J Puglisi. Colored range queries and document retrieval. Theoretical Computer Science, 483:36-50, 2013. Google Scholar
  15. Younan Gao and Meng He. Space efficient two-dimensional orthogonal colored range counting. In Petra Mutzel, Rasmus Pagh, and Grzegorz Herman, editors, 29th Annual European Symposium on Algorithms, ESA 2021, September 6-8, 2021, Lisbon, Portugal (Virtual Conference), volume 204 of LIPIcs, pages 46:1-46:17. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2021. URL: https://doi.org/10.4230/LIPIcs.ESA.2021.46.
  16. Roberto Grossi and Søren Vind. Colored range searching in linear space. In Scandinavian Workshop on Algorithm Theory, pages 229-240. Springer, 2014. Google Scholar
  17. Yuzhou Gu, Adam Polak, Virginia Vassilevska Williams, and Yinzhan Xu. Faster monotone min-plus product, range mode, and single source replacement paths. In Nikhil Bansal, Emanuela Merelli, and James Worrell, editors, 48th International Colloquium on Automata, Languages, and Programming, ICALP 2021, July 12-16, 2021, Glasgow, Scotland (Virtual Conference), volume 198 of LIPIcs, pages 75:1-75:20. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2021. URL: https://doi.org/10.4230/LIPIcs.ICALP.2021.75.
  18. Prosenjit Gupta, Ravi Janardan, and Michiel Smid. Further results on generalized intersection searching problems: counting, reporting, and dynamization. Journal of Algorithms, 19(2):282-317, 1995. Google Scholar
  19. Prosenjit Gupta, Ravi Janardan, and Michiel Smid. Algorithms for generalized halfspace range searching and other intersection searching problems. Computational Geometry, 6(1):1-19, 1996. Google Scholar
  20. Yijie Han. Deterministic sorting in o (n log log n) time and linear space. In Proceedings of the thiry-fourth annual ACM symposium on Theory of computing, pages 602-608, 2002. Google Scholar
  21. Meng He and Serikzhan Kazi. Data structures for categorical path counting queries. In 32nd Annual Symposium on Combinatorial Pattern Matching (CPM 2021). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2021. Google Scholar
  22. Meng He, J Ian Munro, and S Srinivasa Rao. Succinct ordinal trees based on tree covering. In International Colloquium on Automata, Languages, and Programming, pages 509-520. Springer, 2007. Google Scholar
  23. Meng He, J Ian Munro, and Gelin Zhou. A framework for succinct labeled ordinal trees over large alphabets. Algorithmica, 70(4):696-717, 2014. Google Scholar
  24. Meng He, J Ian Munro, and Gelin Zhou. Data structures for path queries. ACM Transactions on Algorithms (TALG), 12(4):1-32, 2016. Google Scholar
  25. Meng He, J Ian Munro, and Gelin Zhou. Dynamic path queries in linear space. Algorithmica, 80(12):3728-3765, 2018. Google Scholar
  26. David Hutchinson, Anil Maheshwari, and Norbert Zeh. An external memory data structure for shortest path queries. Discrete Applied Mathematics, 126(1):55-82, 2003. Google Scholar
  27. Ce Jin and Yinzhan Xu. Tight dynamic problem lower bounds from generalized bmm and omv. arXiv preprint arXiv:2202.11250, 2022. Google Scholar
  28. Camille Jordan. Sur les assemblages de lignes. Journal für die reine und angewandte Mathematik, 70:185-190, 1869. URL: http://eudml.org/doc/148084.
  29. Haim Kaplan, Natan Rubin, Micha Sharir, and Elad Verbin. Efficient colored orthogonal range counting. SIAM Journal on Computing, 38(3):982-1011, 2008. Google Scholar
  30. Haim Kaplan and Nira Shafrir. Path minima in incremental unrooted trees. In European Symposium on Algorithms, pages 565-576. Springer, 2008. Google Scholar
  31. Haim Kaplan, Micha Sharir, and Elad Verbin. Colored intersection searching via sparse rectangular matrix multiplication. In Proceedings of the twenty-second annual symposium on Computational geometry, pages 52-60, 2006. Google Scholar
  32. Danny Krizanc, Pat Morin, and Michiel Smid. Range mode and range median queries on lists and trees. Nordic Journal of Computing, 12(1):1-17, 2005. Google Scholar
  33. J Ian Munro, Yakov Nekrich, and Sharma V Thankachan. Range counting with distinct constraints. In CCCG, 2015. Google Scholar
  34. Yakov Nekrich. Efficient range searching for categorical and plain data. ACM Transactions on Database Systems (TODS), 39(1):1-21, 2014. Google Scholar
  35. Manish Patil, Rahul Shah, and Sharma V Thankachan. Succinct representations of weighted trees supporting path queries. Journal of Discrete Algorithms, 17:103-108, 2012. Google Scholar
  36. Bryce Sandlund and Yinzhan Xu. Faster dynamic range mode. In 47th International Colloquium on Automata, Languages, and Programming (ICALP 2020). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2020. Google Scholar
  37. Virginia Vassilevska Williams and Yinzhan Xu. Truly subcubic min-plus product for less structured matrices, with applications. In Proceedings of the Fourteenth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 12-29. SIAM, 2020. Google Scholar
  38. Huacheng Yu. An improved combinatorial algorithm for boolean matrix multiplication. Information and Computation, 261:240-247, 2018. Google Scholar
Questions / Remarks / Feedback
X

Feedback for Dagstuhl Publishing


Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail