Professional Documents
Culture Documents
Advanced Algorithm Lab: Paper Code:-Pgse-292
Advanced Algorithm Lab: Paper Code:-Pgse-292
BY
PROMIT KUMAR MOHANTA
PAPER CODE:- PGSE-292
ROLL NO : 10011321010
REG NO : 211000411310010
Department of Software Engineering
Maulana Abul Kalam Azad University of Technology,
Westbengal
Haringhata, Nadia 741249
Date of Experiment: -4th may, 2022
Date of Submission: -9th may, 2022
Session- 2021 to 2023
Year: - 1st year Sem: - 2nd sem
Program – M.Tech
Assignment No. - 7
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 (0) and a sink (5). Each vertex,
except S and T, can receive and send an equal amount of stuff
through it. (0) can only send and (5) 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.
Residual Graph
It represents the flow network that has additional possible flow.
Residual Capacity
It is the capacity of the edge after subtracting the flow from the
maximum capacity.
Ford-Fulkerson Example:
consider the following graph-
Code:
queue.append(s)
visited[s] = True
while queue:
u = queue.pop(0)
return max_flow
source = 0
sink = 5
Max flow: 23
Screenshot:
Time Complexity:
Ford-Fulkerson Applications: