Lecture 16: More Network Flow
Ford-Fulkerson Algorithm:
ford_fulkerson(G, s, t, capacity):
f[e] = 0 for all e
while there exists an s -> t path in the residual graph
choose a path p
f = augment(f, p)
update residual graph
Endwhile
augment(f, path):
c = lowest capacity on path
for each edge e on path
if e if a forward edge
f[e] += c
if e is a backwards edge
f[e] -= c
Endfor
Termination:
Every time we find a path, the flow on s increases by at least 1 each time (assuming integer capacities). There is also a maximum possible flow from s, equal to C = sum( ce ) of e out of s = fout(s). We can find a path at most C times, so the total time = O( C * work to find and update path) = O(m*C).
Application: Bipartite Matching:
A Bipartite Matching is defined as V= X + Y where X & Y = {} and for all edges (a, b) in V, a is in X and b is in Y. Imagine wanting to assign people and tasks. You can create a network flow diagram for this:

Here, we draw an edge between a person and a task iff that person can perform said task. Then, running the flow algorithm will assign 1 person to every task, or find the best possible match. This runs in O(m*n) time, where m is the number of edges and n is the number of vertices.
This entry was posted on Monday, February 28th, 2005 at 4:32 pm and is tagged with ford fulkerson, flow algorithm, nbsp nbsp nbsp nbsp nbsp, network flow, c times, forward edge, flow diagram, c application, fout, graph, match, ford. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback.
2 Responses to 'Lecture 16: More Network Flow'
Leave a Reply
Please take time to enjoy the archives: May 2005 (1) April 2005 (11) March 2005 (11) February 2005 (15) January 2005 (7)
Fresh, related resources:
- Spliced feed for the My Way, The Entrepreneur Network network
(A great example is the 12-week Dale Carnegie "Effective Communications & Human Relations" course, in which you actually practice public speaking and working with others more effectively.) In my opinion, most lecture-based courses over ... - The Conservative Blog Network Feed
Indeed, tired of European lectures, the Russians are now telling the world that soft power is, well, soft. Moscow doesn?t give a damn about the United Nations, the European Union, the World Court at the Hague, or any finger-pointing ... - Advanced Algorithms Course at MIT
Techniques to be covered include amortization, randomization, fingerprinting, word-level parallelism, bit scaling, dynamic programming, network flow, linear programming, fixed-parameter algorithms, and approximation algorithms. ...

on April 12th, 2005 at 3:47 pm
“A Bipartite Matching is defined as V= X + Y where X & Y = {} and for all edges (a, b) in V, a is in X and b is in Y.”
… your shorthand notation for set operations isn’t making any sense - does
this mean that X and Y are disjoint sets, whose union is V?
Furthermore this is wrong, since (a,b) cannot be in V (which is a vertex set).
Perhaps you mean E.
on April 12th, 2005 at 4:16 pm
I’m using + to mean union and & to mean intersection here, since V and ^ are ugly and the real operators are hard to draw. What this means is V = X union Y, where X and Y are disjoint. Also, you can define an edge in a graph by two endpoint vertices (a, b). All that says is that all edges are between the sets X and Y.