2. Flow network is a directed graph G=(V,E) such that each
edge has a non-negative capacity c(u,v)≥0.
Two distinguished vertices exist in G namely :
• Source (denoted by s) : In-degree of this vertex is 0.
• Sink (denoted by t) : Out-degree of this vertex is 0.
Flow in a network is an integer-valued function f defined on
the edges of G satisfying 0 ≤ f(u,v) ≤ c(u,v), for every
Edge(u,v) in E.
Augmented Path is a path from source s to sink t in a
residual graph.
Residual Graph is graph after sending the flow through the
network with edges having remaining capacities (residual
capacity).
2
3. • FORD-FULKERSON(G,s,t)
• for each edge (u,v) E[G]
• do f[u,v] 0
• f[v,u] 0
• while there exists a path p from s to t in the residual
network Gf
• do cf(p) min{cf(u,v): (u,v) is in p}
• for each edge (u,v) in p
• do f[u,v] f[u,v]+cf(p) 3
Ford Fulkerson Algorithm
4. After every step in the algorithm the following is
maintained:
• Capacity Constraints : ∀ 𝑢, 𝑣 𝜖 𝐸 𝑓 𝑢, 𝑣 ≤ 𝑐(𝑢, 𝑣)
The flow along an edge can not exceed its capacity.
• Skew Symmetry : ∀ 𝑢, 𝑣 𝜖 𝐸 𝑓 𝑢, 𝑣 = −𝑓(𝑣, 𝑢)
The net flow from u to v must be the opposite of the net flow from v to u
• Flow Conservation :
Unless u is s or t. The net flow to a node is zero, except for the source, which
"produces" flow, and the sink, which "consumes" flow.
4
5. When the algorithm terminates?
All paths from s to t are blocked by either a
• Full forward edge
• Empty backward edge
5