1 2 3
3
3
1 2 3
1 1 t
s
2
4
2 4 4
the black numbers next two the arcs is its capacity
1 2 3
3
3
1 2 3
1 1 t
s
2
4
2 4 4
Cts= -1
Set costs all other arcs at 0
The minimum cost flow circulation (Af=0)
maximises the s-t flow
1 2 3
3
3
1 2 3
1 1 t
s
2
4
2 4 4
the black numbers next two the arcs is its capacity
1 1 2 3
2 3
3 3
1 2 2 3
1 1 1 t
s
2 2
1 4
2 1 4 4
the black number next to an arc is its capacity
the green number next to an arc is the flow on it
the residual graph
1 1 1 3
2 1
3
1 2 3
1 1 t
s
2
1 3
2 1 3 4
blue arcs are forward arcs
green arcs are backward arcs
the blue number is the residual capacity of a blue arc
the green number is the capacity of a green arc
the residual graph
1 1 1 3
2 1
3
1 2 3
1 1 t
s
2
1 3
2 1 3 4
red arcs form an augmenting path
the residual graph
1 1 1 3
2 1
3
1 2 3
1 1 t
s
2
1 3
2 1 3 4
red arcs form an augmenting path
Augment the flow by the minimum capacity of a
red arc, i.e, 1
the residual graph
1 2 3
3
3
1 3
1 1 t
1 1
s
2
2 2
2 2 2 4
red ars form an augmenting path
Augment the flow by the minimum capacity of a
red arc, i.e, 1
And construct the new residual graph
1 2 3
3
2
1 2 3
1 1 t
s
2
4
2 4 4
An s-t cut is defined by a set S of the nodes with
s in S and t not in S.
1 2 3
3
2
1 2 3
1 1 t
s
2
4
2 4 4
S={s,1,2}
An s-t cut is defined by a set S of the nodes with
s in S and t not in S.
1 2 3
3
2
1 2 3
1 1 t
s
2
4
2 4 4
S={s,1,2}
An s-t cut is defined by a set S of the nodes with
s in S and t not in S
Size of cut S is the sum of the capacities on the
arcs from S to N\S.
1 2 3
3
2
1 2 3
1 1 t
s
2
4
2 4 4
C(S)=c13+c14+c24= 2+2+4=8
An s-t cut is defined by a set S of the nodes with
s in S and t not in S
Size of cut S is the sum of the capacities on the
arcs from S to N\S.
S1 1 2 3
3
2
1 2 3
1 1 t
s
2
4
2 4 4
C(S1)=cs1+c24= 2+4=6
S1 1 2
S2 3
3
2
1 2 3
1 1 t
s
2
4
2 4 4
C(S1)=cs1+c24= 2+4=6
C(S2)=c13+c43+c4t= 2+1+2=5
S1 1 2
S2 3
3
2
1 2 3
1 1 t
s
2
4
2 4 4
C(S1)=cs1+c24= 2+4=6
C(S2)=c13+c43+c4t= 2+1+2=5
Max Flow Min Cut
S1 1 2
S2 3
3
2
1 2 3
1 1 t
s
2
4
2 4 4
C(S1)=cs1+c24= 2+4=6
C(S2)=c13+c43+c4t= 2+1+2=5
Max Flow Min Cut
fs1+fs2 Min Cut 5
the residual graph
1 2
S2
3
3
1 3
1 1 t
1 1
s
2
2 2
2 2 2 4
fs1+fs2=2+3=5 = C(S )=c +c +c = 2+1+2=5
2 13 43 4t
S2={s,1,2,4} the set of nodes reachable from S
Max Flow Min Cut
the residual graph
1 2
S2
3
3
1 3
1 1 t
1 1
s
2
2 2
2 2 2 4
fs1+fs2=2+3=5 = C(S )=c +c +c = 2+1+2=5
2 13 43 4t
S2={s,1,2,4} the set of nodes reachable from S
Max Flow Min Cut
Theorem: Max Flow = Min Cut