0% found this document useful (0 votes)
26 views10 pages

Max Flow

Uploaded by

gowdapraveena83
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views10 pages

Max Flow

Uploaded by

gowdapraveena83
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Ford Fulkerson Algorithm

Max-Flow Min-Cut Theorem (Maximum Flow)

Name: Praveena BN
USN : 22BMMCA040
What is Network Flow ?

Definition: A Flow Network is a directed graph G = (V, E) such that

1. For each edge (u, v) ∈ E, we associate a nonnegative weight capacity c (u, v) ≥ 0.

If (u, v) ∉ E, we assume that c (u, v) = 0.

2. There are two distinguishing points, the source (s) and the sink (t);

3. For every vertex v ∈ V, there is a path from s to t containing v.


As shown in the flow network given below,
A source vertex has all outgoing edges and no incoming edges, more formally we can say
In_degree[source]=0 and sink vertex has all incoming edges and no outgoing edge more formally
out_degree[sink]=0.
Conditions for Network Flow

For each edge (u , v) in E, the flow f(u , v) is a real valued function


that must satisfy following 3 conditions :

• Capacity Constraint : u,v V, f(u,v)  c(u,v)

• Skew Symmetry :  u,v V, f(u,v)= -f(v,u)

• Flow Conservation:  u V – {s,t}  f(s,v)=0


vV
Ford-Fulkerson Algorithm for finding
Maximum Flow
The maximum flow is the maximal possible value of the flow of the network where the flow is
defined as, "sum of all the flow that gets produced in source s, or sum of all the flow that gets
consumed in the sink t ".

Residual Capacity - Residual capacity of the directed edge is nothing but capacity of the edge -
current flow through the edge. If there is flow along a directed edge u → v then reversed edge has a
capacity 0 and we can say 𝑓(𝑣,𝑢)=−𝑓(𝑢,𝑣).
Residual Graph - Residual graph is nothing but the same graph with the only difference is we use
residual capacities as capacities.
Augmenting Path - It is a simple path from source to sink in a residual graph i.e. along the edges
whose capacity is 0.
Consider,
the initial flow of all the paths is 0.

On the path 𝑠→𝐴→𝐵→𝑡 with residual


capacities as 7, 5 and 8. Their minimum
is 5, so as per the Ford-Fulkerson method we
will increase a flow of 5 along the path.
On the path s→D→C→t with residual
capacities as 4, 2 and 5. Their minimum
is 2, so as per the Ford-Fulkerson method we
will increase a flow of 2 along the path.

From the figure that we can't increase the flow along paths 𝐴→𝐵and 𝐷→𝐶as their flow has
reached their maximum capacity. So, to find other augmenting paths.

On the path s→D→A→C→t with residual capacities


as 2, 3, 3 and 3. Their minimum is 2, so as per the
Ford-Fulkerson method we will increase a flow
of 2 along the path.
On the path s→A→C→t with residual capacities
as 2, 1, and 1. Their minimum is 1, so as per the Ford-
Fulkerson method we will increase a flow of 1 along the
path.

No more augmenting paths possible in the


network, so the maximum flow is the total
flow going out of source or total flow coming
in sink
i.e.
6+4=5+5=10
Time complexity
In the worst case,
where each augmenting path is chosen poorly, the Ford-Fulkerson algorithm can have a time
complexity of 𝑂(𝐸⋅𝑓),
where E is the number of edges in the graph and f is the maximum flow value.

Applications
• In traffic movements, to find how much traffic can move from a City A to City 𝐵.
• In electrical systems, to find the maximum current that could flow the wires without causing
any short circuit.
• In the water/sewage management system, to find maximum capacity of the network.
Thankyou!

You might also like