The preceding residual graph has no path from s to t. Thus the algorithm terminates. The final flow
graph, which carries 11 units, is as follows:
9.12 Let T be the tree with root r, and children r1, r2, . . . , rk, which are the roots of T1, T2, . . . , Tk, which have
maximum incoming flow of c1, c2, . . . , ck, respectively. By the problem statement, we may take the
If T is a leaf, then findMaxFlow returns incomingCap since we have assumed a sink of infinite capacity.
Otherwise, a standard postorder traversal can be used to compute the maximum flow in linear time.
// FlowType is an int or double
static FlowType findMaxFlow( Tree T, FlowType incomingCap )