Lesson 8 - Maximum Flow Algorithm
Lesson 8 - Maximum Flow Algorithm
FL OW PR O BLEM
THE MAXIMUM FLOW ALGORITHM
QUESTION: With an infinite input source, how much "flow" can we push
through the network given that each edge has a certain capacity?
In this flow graph, the maximum flow is 7, calculated as the sum of the
flows entering the sink node: 1 + 2 + 4 = 7. This value represents the
most flow that can be pushed through the network while respecting all
capacity limits.
FLOW GRAPH (FLOW NETWORK)
This process
continues until no
more augmenting
paths can be found.
AUGMENTING PATH
An augmenting path
is a path of edges in
the residual graph
with unused capacity
greater than zero
from the source s to
the sink t.
AUGMENTING PATH
e.capacity e.flow
The bottleneck is 4
because it is the
minimum of the
remaining capacities
along the augmenting
path:
min(10 – 6, 15 − 6, 10 −
0) = min(4, 9, 10) = 4
min(10 – 0, 0 − −6, 10 −
4) = min(10, 6, 6) = 6
min(10 – 6, 25 – 6, 10 −
6) = min(4, 19,
RESIDUAL GRAPH
No more augmenting
paths can be found,
so the algorithm
terminates!
maximum flow = 6 + 4 + 6 + 4 = 20
bottleneck values
RESIDUAL GRAPH
Assuming the
method of finding
augmenting
paths is by using a
Depth First Search
(DFS),
the algorithm runs
in 0(fE), where f is
the
maximum flow and E
is the number of
edges.
RESIDUAL GRAPH
This results in
flipping back and
forth
between the same
two alternating
paths
for 200 iterations...
RESIDUAL GRAPH
RESIDUAL GRAPH