# Flow Networks

05 — 08 — 2009

¨ ¨ Soren Wellhofer

Introduction Deﬁnitions Problems / Solutions References

1 Introduction 2 Deﬁnitions 3 Problems / Solutions 4 References

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Flow network

Abstract
• Directed graph • Source s and sink t

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Flow network

Abstract
• Directed graph • Source s and sink t • Edges have capacity

a

s

t

b

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Flow network

Abstract
• Directed graph • Source s and sink t • Edges have capacity • Flow: s → t

a 5 s 2 b 3 5 1 t

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Flow network

Abstract
• Directed graph • Source s and sink t • Edges have capacity • Flow: s → t

a 5 s 2 b 3 5 1 t

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Flow network

Abstract
• Directed graph • Source s and sink t • Edges have capacity • Flow: s → t • Flow from s

a 3/5 s 2/2 b 2/ 3 4/ 5 1/1 t

equals ﬂow into t

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Flow network

Abstract
• Directed graph • Source s and sink t • Edges have capacity • Flow: s → t • Flow from s

a 3/5 s 2/2 b 2/ 3 4/ 5 1/1 t

equals ﬂow into t

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Formal deﬁnition Nf = G (V , E )
V u, v ∈ V Set of vertices (nodes)

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Formal deﬁnition Nf = G (V , E )
V u, v ∈ V Set of vertices (nodes) Set of edges (arcs)

(u, v ) ∈ E

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Formal deﬁnition Nf = G (V , E )
V u, v ∈ V Set of vertices (nodes) Set of edges (arcs) Real-valued edge capacity

(u, v ) ∈ E c(u, v )

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Formal deﬁnition Nf = G (V , E )
V u, v ∈ V Set of vertices (nodes) Set of edges (arcs) Real-valued edge capacity Net-ﬂow from u to v

(u, v ) ∈ E c(u, v ) f (u, v )

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Formal deﬁnition Nf = G (V , E )
V u, v ∈ V Set of vertices (nodes) Set of edges (arcs) Real-valued edge capacity Net-ﬂow from u to v Source and sink

(u, v ) ∈ E c(u, v ) f (u, v ) s, t ∈ V

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Formal deﬁnition Nf = G (V , E )
V u, v ∈ V Set of vertices (nodes) Set of edges (arcs) Real-valued edge capacity Net-ﬂow from u to v Source and sink

(u, v ) ∈ E c(u, v ) f (u, v ) s, t ∈ V

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Network Properties
Capacity constraints

0 ≤ f (u, v ) ≤ c(u, v )

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Network Properties
Capacity constraints

0 ≤ f (u, v ) ≤ c(u, v )
Skew symmetry

f (u, v ) = −f (v , u)

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Network Properties
Capacity constraints

0 ≤ f (u, v ) ≤ c(u, v )
Skew symmetry

f (u, v ) = −f (v , u)

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Properties
Flow conservation
u∈V

f (u, w ) = 0,

if u = s ∧ u = t

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Properties
Flow conservation
u∈V

f (u, w ) = 0,

if u = s ∧ u = t

Net ﬂow to node = 0

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Properties
Flow conservation
u∈V

f (u, w ) = 0,

if u = s ∧ u = t

Net ﬂow to node = 0

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Properties
Flow conservation
u∈V

f (u, w ) = 0,

if u = s ∧ u = t

Net ﬂow to node = 0

3

1 n 2

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Properties
Flow conservation
u∈V

f (u, w ) = 0,

if u = s ∧ u = t

Net ﬂow to node = 0

3

-1 n -2

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Properties
Flow conservation
u∈V

f (u, w ) = 0,

if u = s ∧ u = t

Net ﬂow to node = 0

3

-1 n -2

=0
S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Capacity of a Path
a 5 s 2 b
p = (s, a, b, t)

1 3 5 t

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Capacity of a Path
a 5 s 2 b
p = (s, a, b, t) c(p) = min(c(s, a), c(a, b), c(b, t))

1 3 5 t

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Capacity of a Path
a 5 s 2 b
p = (s, a, b, t) c(p) = min(c(s, a), c(a, b), c(b, t))

1 3 5 t

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Capacity of a Path
a 5 s 2 b
p = (s, a, b, t) c(p) = min(c(s, a), c(a, b), c(b, t)) c(p) = min(5, 3, 5)
S¨ren Wellh¨fer o o Flow Networks

1 3 5 t

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Capacity of a Path
a 5 s 2 b
p = (s, a, b, t) c(p) = min(c(s, a), c(a, b), c(b, t)) c(p) = min(5, 3, 5) = 3
S¨ren Wellh¨fer o o Flow Networks

