Zolt´an Szigeti
1
4 t
s
2 4 3
4 b
Problem
Find in the network(D,g)ag-feasible (s,t)-flow ofmaximumvalue and an (s,t)-cut ofminimumcapacity!
(0,1)
(0,4) t
s
(0,2) (0,4) (3,3)
(4,4) b Initialization
Preflowx
(0,1)
(0,4) t
s
(0,2) (0,4) (3,3)
(4,4) b
s t
b Construction
Auxiliary graphDx
(0,1)
(0,4) t
s
(0,2) (0,4) (3,3)
(4,4) b
s t
b
0 0
4
Initialization
Labellingℓ
(0,1)
(0,4) t
s
(0,2) (0,4) (3,3)
(4,4) b
s t
b
0 0
4
Looking for active vertex
fx(a) =dx−(a)−dx+(a)
= (3 + 0)−(0 + 0) = 3>0
=⇒ais x-active
(0,1)
(0,4) t
s
(0,2) (0,4) (3,3)
(4,4) b
s t
b
0 0
4
Looking for tight arc leaving a
ℓ(a) = 06= 1 =ℓ(b) + 1 =ℓ(t) + 1 6= 5 =ℓ(s) + 1
=⇒noℓ-tight arc leavingaexists
(0,1)
(0,4) t
s
(0,2) (0,4) (3,3)
(4,4) b
s t
b
0 0
4
Relabel at a
ℓ′(a) = min{ℓ(v) + 1 :av ∈Ax}
= min{0 + 1,0 + 1,4 + 1}= 1
(0,1)
(0,4) t
s
(0,2) (0,4) (3,3)
(4,4) b
s t
b
0 0
4
Relabel at a
ℓ′(a) = min{ℓ(v) + 1 :av ∈Ax}
= min{0 + 1,0 + 1,4 + 1}= 1
(0,1)
(0,4) t
s
(0,2) (0,4) (3,3)
(4,4) b
s t
b
0 0
4
Relabel at a
ℓ′(a) = min{ℓ(v) + 1 :av ∈Ax}
= min{0 + 1,0 + 1,4 + 1}= 1 arcatbecomes ℓ′-tight
(0,1)
(0,4) t
s
(0,2) (0,4) (3,3)
(4,4) b
s t
b
0 0
4
Pushon at
ε =min{g(at),fx(a)}
= min{4−0 + 0,3}= 3 x′(at)=x(at) +ε= 0 + 3 = 3 x′(e) =x(e)∀e∈A\ {at}
(0,1)
(0,4) t
s
(0,2) (3,4) (3,3)
(4,4) b
Pushon at
ε =min{g(at),fx(a)}
= min{4−0 + 0,3}= 3 x′(at)=x(at) +ε= 0 + 3 = 3 x′(e) =x(e)∀e∈A\ {at}
ais notx′-active anymore
(0,1)
(0,4) t
s
(0,2) (3,4) (3,3)
(4,4) b
Looking for active vertex
fx(b) =dx−(b)−dx+(b)
= (4 + 0)−(0 + 0) = 4>0
=⇒bisx-active
(0,1)
(0,4) t
s
(0,2) (3,4) (3,3)
(4,4) b
s t
b Construction
Auxiliary graphDx
(0,1)
(0,4) t
s
(0,2) (3,4) (3,3)
(4,4) b
s t
b
0 0
4
Previous labelling
(0,1)
(0,4) t
s
(0,2) (3,4) (3,3)
(4,4)
b 0
s t
b
0 4
Looking for tight arc leaving b
ℓ(b) = 06= 2 =ℓ(a) + 1 6= 1 =ℓ(t) + 1 6= 5 =ℓ(s) + 1
=⇒noℓ-tight arc leavingbexists
(0,1)
(0,4) t
s
(0,2) (3,4) (3,3)
(4,4)
b 0
s t
b
0 4
Relabel at b
ℓ′(b) = min{ℓ(v) + 1 :bv ∈Ax}
= min{1 + 1,0 + 1,4 + 1}= 1
(0,1)
(0,4) t
s
(0,2) (3,4) (3,3)
(4,4)
b 1
s t
b
0 4
Relabel at b
ℓ′(b) = min{ℓ(v) + 1 :bv ∈Ax}
= min{1 + 1,0 + 1,4 + 1}= 1
(0,1)
(0,4) t
s
(0,2) (3,4) (3,3)
(4,4)
b 1
s t
b
0 4
Relabel at b
ℓ′(b) = min{ℓ(v) + 1 :bv ∈Ax}
= min{1 + 1,0 + 1,4 + 1}= 1 arcbt becomesℓ′-tight
(0,1)
(0,4) t
s
(0,2) (3,4) (3,3)
(4,4)
b 1
s t
b
0 4
Pushon bt
ε =min{g(bt),fx(b)}
= min{2−0 + 0,4}= 2 x′(bt)=x(bt) +ε= 0 + 2 = 2
(0,1)
(0,4) t
s
(2,2) (3,4) (3,3)
(4,4) b
Pushon bt
ε =min{g(bt),fx(b)}
= min{2−0 + 0,4}= 2 x′(bt)=x(bt) +ε= 0 + 2 = 2
(0,1)
(0,4) t
s
(2,2) (3,4) (3,3)
(4,4) b
Pushon bt
ε =min{g(bt),fx(b)}
= min{2−0 + 0,4}= 2 x′(bt)=x(bt) +ε= 0 + 2 = 2
bis stillx′-active
(0,1)
(0,4) t
s
(2,2) (3,4) (3,3)
(4,4) b
s t
b Construction
Auxiliary graphDx
(0,1)
(0,4) t
s
(2,2) (3,4) (3,3)
(4,4) b
s t
b
0 1
4
Previous labelling
(0,1)
(0,4) t
s
(2,2) (3,4) (3,3)
(4,4)
b 1
s t
b
0 4
Looking for tight arc leaving b
ℓ(b) = 16= 2 =ℓ(a) + 1 6= 5 =ℓ(s) + 1
=⇒noℓ-tight arc leavingbexists
(0,1)
(0,4) t
s
(2,2) (3,4) (3,3)
(4,4)
b 1
s t
b
0 4
Relabel at b
ℓ′(b) = min{ℓ(v) + 1 :bv ∈Ax}
= min{1 + 1,4 + 1}= 2
(0,1)
(0,4) t
s
(2,2) (3,4) (3,3)
(4,4)
b 2
s t
b
0 4
Relabel at b
ℓ′(b) = min{ℓ(v) + 1 :bv ∈Ax}
= min{1 + 1,4 + 1}= 2
(0,1)
(0,4) t
s
(2,2) (3,4) (3,3)
(4,4)
b 2
s t
b
0 4
Relabel at b
ℓ′(b) = min{ℓ(v) + 1 :bv ∈Ax}
= min{1 + 1,4 + 1}= 2 arcbabecomesℓ′-tight
(0,1)
(0,4) t
s
(2,2) (3,4) (3,3)
(4,4)
b 2
s t
b
0 4
Pushon ba
ε =min{g(ba),fx(b)}
= min{4−0 + 0,2}= 2 ε′ =min{x(ab), ε}= min{0,2}= 0 x′(ba)=x(ba) +ε−ε′ = 0+2−0 = 2 x′(ab)=x(ab)−ε′= 0−0 = 0
(0,1)
(2,4) t
s
(2,2) (3,4) (3,3)
(4,4) b
Pushon ba
ε =min{g(ba),fx(b)}
= min{4−0 + 0,2}= 2 ε′ =min{x(ab), ε}= min{0,2}= 0 x′(ba)=x(ba) +ε−ε′ = 0+2−0 = 2 x′(ab)=x(ab)−ε′= 0−0 = 0
(0,1)
(2,4) t
s
(2,2) (3,4) (3,3)
(4,4) b
Pushon ba
ε =min{g(ba),fx(b)}
= min{4−0 + 0,2}= 2 ε′ =min{x(ab), ε}= min{0,2}= 0 x′(ba)=x(ba) +ε−ε′ = 0+2−0 = 2 x′(ab)=x(ab)−ε′= 0−0 = 0
(0,1)
(2,4) t
s
(2,2) (3,4) (3,3)
(4,4) b
Looking for active vertex
fx′(a) =d−
x′(a)−d+
x′(a)
= (3 + 2)−(3 + 0) = 2>0
=⇒ais x′-active
(0,1)
(2,4) t
s
(2,2) (3,4) (3,3)
(4,4) b
s t
b Construction
Auxiliary graphDx
(0,1)
(2,4) t
s
(2,2) (3,4) (3,3)
(4,4) b
s t
b
0 2
4
Previous labelling
(0,1)
(2,4) t
s
(2,2) (3,4) (3,3)
(4,4) b
s t
b
0 2
4
Looking for tight arc leaving a
ℓ(a) = 1 =ℓ(t) + 1
(0,1)
(2,4) t
s
(2,2) (3,4) (3,3)
(4,4) b
s t
b
0 2
4
Looking for tight arc leaving a
ℓ(a) = 1 =ℓ(t) + 1
=⇒arcatis ℓ-tight
(0,1)
(2,4) t
s
(2,2) (3,4) (3,3)
(4,4) b
s t
b
0 2
4
Pushon at
ε =min{g(at),fx(a)}
= min{4−3 + 0,2}= 1 x′(at)=x(at) +ε= 3 + 1 = 4
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
Pushon at
ε =min{g(at),fx(a)}
= min{4−3 + 0,2}= 1 x′(at)=x(at) +ε= 3 + 1 = 4
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
Pushon at
ε =min{g(at),fx(a)}
= min{4−3 + 0,2}= 1 x′(at)=x(at) +ε= 3 + 1 = 4 ais stillx′-active
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
s t
b Construction
Auxiliary graphDx
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
s t
b
0 2
4
Previous labelling
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
s t
b
0 2
4
Looking for tight arc leaving a
ℓ(a) = 16= 3 =ℓ(b) + 1 6= 5 =ℓ(s) + 1
=⇒noℓ-tight arc leavingaexists
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
s t
b
0 2
4
Relabel at a
ℓ′(a) = min{ℓ(v) + 1 :av ∈Ax}
= min{2 + 1,4 + 1}= 3
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
s t
b
0 2
4
Relabel at a
ℓ′(a) = min{ℓ(v) + 1 :av ∈Ax}
= min{2 + 1,4 + 1}= 3
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
s t
b
0 2
4
Relabel at a
ℓ′(a) = min{ℓ(v) + 1 :av ∈Ax}
= min{2 + 1,4 + 1}= 3 arcabbecomesℓ′-tight
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
s t
b
0 2
4
Pushon ab
ε =min{g(ab),fx(a)}
= min{1−0 + 2,1}= 1 ε′ =min{x(ba), ε}= min{2,1}= 1 x′(ab)=x(ab) +ε−ε′= 0 + 1-1 = 0 x′(ba)=x(ba)−ε′= 2−1 = 1
(0,1)
(1,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
Pushon ab
ε =min{g(ab),fx(a)}
= min{1−0 + 2,1}= 1 ε′ =min{x(ba), ε}= min{2,1}= 1 x′(ab)=x(ab) +ε−ε′= 0 + 1-1 = 0 x′(ba)=x(ba)−ε′= 2−1 = 1
(0,1)
(1,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
Pushon ab
ε =min{g(ab),fx(a)}
= min{1−0 + 2,1}= 1 ε′ =min{x(ba), ε}= min{2,1}= 1 x′(ab)=x(ab) +ε−ε′= 0 + 1-1 = 0 x′(ba)=x(ba)−ε′= 2−1 = 1
ais notx′-active anymore
(0,1)
(1,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
Looking for active vertex
fx′(b) =d−
x′(b)−d+
x′(b)
= (4 + 0)−(1 + 2) = 1>0
=⇒bisx′-active
(0,1)
(1,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
s t
b Construction
Auxiliary graphDx
(0,1)
(1,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
s t
b
0 2
4
Previous labelling
(0,1)
(1,4) t
s
(2,2) (4,4) (3,3)
(4,4)
b 2
s t
b
0 4
Looking for tight arc leaving b
ℓ(b) = 26= 4 =ℓ(a) + 1 6= 5 =ℓ(s) + 1
=⇒noℓ-tight arc leavingbexists
(0,1)
(1,4) t
s
(2,2) (4,4) (3,3)
(4,4)
b 2
s t
b
0 4
Relabel at b
ℓ′(b) = min{ℓ(v) + 1 :bv ∈Ax}
= min{3 + 1,4 + 1}= 4
(0,1)
(1,4) t
s
(2,2) (4,4) (3,3)
(4,4)
b 4
s t
b
0 4
Relabel at b
ℓ′(b) = min{ℓ(v) + 1 :bv ∈Ax}
= min{3 + 1,4 + 1}= 4
(0,1)
(1,4) t
s
(2,2) (4,4) (3,3)
(4,4)
b 4
s t
b
0 4
Relabel at b
ℓ′(b) = min{ℓ(v) + 1 :bv ∈Ax}
= min{3 + 1,4 + 1}= 4 arcbabecomesℓ′-tight
(0,1)
(1,4) t
s
(2,2) (4,4) (3,3)
(4,4)
b 4
s t
b
0 4
Pushon ba
ε =min{g(ba),fx(b)}
= min{4−1 + 0,1}= 1 ε′ =min{x(ab), ε}= min{0,1}= 0 x′(ba)=x(ba) +ε−ε′ = 1 + 1-0 = 2 x′(ab)=x(ab)−ε′= 0−0 = 0
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
Pushon ba
ε =min{g(ba),fx(b)}
= min{4−1 + 0,1}= 1 ε′ =min{x(ab), ε}= min{0,1}= 0 x′(ba)=x(ba) +ε−ε′ = 1 + 1-0 = 2 x′(ab)=x(ab)−ε′= 0−0 = 0
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
Pushon ba
ε =min{g(ba),fx(b)}
= min{4−1 + 0,1}= 1 ε′ =min{x(ab), ε}= min{0,1}= 0 x′(ba)=x(ba) +ε−ε′ = 1 + 1-0 = 2 x′(ab)=x(ab)−ε′= 0−0 = 0
bis notx′-active anymore
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
Looking for active vertex
fx′(a) =d−
x′(a)−d+
x′(a)
= (3 + 2)−(4 + 0) = 1>0
=⇒ais x′-active
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4) b
s t
b Construction
Auxiliary graphDx
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4)
b 4
s t
b
0 4
Previous labelling
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4)
b 4
s t
b
0 4
Looking for tight arc leaving a
ℓ(a) = 36= 5 =ℓ(b) + 1 6= 5 =ℓ(s) + 1
=⇒noℓ-tight arc leavingaexists
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4)
b 4
s t
b
0 4
Relabel at a
ℓ′(a) = min{ℓ(v) + 1 :av ∈Ax}
= min{4 + 1,4 + 1}= 5
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4)
b 4
s t
b
0 4
Relabel at a
ℓ′(a) = min{ℓ(v) + 1 :av ∈Ax}
= min{4 + 1,4 + 1}= 5
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4)
b 4
s t
b
0 4
Relabel at a
ℓ′(a) = min{ℓ(v) + 1 :av ∈Ax}
= min{4 + 1,4 + 1}= 5 arcas becomesℓ′-tight
(0,1)
(2,4) t
s
(2,2) (4,4) (3,3)
(4,4)
b 4
s t
b
0 4
Pushon as
ε =min{g(as),fx(a)}
= min{0−0 + 3,1}= 1 ε′ =min{x(sa), ε}= min{3,1}= 1 x′(sa)=x(sa)−ε′= 3−1 = 2
(0,1)
(2,4) t
s
(2,2) (4,4) (2,3)
(4,4) b
Pushon as
ε =min{g(as),fx(a)}
= min{0−0 + 3,1}= 1 ε′ =min{x(sa), ε}= min{3,1}= 1 x′(sa)=x(sa)−ε′= 3−1 = 2
(0,1)
(2,4) t
s
(2,2) (4,4) (2,3)
(4,4) b
Pushon as
ε =min{g(as),fx(a)}
= min{0−0 + 3,1}= 1 ε′ =min{x(sa), ε}= min{3,1}= 1 x′(sa)=x(sa)−ε′= 3−1 = 2
Looking for active vertex
(0,1)
(2,4) t
s
(2,2) (4,4) (2,3)
(4,4) b
Optimal flow
=⇒x is ag-feasible(s,t)-flow of maximum value
s (2,4) (0,1) t (2,2) (4,4) (2,3)
(4,4) b
s
4
t
b
0 4
Optimal flow
=⇒x is ag-feasible(s,t)-flow of maximum value
Optimal cut
ℓdoes not take1
Z ={v :ℓ(v)>1} is an(s,t)-cut of minimum capacity