Daniel Sutantyo, Department of Computing, Macquarie University
8.0 - Maximum Flow
8.0 - Maximum Flow
8.0 - Maximum Flow
D
A
B
C
E
F
G
8.0 - Maximum Flow
a
s
c
t
b
d
13
source
sink
16
12
4
9
7
20
14
4
8.0 - Maximum Flow
a
s
c
t
b
d
13
source
sink
16
12
4
9
7
20
14
4
8.0 - Maximum Flow
a
s
c
t
b
d
13
source
sink
16
12
4
9
7
20
14
4
4
4
4
8.0 - Maximum Flow
a
s
c
t
b
d
13
source
sink
13
16
12
4
9
7
20
14
4
8.0 - Maximum Flow
8.0 - Maximum Flow
a
s
c
t
b
d
source
sink
4/13
12/16
12/12
0/4
0/9
0/7
12/20
4/14
4/4
8.0 - Maximum Flow
a
s
c
t
b
d
source
sink
8/13
11/16
12/12
1/4
4/9
7/7
15/20
11/14
4/4
Here is another flow:
a
s
c
t
b
d
source
sink
4/13
12/16
12/12
0/4
0/9
0/7
12/20
4/14
4/4
8.0 - Maximum Flow
8.0 - Maximum Flow
v∈V∖{s,t}∑f(v,u)=v∈V∖{s,t}∑f(u,v)
8.0 - Maximum Flow
this is a flow
this is a different flow
a
s
c
t
b
d
source
sink
8/13
11/16
12/12
1/4
4/9
7/7
15/20
11/14
4/4
a
s
c
t
b
d
source
sink
4/13
12/16
12/12
0/4
0/9
0/7
12/20
4/14
4/4
8.0 - Maximum Flow
sink
f(s,a)=11
f(s,c)=8
f(a,b)=11
f(b,c)=3
f(c,d)=11
f(d,b)=7
f(b,t)=15
f(d,t)=4
the value of this flow is 19
A flow in G is a function f(u,v):V×V→R for u,v∈V
f(c,a)=0
a
s
c
t
b
d
source
8/13
11/16
12/12
1/4
4/9
7/7
15/20
11/14
4/4
8.0 - Maximum Flow
a
s
c
t
b
d
source
sink
1/13
1/16
1/12
0/4
0/9
0/7
1/20
1/14
1/4
A flow in G is a function f(u,v):V×V→R for u,v∈V
f(s,a)=1
f(s,c)=1
f(a,b)=1
f(b,c)=0
f(c,d)=1
f(d,b)=0
f(b,t)=1
f(d,t)=1
the value of this flow is 2
f(c,a)=0
8.0 - Maximum Flow
8.0 - Maximum Flow
8.0 - Maximum Flow
a
s
c
t
source
sink
0/2
0/1
0/3
0/2
0/1
8.0 - Maximum Flow
a
s
c
t
source
sink
0/2
1/1
0/3
1/2
0/1
8.0 - Maximum Flow
a
s
c
t
source
sink
1/2
1/1
0/3
1/2
1/1
8.0 - Maximum Flow
a
s
c
t
source
sink
2/2
1/1
1/3
2/2
1/1
8.0 - Maximum Flow
a
s
c
t
source
sink
2/2
1/1
1/3
2/2
1/1
Ingredient #1:
8.0 - Maximum Flow
a
s
c
t
source
sink
0/2
0/1
0/3
0/2
0/1
8.0 - Maximum Flow
a
s
c
t
source
sink
2/2
0/1
2/3
2/2
0/1
8.0 - Maximum Flow
a
s
c
t
source
sink
2/2
0/1
2/3
2/2
0/1
Ingredient #2:
8.0 - Maximum Flow
a
s
c
t
source
sink
2/2
0/1
2/3
2/2
0/1
Ingredient #2:
8.0 - Maximum Flow
a
s
c
t
source
sink
0/1
2/3
2/2
0/1
Ingredient #2:
1/3
0/2
2/2
0/2
8.0 - Maximum Flow
a
s
c
t
source
sink
0/1
2/3
2/2
0/1
Ingredient #2:
1/3
0/2
2/2
0/2
8.0 - Maximum Flow
a
s
c
t
source
sink
1/1
1/3
2/2
1/1
2/3
0/2
2/2
0/2
Ingredient #2:
8.0 - Maximum Flow
a
s
c
t
source
sink
1/1
1/3
2/2
1/1
2/3
0/2
2/2
0/2
a
s
c
t
source
sink
2/2
0/1
2/3
2/2
0/1
8.0 - Maximum Flow
a
s
c
t
source
sink
1/1
1/3
2/2
1/1
2/3
0/2
2/2
0/2
a
s
c
t
source
sink
2/2
1/1
1/3
2/2
1/1
8.0 - Maximum Flow
a
s
c
t
source
sink
0/2
0/1
0/3
0/2
0/1
cf(u,v)=⎩⎨⎧c(u,v)−f(u,v)f(v,u)0if (u,v)∈E,if (v,u)∈E,otherwise
8.0 - Maximum Flow
a
s
c
t
source
sink
0/2
0/1
0/3
0/2
0/1
cf(u,v)=⎩⎨⎧c(u,v)−f(u,v)f(v,u)0if (u,v)∈E,if (v,u)∈E,otherwise
a
s
c
t
source
sink
2
1
3
2
1
8.0 - Maximum Flow
a
s
c
t
source
sink
0/2
0/1
0/3
0/2
0/1
cf(u,v)=⎩⎨⎧c(u,v)−f(u,v)f(v,u)0if (u,v)∈E,if (v,u)∈E,otherwise
a
s
c
t
source
sink
2
1
3
2
1
0
0
0
0
0
8.0 - Maximum Flow
a
s
c
t
source
sink
0/2
1/1
0/3
1/2
0/1
cf(u,v)=⎩⎨⎧c(u,v)−f(u,v)f(v,u)0if (u,v)∈E,if (v,u)∈E,otherwise
a
s
c
t
source
sink
2
0
3
1
1
0
1
1
0
0
8.0 - Maximum Flow
a
s
c
t
source
sink
1/2
1/1
1/3
2/2
0/1
cf(u,v)=⎩⎨⎧c(u,v)−f(u,v)f(v,u)0if (u,v)∈E,if (v,u)∈E,otherwise
a
s
c
t
source
sink
1
0
2
0
1
1
1
2
1
0
8.0 - Maximum Flow
a
s
c
t
source
sink
1/2
1/1
1/3
2/2
0/1
cf(u,v)=⎩⎨⎧c(u,v)−f(u,v)f(v,u)0if (u,v)∈E,if (v,u)∈E,otherwise
a
s
c
t
source
sink
1
2
1
1
1
2
1
8.0 - Maximum Flow
cf(u,v)=⎩⎨⎧c(u,v)−f(u,v)f(v,u)0if (u,v)∈E,if (v,u)∈E,otherwise
8.0 - Maximum Flow
8.0 - Maximum Flow
a
s
c
t
source
sink
1/2
1/1
1/3
2/2
0/1
8.0 - Maximum Flow
sink
f(s,a)=1
f(s,c)=1
f(a,t)=2
a
s
c
t
source
sink
1/2
1/1
1/3
2/2
0/1
f(c,a)=1
f(c,t)=0
8.0 - Maximum Flow
sink
a
s
c
t
source
sink
1/2
1/1
1/3
2/2
0/1
a
s
c
t
source
sink
1
2
1
1
1
2
1
8.0 - Maximum Flow
sink
a
s
c
t
source
sink
1/2
1/1
1/3
2/2
0/1
a
s
c
t
source
sink
1
2
1
1
1
2
1
8.0 - Maximum Flow
sink
a
s
c
t
source
sink
1/2
1/1
1/3
2/2
0/1
a
s
c
t
source
sink
1
2
1
1
1
2
1
8.0 - Maximum Flow
sink
a
s
c
t
source
sink
1/2
1/1
1/3
2/2
0/1
a
s
c
t
source
sink
1
2
1
1
1
2
1
8.0 - Maximum Flow
(f↑fp)(u,v)={f(u,v)+fp(u,v)−fp(v,u)0if (u,v)∈E,otherwise.
a
s
c
t
source
sink
1
2
1
1
1
2
1
8.0 - Maximum Flow
∣f↑fp∣=∣f∣+∣fp∣>∣f∣
(Lemma 26.1, Corollary 26.3 of CLRS, page 717, 720)
(f↑fp)(u,v)={f(u,v)+fp(u,v)−fp(v,u)0if (u,v)∈E,otherwise.
8.0 - Maximum Flow
∣f↑fp∣=∣f∣+∣fp∣>∣f∣
(Lemma 26.1, Corollary 26.3 of CLRS, page 717, 720)
(f↑fp)(u,v)={f(u,v)+fp(u,v)−fp(v,u)0if (u,v)∈E,otherwise.
8.0 - Maximum Flow
a
s
c
t
source
sink
0/2
0/1
0/3
0/2
0/1
8.0 - Maximum Flow
a
s
c
t
source
sink
2/2
0/1
2/3
2/2
0/1
8.0 - Maximum Flow
a
s
c
t
source
sink
2/2
0/1
2/3
2/2
0/1
a
s
c
t
source
sink
1
1
2
1
2
2
G
Gf
8.0 - Maximum Flow
a
s
c
t
source
sink
2/2
0/1
2/3
2/2
0/1
a
s
c
t
source
sink
1
1
2
1
2
2
G
Gf
8.0 - Maximum Flow
a
s
c
t
source
sink
2/2
1/1
1/3
2/2
1/1
a
s
c
t
source
sink
1
1
2
1
2
2
G
Gf
8.0 - Maximum Flow
a
s
c
t
source
sink
2/2
1/1
1/3
2/2
1/1
a
s
c
t
source
sink
2
1
1
1
2
2
G
Gf
8.0 - Maximum Flow
8.0 - Maximum Flow
8.0 - Maximum Flow
8.0 - Maximum Flow
a
s
c
t
b
d
source
sink
0/13
0/16
0/12
0/4
0/9
0/7
0/20
0/14
0/4