1 3 5 t

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Capacity of a Path
a 5 s 2 b
p = (s, a, b, t) c(p) = min(c(s, a), c(a, b), c(b, t)) c(p) = min(5, 3, 5) = 3
S¨ren Wellh¨fer o o Flow Networks

1 3 5 t

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Residual Network
Nr = Gr (V , Er ) Er ... residual edges

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Residual Network
Nr = Gr (V , Er ) cr (u, v ) = c(u, v ) − f (u, v ) Er ... residual edges

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Residual Network
Nr = Gr (V , Er ) cr (u, v ) = c(u, v ) − f (u, v ) Er ... residual edges ... residual edge capacity

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Residual Network
Nr = Gr (V , Er ) cr (u, v ) = c(u, v ) − f (u, v ) Er ... residual edges ... residual edge capacity

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Residual Network
Nr = Gr (V , Er ) cr (u, v ) = c(u, v ) − f (u, v ) Er ... residual edges ... residual edge capacity

a 3/5 s 2/2 b
S¨ren Wellh¨fer o o Flow Networks

1/1 2/3 4/5 t

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Residual Network
Nr = Gr (V , Er ) cr (u, v ) = c(u, v ) − f (u, v ) Er ... residual edges ... residual edge capacity

a 3/5 -3 s 2/2 b
S¨ren Wellh¨fer o o Flow Networks

1/1 2/3 4/5 t

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Residual Network
Nr = Gr (V , Er ) cr (u, v ) = c(u, v ) − f (u, v ) Er ... residual edges ... residual edge capacity

a 3/5 -3 s -2 2/2 b
S¨ren Wellh¨fer o o Flow Networks

1/1 -1 2/3 -2 -4 4/5 t

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Residual Network
Nr = Gr (V , Er ) cr (u, v ) = c(u, v ) − f (u, v ) Er ... residual edges ... residual edge capacity

a 2 3 s 2 0 b
S¨ren Wellh¨fer o o Flow Networks

0 1 1 3 4 1 t

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Residual Network
Nr = Gr (V , Er ) cr (u, v ) = c(u, v ) − f (u, v ) Er ... residual edges ... residual edge capacity

a 2 3 s 2 0 b
S¨ren Wellh¨fer o o Flow Networks

0 1 1 3 4 1 t

Augmenting path: pa = (s, a, b, t)

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Residual Network
Nr = Gr (V , Er ) cr (u, v ) = c(u, v ) − f (u, v ) Er ... residual edges ... residual edge capacity

a 2 3 s 2 0 b
S¨ren Wellh¨fer o o Flow Networks

0 1 1 3 4 1 t

Augmenting path: pa = (s, a, b, t) cr (pa ) = min(2, 1, 1) = 1

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Residual Network
Nr = Gr (V , Er ) cr (u, v ) = c(u, v ) − f (u, v ) Er ... residual edges ... residual edge capacity

a 2 3 s 2 0 b
S¨ren Wellh¨fer o o Flow Networks

0 1 1 3 4 1 t

Augmenting path: pa = (s, a, b, t) cr (pa ) = min(2, 1, 1) = 1

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Network cut
Partition of G into two sets S and T

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Network cut
Partition of G into two sets S and T s ∈S ∧t ∈T

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Network cut
Partition of G into two sets S and T s ∈S ∧t ∈T

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Network cut
Partition of G into two sets S and T s ∈S ∧t ∈T

a 5 s 2 b
S¨ren Wellh¨fer o o Flow Networks

1 3 5 t

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Network cut
Partition of G into two sets S and T s ∈S ∧t ∈T

a 5 s 2 b
S¨ren Wellh¨fer o o Flow Networks

1 3 5 t

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Network cut
Partition of G into two sets S and T s ∈S ∧t ∈T

a 5 s S 2 b
S¨ren Wellh¨fer o o Flow Networks

1 3 5 t

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Network cut
Partition of G into two sets S and T s ∈S ∧t ∈T

a 5 s S 2 3 T =G −S 5 b
S¨ren Wellh¨fer o o

1 t

Cut Capacity: c(S, T ) =
u∈S∧v ∈T

c(u, v )

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Network cut
Partition of G into two sets S and T s ∈S ∧t ∈T

a 5 s S 2 3 T =G −S 5 b
S¨ren Wellh¨fer o o

1 t

Cut Capacity: c(S, T ) =
u∈S∧v ∈T

c(u, v )

c(S, T ) = 5 + 5 = 10

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Formal deﬁnition Network Properties Path capacity Residual network Network cuts

