Maximum Flow: Max-Flow Min-Cut Theorem (Ford Fukerson's Algorithm)
Maximum Flow: Max-Flow Min-Cut Theorem (Ford Fukerson's Algorithm)
c(s,v1)=16
c(v1,s)=0
c(v2,s)=0
| f | f ( s, v ) f (v, t )
vV
vV
The flow into the node is same as flow going out from the node and
thus the flow is conserved. Also the total amount of flow from source
s = total amount of flow into the sink t.
Example of a flow
Capacity
Flow
10, 9
8,8
1,1
s
6, 6
t
10,7
Table illustrating Flows and Capacity across different edges of graph above:
fs,1 = 9 , cs,1 = 10 (Valid flow since 10 > 9)
fs,2 = 6 , cs,2 = 6 (Valid flow since 6 6)
f1,2 = 1 , c1,2 = 1 (Valid flow since 1 1)
f1,t = 8 , c1,t = 8 (Valid flow since 8 8)
f2,t = 7 , c2,t = 10 (Valid flow since 10 > 7)
The flow across nodes 1 and 2 are also conserved as flow into them = flow out.
Maximize
Subject To
Cut
10
15
15
15
10
10
15
10
30
c(u , v)
c( S , T )
uS , vT
Cut
10
15
15
15
10
10
15
10
30
Capacity = 30
7
Min Cut
Min s-t cut (Also called as a Min Cut) is a cut of minimum capacity
10
15
15
15
10
10
15
10
30
Capacity = 28
T
8
Methods
Max-Flow Min-Cut Theorem
The Ford-Fulkerson Method
The Preflow-Push Method
c f (u , v ) c (u , v ) f (u , v )
10, 9
8,8
1,1
s
6, 6
2
Original Network
t
10,7
1
9
s
0
0
0
8
7
6
2
Residual Network
c f ( p ) min{c f (u , v ) : (u , v ) is on p}
AUGMENT(f,P)
FOREACH e E
b bottleneck(P)
f(e) 0
Gf residual graph
WHILE (there exists augmenting
path P)
f augment(f, P)
update Gf
ENDWHILE
RETURN f
FOREACH e P
IF (e E)
// backwards arc
f(e) f(e) + b
ELSE
// forward arc
f(eR) f(e) - b
RETURN f
The Ford-Fulkerson
Augmenting Path Algorithm
for the Maximum Flow
Problem
15.082 and 6.855J (MIT
OCW)
2
3
5
1
1
2
3
4
1
1
2
2
3
This is the original network,
and the original residual
network.
2
3
5
1
1
2
3
4
1
1
2
2
3
Find any s-t path in G(x)
2
3
5
1
1
2
2
3
1
4
1
1
1
2
2 1
2
3
5
1
1
2
2
3
1
4
1
1
1
2
2 1
2
3
5
1
1
2
1
2
3
1
1
1
1
11
2 1
1
2
3
5
1
1
2
1
2
3
1
1
1
1
11
2 1
1
1
2
3
5
1
1
1
2
3
1
1
2
1
1
11
1
1 2
2
3
5
1
1
1
2
2
3
1
1
2
1
1
11
1
1 2
1
2
3
5
1
1
1
2
1
2
2
1
1
2
1
1
11
1
1
2
2
1
2
3
5
1
1
1
2
1
2
2
1
1
2
1
11
1
2
2
1
2
3
2
1
2
2
1
5
1
1
1
1
2
1
2
2
1
2
3
2
1
2
2
1
5
1
1
1
1
2
1
2
2
1
2
3
2
1
2
2
1
5
1
1
1
1
2
1
2
2
1
1
2
2
2
3
Here is the optimal flow