2 3 1 2 3 4 2 Each edge e is associated with a capacity c. Push as much flow f as possible from S to T. f(e) ≤ c(e) Σu f(u, v) = Σw f(v, w), where v ∉ {S, T}
2 3 1 2 3 4 2 Each edge e is associated with a capacity c. Push as much flow f as possible from S to T. f(e) ≤ c(e) Σu f(u, v) = Σw f(v, w), where v ∉ {S, T} Maximum flow?
2 3 1 2 3 4 2 Each edge e is associated with a capacity c. Push as much flow f as possible from S to T. f(e) ≤ c(e) Σu f(u, v) = Σw f(v, w), where v ∉ {S, T} 3 Maximum flow?
2 3 1 2 3 4 2 Each edge e is associated with a capacity c. Push as much flow f as possible from S to T. f(e) ≤ c(e) Σu f(u, v) = Σw f(v, w), where v ∉ {S, T} 3 3 Maximum flow?
2 3 1 2 3 4 2 Each edge e is associated with a capacity c. Push as much flow f as possible from S to T. f(e) ≤ c(e) Σu f(u, v) = Σw f(v, w), where v ∉ {S, T} 3 3 1 2 Maximum flow?
2 3 1 2 3 4 2 Each edge e is associated with a capacity c. Push as much flow f as possible from S to T. f(e) ≤ c(e) Σu f(u, v) = Σw f(v, w), where v ∉ {S, T} 3 3 1 2 2 Maximum flow?
2 3 1 2 3 4 2 Each edge e is associated with a capacity c. Push as much flow f as possible from S to T. f(e) ≤ c(e) Σu f(u, v) = Σw f(v, w), where v ∉ {S, T} 3 3 1 2 2 1+2 Maximum flow?
2 3 1 2 3 4 2 Each edge e is associated with a capacity c. Push as much flow f as possible from S to T. f(e) ≤ c(e) Σu f(u, v) = Σw f(v, w), where v ∉ {S, T} 3 3 1 2 2 1+2 3 Maximum flow?
2 3 1 2 3 4 2 Each edge e is associated with a capacity c. Push as much flow f as possible from S to T. f(e) ≤ c(e) Σu f(u, v) = Σw f(v, w), where v ∉ {S, T} 3 3 1 2 2 1+2 3 Maximum flow? Optimum?
S 1 2 3 4 T 2 3 1 2 3 1 Find a path p from S to T, where ∀e p. r(e) = c(e) - f(e) > 0. ∀e p. c(e) = c(e) - min(f(p)). MaxFlow = MaxFlow + min(f(p)). 2 0 0 2
S 1 2 3 4 T 2 3 1 2 3 1 Find a path p from S to T, where ∀e p. r(e) = c(e) - f(e) > 0. ∀e p. c(e) = c(e) - min(f(p)). MaxFlow = MaxFlow + min(f(p)). 2 0 0 2 1
S 1 2 3 4 T 2 3 1 2 3 1 Find a path p from S to T, where ∀e p. r(e) = c(e) - f(e) > 0. ∀e p. c(e) = c(e) - min(f(p)). MaxFlow = MaxFlow + min(f(p)). 2 0 0 2 1
S 1 2 3 4 T 2 3 1 2 3 1 Find a path p from S to T, where ∀e p. r(e) = c(e) - f(e) > 0. ∀e p. c(e) = c(e) - min(f(p)). MaxFlow = MaxFlow + min(f(p)). 2 0 0 2 1
S 1 2 3 4 T 2 3 1 2 3 1 Find a path p from S to T, where ∀e p. r(e) = c(e) - f(e) > 0. ∀e p. c(e) = c(e) - min(f(p)). MaxFlow = MaxFlow + min(f(p)). 2 0 0 2 1
3 S 1 2 3 4 T 2 3 1 2 3 1 Find a path p from S to T, where ∀e p. r(e) = c(e) - f(e) > 0. ∀e p. c(e) = c(e) - min(f(p)). MaxFlow = MaxFlow + min(f(p)). 2 0 0 2 1 0 0
3 S 1 2 3 4 T 2 3 1 2 3 1 Find a path p from S to T, where ∀e p. r(e) = c(e) - f(e) > 0. ∀e p. c(e) = c(e) - min(f(p)). MaxFlow = MaxFlow + min(f(p)). 2 0 0 2 1 0 0 2 No more augmenting path!
4 2 3 1 2 3 4 2 vs. Maximum flow Minimum cut • S-T cut - A set of edges whose removal disconnects S to T. - The capacity of a cut = Σ c(e), ∀e in the cut.
4 2 3 1 2 3 4 2 3 3 1 2 2 3 3 vs. Maximum flow Minimum cut • S-T cut - A set of edges whose removal disconnects S to T. - The capacity of a cut = Σ c(e), ∀e in the cut.
1 S 1 2 3 4 T 2 3 1 2 3 1 0 0 2 0 0 • Algorithm 1. Find a path p from S to T, remove any edge e in p, and put e to a set C. 2. Repeat #1 until no path is found, and return C.
1 S 1 2 3 4 T 2 3 1 2 3 1 0 0 2 0 0 • Algorithm 1. Find a path p from S to T, remove any edge e in p, and put e to a set C. 2. Repeat #1 until no path is found, and return C. • How can we find a min-cut?
1 S 1 2 3 4 T 2 3 1 2 3 1 0 0 2 0 0 • Algorithm 1. Find a path p from S to T, remove any edge e in p, and put e to a set C. 2. Repeat #1 until no path is found, and return C. • How can we find a min-cut? - Instead of removing any edge in #1, remove an edge with the minimum original (not residual) weight.
no extra edge in the min-cut. - Prove? • Lemma 2 - All edges in the min-cut must be parts of augmenting paths. - Prove? • Lemma 3 - Each edge in the min-cut is the minimum weighted edge in each augmenting path.
no extra edge in the min-cut. - Prove? • Lemma 2 - All edges in the min-cut must be parts of augmenting paths. - Prove? • Lemma 3 - Each edge in the min-cut is the minimum weighted edge in each augmenting path. - Prove?