Network cut
Partition of G into two sets S and T s ∈S ∧t ∈T

a 5 s S 2 3 T =G −S 5 b
S¨ren Wellh¨fer o o

1 t

Cut Capacity: c(S, T ) =
u∈S∧v ∈T

c(u, v )

c(S, T ) = 5 + 5 = 10

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Maximum Flow
Flow at max if no augmenting paths in G

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Maximum Flow
Flow at max if no augmenting paths in G

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Maximum Flow
Flow at max if no augmenting paths in G

a 3/5 s 2/2 b
S¨ren Wellh¨fer o o Flow Networks

1/1 2/3 4/5 t

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Maximum Flow
Flow at max if no augmenting paths in G

a 2 3 s 2 0 b
Flow Networks

0 1 1 3 4 1 t

S¨ren Wellh¨fer o o

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Maximum Flow
Flow at max if no augmenting paths in G

a 2 3 s 2 0 b
Flow Networks

0 1 1 3 4 1 t

S¨ren Wellh¨fer o o

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Maximum Flow
Flow at max if no augmenting paths in G

a 1 3 s 2 0 b
Flow Networks

0 1 0 3 4 0 t

S¨ren Wellh¨fer o o

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Maximum Flow
Flow at max if no augmenting paths in G

a 4/5 s 2/2 b
S¨ren Wellh¨fer o o Flow Networks

1/1 3/3 5/5 t

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
• 1956, L. Ford and D. Fulkerson

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
• 1956, L. Ford and D. Fulkerson • Compute maximum ﬂow of Nf in O(|E | · f )

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
• 1956, L. Ford and D. Fulkerson • Compute maximum ﬂow of Nf in O(|E | · f ) • Might not ﬁnd max ﬂow • Termination not guaranteed

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
• 1956, L. Ford and D. Fulkerson • Compute maximum ﬂow of Nf in O(|E | · f ) • Might not ﬁnd max ﬂow • Termination not guaranteed

Idea:

While there exist augmenting paths, increase ﬂow along those.

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
• 1956, L. Ford and D. Fulkerson • Compute maximum ﬂow of Nf in O(|E | · f ) • Might not ﬁnd max ﬂow • Termination not guaranteed

Idea:

While there exist augmenting paths, increase ﬂow along those.

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
Initialization

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
Initialization

∀(u, v ) ∈ E

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
Initialization

∀(u, v ) ∈ E → f (u, v ) = 0

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
Initialization

∀(u, v ) ∈ E → f (u, v ) = 0
Augmentation

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
Initialization

∀(u, v ) ∈ E → f (u, v ) = 0
Augmentation

while

∃pa ∈ Gr

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
Initialization

∀(u, v ) ∈ E → f (u, v ) = 0
Augmentation

while

∃pa ∈ Gr

(there exist augmenting paths)

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
Initialization

∀(u, v ) ∈ E → f (u, v ) = 0
Augmentation

while ∃pa ∈ Gr · compute cr (pa )

(there exist augmenting paths)

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
Initialization

∀(u, v ) ∈ E → f (u, v ) = 0
Augmentation

while ∃pa ∈ Gr · compute cr (pa ) · ∀(u, v ) ∈ pa

(there exist augmenting paths)

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
Initialization

∀(u, v ) ∈ E → f (u, v ) = 0
Augmentation
(there exist augmenting paths) while ∃pa ∈ Gr · compute cr (pa ) · ∀(u, v ) ∈ pa f (u, v ) += cr (pa )

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
Initialization

∀(u, v ) ∈ E → f (u, v ) = 0
Augmentation
(there exist augmenting paths) while ∃pa ∈ Gr · compute cr (pa ) · ∀(u, v ) ∈ pa (forward arc) f (u, v ) += cr (pa )

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
Initialization

∀(u, v ) ∈ E → f (u, v ) = 0
Augmentation
(there exist augmenting paths) while ∃pa ∈ Gr · compute cr (pa ) · ∀(u, v ) ∈ pa (forward arc) f (u, v ) += cr (pa ) f (v , u) -= cr (pa )

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
Initialization

∀(u, v ) ∈ E → f (u, v ) = 0
Augmentation
(there exist augmenting paths) while ∃pa ∈ Gr · compute cr (pa ) · ∀(u, v ) ∈ pa (forward arc) f (u, v ) += cr (pa ) (backward arc) f (v , u) -= cr (pa )

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm
Initialization

