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]  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).

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[20]  Robert E. Tarjan,et al.  Data structures and network algorithms , 1983, CBMS-NSF regional conference series in applied mathematics.

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

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

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