Dynamic Trees in Practice

  • Robert E. Tarjan
  • Renato F. Werneck
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4525)


Dynamic tree data structures maintain forests that change over time through edge insertions and deletions. Besides maintaining connectivity information in logarithmic time, they can support aggregation of information over paths, trees, or both. We perform an experimental comparison of several versions of dynamic trees: ST-trees, ET-trees, RC-trees, and two variants of top trees (self-adjusting and worst-case). We quantify their strengths and weaknesses through tests with various workloads, most stemming from practical applications. We observe that a simple, linear-time implementation is remarkably fast for graphs of small diameter, and that worst-case and randomized data structures are best when queries are very frequent. The best overall performance, however, is achieved by self-adjusting ST-trees.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. Acar, U.A., Blelloch, G.E., Harper, R., Vittes, J.L., Woo, S.L.M.: Dynamizing static algorithms, with applications to dynamic trees and history independence. In: Proc. 15th SODA, pp. 524–533, (2004)Google Scholar
  2. Acar, U.A., Blelloch, G.E., Vittes, J.L.: An experimental analysis of change propagation in dynamic trees. In: Proc. 7th ALENEX, pp. 41–54 (2005)Google Scholar
  3. Ahuja, R., Magnanti, T., Orlin, J.: Network Flows: Theory, algorithms, and applications. Prentice-Hall, Englewood Cliffs (1993)Google Scholar
  4. Alstrup, S., Holm, J., de Lichtenberg, K., Thorup, M.: Minimizing diameters of dynamic trees. In: Degano, P., Gorrieri, R., Marchetti-Spaccamela, A. (eds.) ICALP 1997. LNCS, vol. 1256, pp. 270–280. Springer, Heidelberg (1997)Google Scholar
  5. Alstrup, S., Holm, J., Thorup, M.: On the power and speed of top trees. Unpublished manuscript (1999)Google Scholar
  6. Alstrup, S., Holm, J., Thorup, M., de Lichtenberg, K.: Maintaining information in fully dynamic trees with top trees. ACM TALG 1(2), 243–264 (2005)CrossRefGoogle Scholar
  7. Anderson, R.: The washington graph generator. In: Johnson, D.S., McGeoch, C.C.: (eds.), DIMACS Series in Discrete Mathematics and Computer Science, pp. 580–581. AMS (1993)Google Scholar
  8. Bellman, R.: On a routing problem. Quarterly Mathematics 16, 87–90 (1958)Google Scholar
  9. Cattaneo, G., Faruolo, P., Ferraro-Petrillo, U., Italiano, G.F.: Maintaining dynamic minimum spanning trees: An experimental study. In: Paliouras, G., Karkaletsis, V., Spyropoulos, C.D. (eds.) Machine Learning and Its Applications. LNCS (LNAI), vol. 2049, pp. 111–125. Springer, Heidelberg (2002)Google Scholar
  10. Edmonds, J., Karp, R.M.: Theoretical improvements in algorithmic efficiency for network flow problems. JACM 19, 248–264 (1972)MATHCrossRefGoogle Scholar
  11. Frederickson, G.N.: Data structures for on-line update of minimum spanning trees, with applications. SIAM J. Comp. 14(4), 781–798 (1985)MATHCrossRefMathSciNetGoogle Scholar
  12. Frederickson, G.N.: Ambivalent data structures for dynamic 2-edge-connectivity and k smallest spanning trees. SIAM J. Comp. 26(2), 484–538 (1997)MATHCrossRefMathSciNetGoogle Scholar
  13. Frederickson, G.N.: A data structure for dynamically maintaining rooted trees. J. Alg. 24(1), 37–65 (1997)MATHCrossRefMathSciNetGoogle Scholar
  14. Goldberg, A.V., Grigoriadis, M.D., Tarjan, R.E.: Use of dynamic trees in a network simplex algorithm for the maximum flow problem. Mathematical Programming 50, 277–290 (1991)MATHCrossRefMathSciNetGoogle Scholar
  15. Henzinger, M.R., King, V.: Randomized fully dynamic graph algorithms with polylogarihmic time per operation. In: Proc. 29th STOC, pp. 519–527 (1997)Google Scholar
  16. Kaplan, H., Molad, E., Tarjan, R.E.: Dynamic rectangular intersection with priorities. In: Proc. 35th STOC, pp. 639–648 (2003)Google Scholar
  17. Klein, P.N.: Multiple-source shortest paths in planar graphs. In: Proc. 16th SODA, pp. 146–155 (2005)Google Scholar
  18. Langerman, S.: On the shooter location problem: Maintaining dynamic circular-arc graphs. In: Proc. 12th CCCG, pp. 29–35 (2000)Google Scholar
  19. Miller, G.L., Reif, J.H.: Parallel tree contraction and its applications. In: Proc. 26th FOCS, pp. 478–489 (1985)Google Scholar
  20. Radzik, T.: Implementation of dynamic trees with in-subtree operations. ACM JEA, 3(9) (1998)Google Scholar
  21. Ribeiro, C.C., Toso, R.F.: Experimental analysis of algorithms for updating minimum spanning trees on graphs subject to changes on edge weights. In: Proc. 6th WEA, pp. 393–405, (2007)Google Scholar
  22. Sleator, D.D., Tarjan, R.E.: A data structure for dynamic trees. JCSS 26(3), 362–391 (1983)MATHMathSciNetGoogle Scholar
  23. Sleator, D.D., Tarjan, R.E.: Self-adjusting binary search trees. JACM 32(3), 652–686 (1985)MATHCrossRefMathSciNetGoogle Scholar
  24. Tarjan, R.E.: Data Structures and Network Algorithms. SIAM Press (1983)Google Scholar
  25. Tarjan, R.E.: Dynamic trees as search trees via Euler tours, applied to the network simplex algorithm. Mathematical Programming 78, 169–177 (1997)MathSciNetGoogle Scholar
  26. Tarjan, R.E., Werneck, R.F.: Self-adjusting top trees. In: Proc. 16th SODA, pp. 813–822 (2005)Google Scholar
  27. Werneck, R.F.: Design and Analysis of Data Structures for Dynamic Trees. PhD thesis, Princeton University (2006)Google Scholar
  28. Zaroliagis, C.D.: Implementations and experimental studies of dynamic graph algorithms. In: Fleischer, R., Moret, B., Schmidt, E.M. (eds.) Experimental Algorithms: From Algorithm Design to Robust and Efficient Software. LNCS, pp. 229–278. Springer, Heidelberg (2002)Google Scholar

Copyright information

© Springer Berlin Heidelberg 2007

Authors and Affiliations

  • Robert E. Tarjan
    • 1
    • 2
  • Renato F. Werneck
    • 3
  1. 1.Department of Computer Science, Princeton University, Princeton, NJ 08544USA
  2. 2.Hewlett-Packard Laboratories, 1501 Page Mill Rd., Palo Alto, CA 94304USA
  3. 3.Microsoft Research Silicon Valley, 1065 La Avenida, Mountain View, CA 94043USA

Personalised recommendations