Ford-Fulkerson Algorithm - Network Flow Problem
Ford-Fulkerson Algorithm - Network Flow Problem
Veningston. K
Computer Science and Engineering
Unit V - Outline
– Is P=NP?
– Reducibility
Reduce capacity to Ce – Fe
Add reverse edge with capacity Fe
1st round
•Design and Analysis of Algorithms
•28
(18CSE107)
Example - 2
• Build the Residual Graph.
– The residual capacity from
de is now 10. Because, we
had a capacity of 30 and 20
is flowing through it.
– The red color edges are
residual edges which allows
us to reduce the 20 unit
back.
2nd round
•Design and Analysis of Algorithms
•30
(18CSE107)
Example - 2
• Build the residual graph
This edge gets restored back by 10. Because, total flow from de
was 20 in the 1st round, -10 in the 2nd round. Therefore, the residual
edge is 30-10 = 20.
•Design and Analysis of Algorithms
•31
(18CSE107)
Example - 2
• Now, edges from s are 0. Because, it is
saturated.
• There is no outgoing flow possible from s in
this residual graph.
• Therefore, we can say that there is no more
feasible path and stop the algorithm.
• We have achieved the flow of 30 in the given
graph, which is maximum.
•Design and Analysis of Algorithms
•32
(18CSE107)
Important Properties
• Optimality – Cut
• Minimum Cut
• Maximum Flow
LHS
RHS
•Design and Analysis of Algorithms
•35
(18CSE107)
Bad Flow?
• This cut supports the total flow capacity of 7
• Therefore, the optimum flow can definitely not exceed 7
in this example graph.
• This cut will prevent any flow more than 7
flowing from LHS to RHS.
Residual Graph
•Design and Analysis of Algorithms
•39
(18CSE107)
Proof
• Next time, if we go in the reverse direction,
Residual Graph