∀(u, v ) ∈ E → f (u, v ) = 0
Augmentation
(there exist augmenting paths) while ∃pa ∈ Gr · compute cr (pa ) · ∀(u, v ) ∈ pa (forward arc) f (u, v ) += cr (pa ) (backward arc) f (v , u) -= cr (pa )

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm Demo
a 0/5 s 0/2 b 0/3 0/5 0/1 t

f (s, t) =

u∈V

f (s, u) = =0

u∈V

f (u, t)

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm Demo
a 1/5 s 0/2 b 0/3 0/5 1/1 t

f (s, t) =

u∈V

f (s, u) = =1

u∈V

f (u, t)

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm Demo
a 4/5 s 0/2 b 3/3 3/5 1/1 t

f (s, t) =

u∈V

f (s, u) = =4

u∈V

f (u, t)

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm Demo
a 4/5 s 2/2 b 3/3 5/5 1/1 t

f (s, t) =

u∈V

f (s, u) = =6

u∈V

f (u, t)

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Ford-Fulkerson Algorithm Demo
a 4/5 s 2/2 b 3/3 5/5 1/1 t

f (s, t) =

u∈V

f (s, u) =

u∈V

f (u, t)

fmax (s, t) = 6
S¨ren Wellh¨fer o o Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Minimum-cut Maximum-ﬂow theorem
• Minimum cut: cut of smallest capacity c(S, T ) = min

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Minimum-cut Maximum-ﬂow theorem
• Minimum cut: cut of smallest capacity c(S, T ) = min

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Minimum-cut Maximum-ﬂow theorem
• Minimum cut: cut of smallest capacity c(S, T ) = min

a 5 s 2 b 3 5 1 t

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Minimum-cut Maximum-ﬂow theorem
• Minimum cut: cut of smallest capacity c(S, T ) = min

a 5 s 2 b 3 5 1 t

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Minimum-cut Maximum-ﬂow theorem
• Minimum cut: cut of smallest capacity c(S, T ) = min

a 5 s 2 b 3 5 1 t

cmin (S, T ) = 5 + 1 = 6
S¨ren Wellh¨fer o o Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Minimum-cut Maximum-ﬂow theorem
• Minimum cut: cut of smallest capacity c(S, T ) = min

a 4/5 s 2/2 b 3/3 5/5 1/1 t

fmax (s, t) = cmin (S, T ) = 6
S¨ren Wellh¨fer o o Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Summary
• Directed graph, capacities, ﬂow • Residual network, network cuts

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Summary
• Directed graph, capacities, ﬂow • Residual network, network cuts • Maximum ﬂow, Ford-Fulkerson algorithm,

Min-cut Max-ﬂow theorem

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Summary
• Directed graph, capacities, ﬂow • Residual network, network cuts • Maximum ﬂow, Ford-Fulkerson algorithm,

Min-cut Max-ﬂow theorem

Practical applications
• Pipe networks

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Summary
• Directed graph, capacities, ﬂow • Residual network, network cuts • Maximum ﬂow, Ford-Fulkerson algorithm,

Min-cut Max-ﬂow theorem

Practical applications
• Pipe networks • Traﬃc ﬂow modeling

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Summary
• Directed graph, capacities, ﬂow • Residual network, network cuts • Maximum ﬂow, Ford-Fulkerson algorithm,

Min-cut Max-ﬂow theorem

Practical applications
• Pipe networks • Traﬃc ﬂow modeling • Commodity/Market ﬂow

S¨ren Wellh¨fer o o

Flow Networks

Introduction Deﬁnitions Problems / Solutions References

Maximum Flow Ford-Fulkerson Algorithm

Summary
• Directed graph, capacities, ﬂow • Residual network, network cuts • Maximum ﬂow, Ford-Fulkerson algorithm,

Min-cut Max-ﬂow theorem

Practical applications
• Pipe networks • Traﬃc ﬂow modeling • Commodity/Market ﬂow

S¨ren Wellh¨fer o o

Flow Networks

Graph Theory Bondy, Murty Graduate Texts in Mathematics, Springer, 2008 Graphs, Flows, and the Ford-Fulkerson Algorithm Vince Vatter, 2004 Network ﬂows Kevin Weyn, 2005 A simple Min-cut algorithm Mechthild Stoer, Frank Wagner Freie Universit¨t Berlin, 1997 a Flow network, Ford-Fulkerson algorithm, Maximum-ﬂow minimum-cut theorem Wikipedia, [http://en.wikipedia.org/wiki], 2009

Introduction Deﬁnitions Problems / Solutions References

Flow Networks
05 — 08 — 2009

¨ ¨ Soren Wellhofer

S¨ren Wellh¨fer o o

Flow Networks