Ford-Fulkerson Algorithm
Ford-Fulkerson Algorithm
Ford-Fulkerson algorithm is a greedy approach for calculating the maximum possible flow in
a network or a graph.
A term, flow network, is used to describe a network of vertices and edges with a source (S)
and a sink (T). Each vertex, except S and T, can receive and send an equal amount of stuff
through it. S can only send and T can only receive stuff.
We can visualize the understanding of the algorithm using a flow of liquid inside a network of
pipes of different capacities. Each pipe has a certain capacity of liquid it can transfer at an
instance. For this algorithm, we are going to find how much liquid can be flowed from the
source to the sink at an instance using the network.
Terminologies Used
Augmenting Path
It is the path available in a flow network.
• Non-Full Forward Edges
• Non-Empty (Non-Zero) backward Edges
Residual Capacity
It is the capacity of the edge after subtracting the
flow from the maximum capacity.
Residual Graph
It represents the flow network that has additional
possible flow.
How Ford-Fulkerson Algorithm
works?
The algorithm follows:
2] Select any arbitrary path from S to T. In this step, we have 4] Select another path S-D-C-T. The minimum capacity among
selected path S-A-B-T these edges is 3 (S-D).
5] Update the capacities according to this. 7] Updating the capacities.
6] Now, let us consider the reverse-path B-D as well. Selecting The capacity for forward and reverse paths are
path S-A-B-D-C-T. The minimum residual capacity among the considered separately.
edges is 1 (D-C).
Adding all the flows = 2 + 3 + 1 = 6, which is the
maximum possible flow on the flow network.