A data structure for dynamic trees

We propose a data structure to maintain a collection of vertex-disjoint trees under a sequence of two kinds of operations: a link operation that combines two trees into one by adding an edge, and a cut operation that divides one tree into two by deleting an edge. Our data structure requires O(log n) time per operation when the time is amortized over a sequence of operations. Using our data structure, we obtain new fast algorithms for the following problems: (1) Computing deepest common ancestors. (2) Solving various network flow problems including finding maximum flows, blocking flows, and acyclic flows. (3) Computing certain kinds of constrained minimum spanning trees. (4) Implementing the network simplex algorithm for the transshipment problem. Our most significant application is (2); we obtain an O(mn log n)-time algorithm to find a maximum flow in a network of n vertices and m edges, beating by a factor of log n the fastest algorithm previously known for sparse graphs.

[1]  Y. Shiloach An O($n\cdot I \log^2 I$) maximum-flow algorithm , 1978 .

[2]  Jeffrey D. Ullman,et al.  Set Merging Algorithms , 1973, SIAM J. Comput..

[3]  Robert E. Tarjan,et al.  Efficient algorithms for simple matroid intersection problems , 1979, 20th Annual Symposium on Foundations of Computer Science (sfcs 1979).

[4]  E. A. Dinic Algorithm for solution of a problem of maximal flow in a network with power estimation , 1970 .

[5]  Leonidas J. Guibas,et al.  A dichromatic framework for balanced trees , 1978, 19th Annual Symposium on Foundations of Computer Science (sfcs 1978).

[6]  Amnon Naamad,et al.  Network flow and generalized path compression , 1979, STOC.

[7]  David Maier,et al.  An Efficient Method for Storing Ancestor Information in Trees , 1979, SIAM J. Comput..

[8]  Amnon Naamad,et al.  An O(EVlog²V) Algorithm for the Maximal Flow Problem , 1980, J. Comput. Syst. Sci..

[9]  Robert E. Tarjan,et al.  Self-adjusting binary trees , 1983, STOC.

[10]  Edsger W. Dijkstra,et al.  A Discipline of Programming , 1976 .

[11]  Dov Harel,et al.  A linear time algorithm for the lowest common ancestors problem , 1980, 21st Annual Symposium on Foundations of Computer Science (sfcs 1980).

[12]  Donald E. Knuth,et al.  The art of computer programming: sorting and searching (volume 3) , 1973 .

[13]  Zvi Galil,et al.  A new algorithm for the maximal flow problem , 1978, 19th Annual Symposium on Foundations of Computer Science (sfcs 1978).

[14]  Donald E. Knuth,et al.  The Art of Computer Programming, Vol. 3: Sorting and Searching , 1974 .

[15]  D. Sleator An 0 (nm log n) algorithm for maximum network flow , 1980 .

[16]  Edward M. Reingold,et al.  Binary Search Trees of Bounded Balance , 1973, SIAM J. Comput..

[17]  Robert E. Tarjan,et al.  Applications of Path Compression on Balanced Trees , 1979, JACM.

[18]  Richard M. Karp,et al.  Theoretical Improvements in Algorithmic Efficiency for Network Flow Problems , 1972, Combinatorial Optimization.

[19]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

[20]  Robert E. Tarjan,et al.  Efficiency of a Good But Not Linear Set Union Algorithm , 1972, JACM.

[21]  A. V. Karzanov,et al.  Determining the maximal flow in a network by the method of preflows , 1974 .

[22]  Alfred V. Aho,et al.  On finding lowest common ancestors in trees , 1973, SIAM J. Comput..

[23]  Edward M. Reingold,et al.  Binary search trees of bounded balance , 1972, SIAM J. Comput..

[24]  Robert E. Tarjan,et al.  Biased 2-3 trees , 1980, 21st Annual Symposium on Foundations of Computer Science (sfcs 1980).