Jeffrey Blessing
2. Compute T, the maximum spanning tree of R
3.8 A PPENDIX .1 Proof of Algorithm 1
Algorithm 1 is a marking algorithm which deals with marked and unmarked nodes. Initially, all nodes are unmarked. One way to see how the algorithm works is to view all marked nodes as one super-node. When nodes become marked in step 3, the unmarked node u is merged with the super-node Vs..t to form a slightly larger super-node Vs..u. The tree formed by merging nodes in T forms a slightly smaller tree TΝ. The algorithm, therefore, only needs to check for the maximum edge incident to the super-node to determine the next edge-node pair to append to L.
To prove that the algorithm is correct, one needs to show that merging two neighboring nodes, i and j, to form TΝ will not affect the maximum flow between either i or j and the rest of T. Let {N} be the set of nodes in tree T. Let {N–i} be the set of nodes in T, omitting node i. Similarly, {N–i–j} would be the set of nodes in {N}, omitting nodes i and j. Let Vi..j
be the super-node formed by merging i and j in T. Finally, let TΝ be the tree that remains after merging i and j in T.
Theorem 1
Merging two neighboring nodes, i and j, in tree T will not affect the edges in the cut separating Vi..j and {N–i–j}.
Proof of Theorem 1
For two neighbors, i and j, in tree T, the edge (i, j) is unique in T. Vi..j will have the same incident edges in TΝ as those incident to i in T, plus those incident to j in T, minus the edge (i, j). Other edges which are not incident to i or j are unaffected by the merge. Since merging i and j will only omit edge (i, j) from T, the edges incident to {i, j} in TΝ will preserve the capacities between Vi..j and {N–i–j} in T.Once the edge (i, j) is present in L, it can be removed from T (via merging) without affecting other cuts in T.
Theorem 2
In Algorithm 1, L is flow equivalent to T.
Consider the following inductive argument:
Base case
Starting at any node i, let (i, j) be the maximum capacity edge incident to i. This is the first edge in L. Since there is only one path in T between i and j, and that path consists of a single edge (i, j), the flow between i and j in T equals the flow between i and j in L.
Induction step
Assume, after k iterations, Lk is flow equivalent to the subset of T formed by the nodes in Vi..k and the edges from T which connect nodes i..k (i.e. the marked nodes in the super-node).
To prove Theorem 2, it must be shown that Lk+1 is flow equivalent to the subset of T formed by the nodes in the expanded super-node Vi..k+1 .
Proof of Theorem 2
In constructing Lk , the original tree, T, has been modified to state TkΝ, which consists of one super-node, Vi..k , and n–k–1 edges from T connecting it to {N–Vi..k}. The algorithm selects the next edge in Lk to be the maximum edge incident to Vi..k. Call this edge (k, l) where k∈Vi..k and l∈{N–Vi..k}. Notice that k is a marked node and l an unmarked node.
Since marked nodes in T are adjacent to one another, any unmarked node can have, at most, one marked neighbor. The only marked neighbor of l is k. Clearly, the capacity of (k, l) is the upper bound on flow between k and l. If l tries to send flow to any other marked node, the flow must go through edge (k, l). So the capacity of edge (k, l) is an upper bound on the amount of flow l c an send to any node in Vi..k . By the inductive hypothesis, Lk is flow equivalent to the subset of T formed by nodes in Vi..k and their connecting edges. Since Lk+1
is Lk with edge (k, l) and node l appended to the end, Lk+1 is flow equivalent to the subset of T formed by the nodes in Vi..k+l .
Theorem 3
Every connected, undirected graph is flow equivalent to a linear graph.
Proof of Theorem 3
Gomory and Hu (1961) have shown that every connected, undirected graph, G, is flow equivalent to a tree, T. Theorem 2 proves that every tree is flow equivalent to a linear graph.
Let T be the Gomory-Hu cut tree. Applying the above algorithm to T will always produce a corresponding linear graph, L, which is flow equivalent to G. Therefore, every connected,
undirected graph, G, is flow equivalent to a linear graph, L.
3.8.2 Time Complexity
Every tree of n nodes contains exactly n–1 edges (Sedgewick, 1988). The worst case for producing L from T is a cut tree where all n–1 edges are incident to the root. This will cause the algorithm to consider all the edges in T at once. Step 2 in the algorithm is the most time consuming operation in the loop and is thus the upper bound on calculating time complexity. Since the root is the starting node in the algorithm, n–2 comparisons must be made to determine the maximum edge incident to the root. The algorithm then marks the node neighboring the root and the edge between them is removed from future consideration.
This, in effect, expands the super-node. The second pass makes n–3 comparisons to find the maximum incident edge, the third makes n–4 comparisons, and so forth, until all n–1 edges have been added to L. The total number of comparisons is thus O(n2).
A simple improvement to the algorithm is to store each edge, considered in step 2, in a priority queue or heap. Using a max_heap, the time needed to produce L from T is bounded by the time to do n–1 inserts and n–1 delete_max operations. The insert and delete_max operations on heaps each require O(log n) time (Sedgewick, 1988). Thus, the total run time is 2·(n–1)·log n , which is O(n log n).