BITS Pilani
CS F364: Design and Analysis of Algorithms

Max-Flow Min-Cut Theorem & Ford-Fulkerson

Lecture 23 |2026-07-09

Today’s Agenda: Ford-Fulkerson & Duality

  1. Terminology Recap & Backward Edges Demo
  2. Cut Invariant Insight
  3. The Ford-Fulkerson Method
  4. Cuts, Weak Duality, and the Min-Cut Construction

Network Flow: Quick Terminology

Flow Network
Flow f
Residual G_f
Augmenting Path

Directed graph with source s, sink t, non-negative capacities c(u,v) on every edge.

Every edge carries flow \le its capacity; flow in = flow out at every vertex except s and t.

Forward edges = remaining capacity, backward edges = ability to “undo” flow already sent.

An s \to t path in the residual graph; bottleneck = smallest residual capacity on it.

1. Ford-Fulkerson: The Algorithm

FORD-FULKERSON(G, s, t):
  initialize flow f to 0 for all edges
  while there exists an augmenting path p in G_f:
    cf(p) = min{cf(u,v) : (u,v) in p}
    augment f along p by cf(p)
  return f

Running Time (Integer Capacities)

Each augmentation pushes at least 1 unit. Max flow |f^*| is finite. \text{Time} = O(E \cdot |f^*|)

2. Ford-Fulkerson: First Augmentation

Network: same as L22 example.

Flow network

Augment s \to a \to t: bottleneck = 3. Flow = 3.

3. Ford-Fulkerson: Second Augmentation

After s \to a \to t (flow = 3), residual graph shows:

Residual graph after first augmentation

Now a \to t is saturated. Augment s \to b \to t: bottleneck = 2. Flow = 3 + 2 = 5.

4. Ford-Fulkerson: Final Residual

After both augmentations, G_f shows:

Final residual graph

Forward edges (green): s→a (2), a→b (1). Backward edges (red, dashed): undo each unit of flow sent.

No s \to t path exists in G_f. Algorithm terminates. Flow = 5.

Ford-Fulkerson: Optimal Flow

After both augmentations, no more s \to t paths in G_f. Flow = 5.

Final flow

Question: How do we prove this is the maximum? This is where cuts come in.

How Backward Edges Fix Greedy

Original network
All caps 1. Opt = 2.
Greedy path s→a→b→t
s→a→b→t. Flow = 1. Stuck.
Residual graph
Backward b→a. Forward s→b, a→t.
Second path s→b→a→t
s→b→a→t: backward undoes f(a,b).
Final flow = 2
f(a,b)=0, rest=1. Flow = 2 ✓

5. s-t Cuts

An s-t cut (S, T) partitions V with s \in S and t \in T.

Capacity of a Cut

Sum of capacities of edges crossing from S to T only: c(S, T) = \sum_{u \in S, v \in T} c(u,v) (Edges T \to S do not count.)

6. s-t Cut: Visualized

s-t cut visualization

Cut (S,T) with S = \{s, a, b\}, T = \{t\}: c(S, T) = c(a \to t) + c(b \to t) = 3 + 2 = 5

7. Net Flow Across a Cut

Lemma

For any flow f and any s-t cut (S, T), the net flow across the cut equals |f|: f(S, T) = \sum_{u \in S, v \in T} f(u,v) - \sum_{u \in S, v \in T} f(v,u) = |f|

(Proof follows from flow conservation — all internal flow cancels, leaving only what exits S.)

8. Backward Edges Preserve This Invariant

Net flow w.r.t. a cut S = flow going out of S − flow coming into S.

Augmenting along path p by \Delta:

  • Every S \to T edge along p: outflow +\Delta
  • Every T \to S edge along p: inflow +\Delta (outflow −\Delta)

Since s \in S and t \in T, one more S \to T edge than T \to S on p.
Net outflow change = \Delta = change in |f|.

Why it’s preserved: Whatever flow we reduce on an edge, we add as capacity of a backward edge. So \displaystyle f(S,T) = \sum_{S \to T} f(u,v) - \sum_{T \to S} f(v,u) = |f| holds after every augmentation.

9. Weak Duality

Theorem (Weak Duality)

Every flow is bounded by every cut: |f| \le c(S, T)

Proof: |f| = f(S, T) = \sum_{S \to T} f(u,v) - \sum_{T \to S} f(v,u) \le \sum_{S \to T} c(u,v) = c(S, T).

Corollary

If |f| = c(S, T), then f is a maximum flow and (S, T) is a minimum cut.

10. The Max-Flow Min-Cut Theorem

Max-Flow Min-Cut Theorem

For any flow network, the following are equivalent:

  1. f is a maximum flow in G.
  2. The residual network G_f has no augmenting paths.
  3. |f| = c(S, T) for some s-t cut (S, T).

11. Constructing the Min-Cut

When Ford-Fulkerson terminates, G_f has no s \to t path.

Step 1: Construct the Cut

  • S = all vertices reachable from s in G_f.
  • T = V \setminus S (all other vertices).

Since t \notin S (no augmenting path), (S,T) is a valid s-t cut.

In our example: S = \{s, a, b\}, T = \{t\}.

Min-cut S={s,a,b}, T={t}

12. Why This Cut’s Capacity = Max Flow

Step 2: Edges Crossing the Cut

  • Forward S \to T: f < c \implies c_f > 0 in G_f, so v reachable → f = c
  • Backward T \to S: f(v,u) > 0 \implies residual u \to v has c_f > 0, so v reachable → f = 0

Step 3: Capacity = Flow

c(S,T) = \sum_{S \to T} c(u,v) = \sum_{S \to T} f(u,v) = |f|

Therefore c(S,T) equals the max flow value, and (S,T) is a minimum cut.