
Dynamic Trees D 263
are used to maintain a forest of arcs with positive resid-
ual capacity. As soon as the source s and the sink t be-
come part of the same tree, the algorithm sends as much
flow as possible along the s-t path; this reduces to zero
the residual capacity of at least one arc, which is then cut
from the tree. Several maximum flow and minimum-cost
flow algorithms incorporating dynamic trees have been
proposed ever since (some examples are [9,15]). Dynamic
tree data structures, especially those based on tree contrac-
tion, are also commonly used within dynamic graph algo-
rithms, such as the dynamic versions of minimum span-
ning trees [6,10], connectivity [10], biconnectivity [6], and
bipartiteness [10]. Other applications include the evalua-
tion of dynamic expression trees [8] and standard graph
algorithms [13].
Experimental Resul t s
Several studies have compared the performance of differ-
ent dynamic-tree data structures; in most cases, ST-trees
implemented with splay trees are the fastest alternative.
Frederickson, for example, found that topology trees take
almost 50% more time than splay-based ST-trees when ex-
ecuting dynamic tree operations within a maximum flow
algorithm [8]. Acar et al. [2] have shown that RC-trees are
significantly slower than splay-based ST-trees when most
operations are links and cuts (such as in network flow al-
gorithms), but faster when queries and value updates are
dominant. The reason is that splaying changes the struc-
ture of ST-trees even during queries, while RC-trees re-
main unchanged.
Tarjan and Werneck [17] have presented an exper-
imental comparison of several dynamic tree data struc-
tures. For random sequences of links and cuts, splay-based
ST-trees are the fastest alternative,followed by splay-based
ET-trees, self-adjusting top trees, worst-case top trees,
and RC-trees. Similar relative performance was observed
in more realistic sequences of operations, except when
queries far outnumber structural operations; in this case,
the self-adjusting data structures are slower than RC-trees
and worst-case top trees. The same experimental study
also considered the “obvious” implementation of ST-trees,
which represents the forest explicitly and require linear
time per operation in the worst case. Its simplicity makes it
significantly faster than the O(log n)-time data structures
for path-related queries and updates, unless paths are hun-
dred nodes long. The sophisticated solutions are more use-
ful when the underlying forest has high diameter or there
is a need to aggregate information over trees (and not only
paths).
Cross References
Fully Dynamic Connectivity
Fully Dynamic Connectivity: Upper and Lower Bounds
Fully Dynamic Higher Connectivity
Fully Dynamic Higher Connectivity for Planar Graphs
Fully Dynamic Minimum Spanning Trees
Fully Dynamic Planarity Testing
Lower Bounds for Dynamic Connectivity
Routing
Recommended Reading
1. Acar, U.A., Blelloch, G.E., Harper, R., Vittes, J.L., Woo, S.L.M.: Dy-
namizing static algorithms, with applications to dynamic trees
and history independence. In: Proceedings of the 15th An-
nual ACM-SIAM Symposium on Discrete Algorithms (SODA),
pp. 524–533. SIAM (2004)
2. Acar, U.A., Blelloch, G.E., Vittes, J.L.: An experimental analysis
of change propagation in dynamic trees. In: Proceedings of
the 7th Workshop on Algorithm Engineering and Experiments
(ALENEX), pp. 41–54 (2005)
3. Alstrup,S.,Holm,J.,deLichtenberg,K.,Thorup,M.:Minimiz-
ing diameters of dynamic trees. In: Proceedings of the 24th
International Colloquium on Automata, Languages and Pro-
gramming (ICALP), Bologna, Italy, 7–11 July 1997. Lecture
Notes in Computer Science, vol. 1256, pp. 270–280. Springer
(1997)
4. Alstrup, S., Holm, J.,Thorup, M., de Lichtenberg, K.: Maintaining
information in fully dynamic trees with top trees. ACM Trans.
Algorithms 1(2), 243–264 (2005)
5. Bent, S.W., Sleator, D.D., Tarjan, R.E.: Biased search trees. SIAM
J. Comput. 14(3), 545–568 (1985)
6. Frederickson, G.N.: Data structures for on-line update of mini-
mum spanning trees, with applications.SIAM J. Comput. 14(4),
781–798 (1985)
7. Frederickson, G.N.: Ambivalent data structures for dynamic 2-
edge-connectivity and k smallest spanning trees. SIAM J. Com-
put. 26(2), 484–538 (1997)
8. Frederickson, G.N.: A data structure for dynamically maintain-
ing rooted trees. J. Algorithms 24(1), 37–65 (1997)
9. Goldberg, A.V., Grigoriadis, M.D., Tarjan, R.E.: Use of dynamic
trees in a network simplex algorithm for the maximum flow
problem. Math. Progr. 50, 277–290 (1991)
10. Henzinger, M.R., King, V.: Randomized fully dynamic graph al-
gorithms with polylogarihmic time per operation. In: Proceed-
ings of the 27th Annual ACM Symposium on Theory of Com-
puting (STOC), pp. 519–527 (1997)
11. Miller, G.L., Reif, J.H.: Parallel tree contraction and its appli-
cations. In: Proceedings of the 26th Annual IEEE Symposium
on Foundations of Computer Science (FOCS), pp. 478–489
(1985)
12. P˘atra¸scu, M., Demaine, E.D.: Lower bounds for dynamic con-
nectivity. In: Proceedings of the 36th Annual ACM Symposium
on Theory of Computing (STOC), pp. 546–553 (2004)
13. Sleator, D.D., Tarjan, R.E.: A data structure for dynamic trees.
J. Comput. Syst. Sci. 26(3), 362–391 (1983)
14. Sleator, D.D., Tarjan, R.E.: Self-adjusting binary search trees.
J. ACM 32(3), 652–686 (1985)