$ \def\opt{ {\mathrm{opt}} } \def\val{ {\mathrm{val}} } \def\capacity{ {\mathrm{cap}} } $
Midterm II on Wednesday
Max Flow Problem:
Input.
Output.
Greedy strategy doesn’t always work
Given a flow $f$:
Ford-Fulkerson Algorithm:
How do we…
find augmenting path $P$ from $s$ to $t$?
update flow $f$ according to $P$?
update residual graph $G_f$?
MaxFlow(G, s, t):
Gf <- G
f <- zero flow
P <- FindPath(Gf, s, t)
while P is not null do:
b <- min capacity of any edge in P
Augment(Gf, f, P, b)
P <- FindPath(Gf, s, t)
endwhile
return f
Augment(Gf, f, P, b):
for each edge (u, v) in P
if (u, v) is forward edge then
f(u, v) <- f(u, v) + b
c(u, v) <- c(u, v) - b
c(v, u) <- c(v, u) + b
else
f(v, u) <- f(v, u) - b
c(v, u) <- c(v, u) + b
c(u, v) <- c(u, v) - b
Assume:
Observe:
How long to find augmenting path $P$?
How long to run Augment
?
How many iteraions of find/augment?
Conclude: Overall running time?
Question. How do we know this flow is optimal?
Definition. An $s$ - $t$ cut $(A, B)$ is a partition of vertices into two disjoint sets with $s$ in $A$ and $t$ in $B$.
The capacity of $(A, B)$, denoted $\capacity(A, B)$ is the sum of the capacities of the edges out of $A$.
Idea. Relate values of flows to capacities of cuts:
Outline:
Together these imply Ford-Fulkerson produces max flow
For any $s$ - $t$ cut $(A, B)$ and flow $f$, $\val(f) = f^{\text{out}}(A) - f^{\text{in}}(A)$
Consequence. For all cuts $(A, B)$, $\val(f) \leq \capacity(A, B)$
Suppose $f$ does not have an augmenting path in the auxiliary graph.
Then $\val(f) = \capacity(A^*, B^\star)$
Consider flow $f$ found by Ford-Fulkerson.
These imply:
$G = (V, E)$ a weighted, directed graph with minimum cut capacity $C$.
Ford-Fulkerson finds maximum flow in time $O(C m)$.