Take any cut (S,T). Sum the conservation equation over all nodes in S. Internal edges (both endpoints in S) appear once as +f and once as −f and cancel. What survives is only flow crossing the cut:
∣f∣=∑u∈S,v∈Tf(u,v)−∑u∈S,v∈Tf(v,u)Why this step? Conservation forces everything inside S to balance, so the net out of S must equal the net out of s, which is ∣f∣.
Step 2 — Weak duality: every flow ≤ every cut.∣f∣=≤c∑f(forward)−≥0∑f(backward)≤∑c(forward)=c(S,T)Why? Forward flows are capped by capacity; backward flows are subtracted and are ≥0. So any flow value is bounded by any cut capacity. Hence max∣f∣≤minc(S,T).
Step 3 — Equality is achievable (the max-flow min-cut theorem).
When a flow is maximum, there is NO augmenting path in the residual graph (defined next). Let S= all nodes reachable from s in the residual graph, T = the rest. Then t∈/S. For this cut:
every forward edge u→v (u∈S,v∈T) is saturated (f=c), else v would be reachable;
every backward edge carries f=0, else it would give a residual edge into T.
Plug into Step 1: ∣f∣=∑c(forward)−0=c(S,T). So this flow equals a cut capacity, and by Step 2 both are optimal. ■
Path 1:s→a→t, bottleneck =min(3,2)=2. Push 2. Why?a→t is the limiter.
Path 2:s→b→t, bottleneck =min(2,3)=2. Push 2.
Path 3:s→a→b→t, residual: s→a has 3−2=1, a→b=1, b→t=3−2=1. Bottleneck =1. Push 1.
Now ∣f∣=2+2+1=5. Why no more?s's out-capacity is 3+2=5, all saturated — this is the min cut S={s}, c=5. Max flow = 5. ✔
Greedy picks s→a→b→t, bottleneck 1. Why might we panic? Now a→t and s→b look unusable. But residual has backward b→a (cap 1). New path: s→b→a→t? — s→b(1), backward b→a(1), a→t(1). Push 1. Total =2 = min cut. Why this step? The backward edge undid the bad commitment a→b, freeing a→t. ✔
Recall Feynman: explain to a 12-year-old
Imagine water pipes from a tap to a bucket. Each pipe can only carry so much. You want maximum water reaching the bucket. The limit is the weakest place in the network — find the cheapest set of pipes to cut so no water gets through, and that's exactly the max water you can send. The algorithm keeps finding "still-open routes," pushes water, and is even allowed to take water back from a route it tried earlier and send it a better way. When no open route is left, you're done — you've hit the bottleneck.
Socho ek paani ke pipe ka network hai — ek source (tap) s se ek sink (bucket) t tak. Har pipe ki ek max capacity hai. Sawaal: kitna paani per seconds se t tak bhej sakte ho? Iska jawab network ke sabse weak hisse pe depend karta hai — wo minimum set of pipes jinhe kaat do toh paani ruk jaaye. Yahi hai max-flow = min-cut ka magic: maximum flow ki value bilkul minimum cut ki capacity ke barabar hoti hai.
Algorithm kaise chalta hai? Ford-Fulkerson bolta hai: jab tak source se sink tak koi augmenting path (residual graph mein khula rasta) milta rahe, usme bottleneck (minimum bachi capacity) ke barabar paani push karte raho. Sabse zaroori cheez hai backward edges — yeh tumhe purana galat decision undo karne dete hain. Jaise pehle ek route pe paani bhej diya tha jo aage jaake fas gaya, toh backward edge se wapas le ke better route pe bhej sakte ho. Isliye greedy galti nahi karta.
Edmonds-Karp sirf ek smart twist hai: hamesha BFS se shortest path chuno augment karne ke liye. Isse complexity capacity values pe depend nahi karti, fixed O(VE2) ho jaati hai — bahut reliable. Plain Ford-Fulkerson galat path choose kare toh slow ho sakta hai (O(E⋅∣f∣)).
Yeh topic kyun important hai? Bipartite matching, image segmentation, scheduling, network reliability — sab ke andar yahi max-flow chhupa hota hai. Aur jab interview mein poochhe "max flow kaise prove karoge done?", jawab yaad rakho: residual graph mein koi augmenting path na bache, tabhi flow maximum hai, aur reachable nodes ka set S ban jaata hai min cut.