Skip to main content

Dynamic Path Counting and Reporting in Linear Space

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 8889))

Abstract

In the path reporting problem, we preprocess a tree on \(n\) nodes each of which is assigned a weight, such that given an arbitrary path and a weight range, we can report the nodes whose weights are within the range. We consider this problem in dynamic settings, and propose the first non-trivial linear-space solution that supports path reporting in \(O((\lg n / \lg \lg n)^2 + occ \lg n / \lg \lg n)\) time, where \(occ\) is the output size, and the insertion and deletion of a node of an arbitrary degree in \(O(\lg ^{2+\epsilon } n)\) amortized time, for any constant \(\epsilon \in (0, 1)\). Obvious solutions based on directly dynamizing solutions to the static version of this problem all require \(\Omega ((\lg n / \lg \lg n)^2)\) time for each node reported, and thus our query time is much faster. For the counting version of this problem, we design a structure that supports path counting in \(O((\lg n / \lg \lg n)^2)\) time, and insertion and deletion in \(O((\lg n / \lg \lg n)^2)\) amortized time. This matches the current best result for 2D dynamic range counting, which can be viewed as a special case of path counting.

This work was supported by NSERC and the Canada Research Chairs Program.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Alstrup, S., Holm, J.: Improved algorithms for finding level ancestors in dynamic trees. In: Welzl, E., Montanari, U., Rolim, J.D.P. (eds.) ICALP 2000. LNCS, vol. 1853, p. 73. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  2. Alstrup, S., Husfeldt, T., Rauhe, T.: Marked ancestor problems. In: FOCS, pp. 534–544 (1998)

    Google Scholar 

  3. Arge, L., Vitter, J.S.: Optimal external memory interval management. SIAM Journal on Computing 32(6), 1488–1508 (2003)

    Article  MATH  MathSciNet  Google Scholar 

  4. Bille, P.: A survey on tree edit distance and related problems. Theor. Comput. Sci. 337(1–3), 217–239 (2005)

    Article  MATH  MathSciNet  Google Scholar 

  5. Brodal, G.S., Davoodi, P., Srinivasa Rao, S.: Path minima queries in dynamic weighted trees. In: Dehne, F., Iacono, J., Sack, J.-R. (eds.) WADS 2011. LNCS, vol. 6844, pp. 290–301. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  6. Chan, T.M., He, M., Munro, J.I., Zhou, G.: Succinct indices for path minimum, with applications to path reporting. In: Schulz, A.S., Wagner, D. (eds.) ESA 2014. LNCS, vol. 8737, pp. 247–259. Springer, Heidelberg (2014)

    Chapter  Google Scholar 

  7. Chazelle, B.: Computing on a free tree via complexity-preserving mappings. Algorithmica 2, 337–361 (1987)

    Article  MATH  MathSciNet  Google Scholar 

  8. Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 3rd edn. MIT Press (2009)

    Google Scholar 

  9. Frederickson, G.N.: Data structures for on-line updating of minimum spanning trees, with applications. SIAM J. Comput. 14(4), 781–798 (1985)

    Article  MATH  MathSciNet  Google Scholar 

  10. Frederickson, G.N.: Ambivalent data structures for dynamic 2-edge-connectivity and k smallest spanning trees. SIAM J. Comput. 26(2), 484–538 (1997)

    Article  MATH  MathSciNet  Google Scholar 

  11. Frederickson, G.N.: A data structure for dynamically maintaining rooted trees. J. Algorithms 24(1), 37–65 (1997)

    Article  MATH  MathSciNet  Google Scholar 

  12. He, M., Munro, J.I.: Space efficient data structures for dynamic orthogonal range counting. Comput. Geom. 47(2), 268–281 (2014)

    Article  MATH  MathSciNet  Google Scholar 

  13. He, M., Munro, J.I., Satti, S.R.: Succinct ordinal trees based on tree covering. ACM Transactions on Algorithms 8(4), 42 (2012)

    Article  MathSciNet  Google Scholar 

  14. He, M., Munro, J.I., Zhou, G.: Path queries in weighted trees. In: Asano, T., Nakano, S., Okamoto, Y., Watanabe, O. (eds.) ISAAC 2011. LNCS, vol. 7074, pp. 140–149. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  15. He, M., Munro, J.I., Zhou, G.: Succinct data structures for path queries. In: Epstein, L., Ferragina, P. (eds.) ESA 2012. LNCS, vol. 7501, pp. 575–586. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  16. He, M., Munro, J.I., Zhou, G.: A framework for succinct labeled ordinal trees over large alphabets. Algorithmica (to appear, 2014)

    Google Scholar 

  17. Kaplan, H., Shafrir, N.: Path minima in incremental unrooted trees. In: Halperin, D., Mehlhorn, K. (eds.) ESA 2008. LNCS, vol. 5193, pp. 565–576. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  18. Krizanc, D., Morin, P., Smid, M.H.M.: Range mode and range median queries on lists and trees. Nord. J. Comput. 12(1), 1–17 (2005)

    MATH  MathSciNet  Google Scholar 

  19. Navarro, G., Nekrich, Y.: Optimal dynamic sequence representations. In: SODA, pp. 865–876 (2013)

    Google Scholar 

  20. Navarro, G., Sadakane, K.: Fully functional static and dynamic succinct trees. ACM Transactions on Algorithms 10(3), 16 (2014)

    Article  MathSciNet  Google Scholar 

  21. Patil, M., Shah, R., Thankachan, S.V.: Succinct representations of weighted trees supporting path queries. J. Discrete Algorithms 17, 103–108 (2012)

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Gelin Zhou .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

He, M., Munro, J.I., Zhou, G. (2014). Dynamic Path Counting and Reporting in Linear Space. In: Ahn, HK., Shin, CS. (eds) Algorithms and Computation. ISAAC 2014. Lecture Notes in Computer Science(), vol 8889. Springer, Cham. https://doi.org/10.1007/978-3-319-13075-0_45

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-13075-0_45

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-13074-3

  • Online ISBN: 978-3-319-13075-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics