%Algorithm of Ford-Fulkerson for finding maximum feasible flow in network. %start with zero flow, iterate augment until no more improvements found, then return %current flow. %usage F = ff(n,C,s,t,outlevel) function F = ff(n,C,s,t,outlevel) %add your code here! P = augment(n,C,F,s,t,outlevel-1); if outlevel>2, display(P); end; if outlevel>0, display(F); end; %find augmenting path P for given flow F in network C with %n vertices, source s, sink t. %if no augmenting path exists, return some list that does not end with t. %usage P=augment(n,C,F,s,t,outlevel) function P=augment(n,C,F,s,t,outlevel) %add your code here! if outlevel>0, display(P); end;