Conservation conditions: For internal nodes, ∑ e into v f(e) = ∑ e out of vf(e)
–> The value of a flow f,v(f) is the amount of flow generated at the source: v(f) = ∑ e out of s f(e)
The Maximum Flow Problem: Given a flow network, arrange the traffic so as to make as efficient use as possible of the available capacity. –> Given a flow network, find a flow of maximum possible value.
Designing the Algorithm
Greedy algorithm
–> Start all edges e ∈ E at f(e) = 0
–> Find an s-t path P with the most capacity: f(e) < c(e)
–> Augment flow along path P
–> Repeat until you get stuck
However, the greedy algorithm doesn't produce a flow of optimal value. We need a new way of pushing flow so as to attain the optimal value.
Residual Graph: Gf
–> Original edge: e = (u, v) ∈ E
–> Flow f(e), capacity c(e)
–> Residual edge\\:
. e = (u, v) w/ capacity c(e) - f(e)
. eR = (v, u) with capacity f(e)
–> Residual graph: Gf = (V, Ef )
–> Residual edges with positive residual capacity
–> Ef = {e : f(e) < c(e)} ∪ {eR : f(e) > 0}
Augmenting Path Algorithm
–> Ford-Fulkerson(G, s, t, c)
–> foreach e ∈ E f(e) = 0 # initially no flow
–> Gf = residual graph
–> while there exists augmenting path P
.f = Augment(f, c, P) # change the flow
.update Gf # build a new residual graph
–> return f
Augment(f, c, P)
–> b = bottleneck(P) # edge on P with least capacity
–> foreach e ∈ P
.if (e ∈ E) f(e) = f(e) + b # forward edge, forward flow
.else f(eR) = f(e) - b # forward edge, backward flow
–> return f
Analyzing the Algorithm
–> At every intermediate stage of the Ford-Fulkerson Algorithm, the flow values {f(e)} and the residual capacities in Gf are integers.
–> With the above assumption, the Ford-Fulkerson Algorithm terminates in at most C iterations of the While loop.
–> And the Algorithm can be implemented to run in O(mC) time.
Reading this section outside class time helped me a lot. In all fairness, I was lost in lectures as things were fast in a very bad week for me. I was delighted to read this section and see things gradually unfold and start making sense.
For this very reason, I give this section an 9/10.