Lecture 16
Lecture 16
Graph Theory
Lecture - 16
12/22/2024
• Let f be any flow, and let (S, T) be any s-t cut.
If v(f) = c(S, T), then f is a max flow and (S, T) is a
min s-t cut.
• Value of flow = 28
Cut capacity = 28 ⇒ Flow value ≤ 28
12/22/2024
Greedy Algorithm
• Start with f(e) = 0 for all edge e ∈ E.
• Find an s-t path P where each edge has f(e) ≤ c(e).
• Augment flow along path P.
• Repeat until you get stuck.
12/22/2024
Greedy Algorithm
• Start with f(e) = 0 for all edge e ∈ E.
• Find an s-t path P where each edge has f(e) ≤ c(e).
• Augment flow along path P.
• Repeat until you get stuck.
12/22/2024
Residual Graph
• Originaledge: e = (u, v) ∈ E.
Flow f(e), capacity c(e).
• Residual Edge.
e = (u, v) and eR = (v, u).
Residual capacity:
If e ∈ E:
Unused capacity
If eR ∈ E:
“undo” flow
12/22/2024
Residual Graph
• Residual graph: Gf = (V, Ef ).
Residual edges with positive residual capacity.
Ef = {e : f(e) < c(e)} ∪ {eR : c(e) > 0}.
Augmenting Paths
12/22/2024
• Augmenting path = path in residual graph.
Increase flow along forward edges.
Decrease flow along backward edges
Max-Flow Min-Cut Theorem
12/22/2024
• Augmenting path theorem. A flow f is a max flow if
and only if there are no augmenting paths.
• Max-flow min-cut theorem. The value of the max
flow is equal to the capacity of the min s-t cut.
• We prove both simultaneously by showing the
following are equivalent:
(i) f is a max flow.
(ii) There is no augmenting path relative to f.
(iii) There exists a cut whose capacity equals the
value of f
• If
there is no augmenting path relative to f, then
there
12/22/2024
Proof
• Letf be a flow with no augmenting paths.
Let A be set of vertices reachable from s in
residual graph.
– A contains s; since no augmenting paths, A
does not contain t
Claim-1: all edges e leaving A in original network have
f(e) = c(e)
Proof: Otherwise there would be residual capacity, and
the residual graph would have an edge A to B.
Claim-2: all edges e entering A in original network
have f(e) = 0
Proof: Otherwise residual edge would go from A to B.
Proof
12/22/2024
Second-Proof
12/22/2024
• Since the value of any maximum flow cannot exceed
the capacity of any minimum cut, it is sufficient to
prove the existence of a cut whose capacity is equal to
the value of a given maximum flow.
Let φ be a maximum flow. We define two sets S and T of
vertices of the network as follows.
If G is the underlying graph of the network, then a
vertex z is contained in S, if and only if there exists in G
a path v = v0 → v1 → v2 → ...... → vm – 1 → vm = z, such
that each edge vivi + 1 corresponds either to an
unsaturated arc vivi + 1, or to an arc vi + 1vi that carries a
non-zero flow. The set T consists of all those vertices
that do not lie in S.
12/22/2024
Example: Ford-Fulkerson Algorithm
Application
12/22/2024
Iteration – 1
12/22/2024
Iteration – 1
12/22/2024
Iteration – 2
12/22/2024
Iteration – 2
12/22/2024
Iteration – 3
12/22/2024
Iteration – 3
12/22/2024
Iteration – 4
12/22/2024
Iteration – 4
12/22/2024
Max-Flow Value