


































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



































What can we observe about this cut
through the network?
Lucky
Puck
needs
to
determine
the
rate
at
which
crates
of
hockey
pucks
can
be
sent
from
the
factory
in
Vancouver
to
the
warehouse
in
Winnipeg
(this
limits
the
rate
at
which
they
can
produce
pucks)
Edges
represent
the
daily
city
to
city
capacity
of
their
shipping
company.
Vancouver(factory)
Winnipeg(warehouse)
Regina
Calgary
Saskatoon
Edmonton
problem from
Introduction to Algorithms, 2
nd
ed
by Cormen, Leiserson, Rivest and Stein
pucks
are
created
in
Vancouver
(the
source
pucks
are
stored
in
Winnipeg
(the
sink
all
other
cities
have
no
storage:
the
flow
in
and
out
of
these
cities
must
sum
to
zero
flow
conservation
the
flow
between
any
two
cities
cannot
exceed
the
shipping
capacity
between
the
cities
capacity
constraint
Vancouver
Winnipeg
Regina
Calgary
Saskatoon
Edmonton
∑
∈
=
V
v
v
u
f
0
)
,
(
∑
∈
V
v
∑
∈
V
v
Ford
Fulkerson
method:
initialize
flow
to
zero
while
there
exists
an
augmenting
path
p:
augment
flow
along
p
return
flow
In
other
words,
find
a
path
which
has
unused
capacity,
and
add
it
to
the
flow
s
t
a
c
0/
0/
0/
0/
0/
b d
0/
0/
0/
0/
0/
we can add a flow of4 along s
Æ
c
Æ
d
Æ
t
s
t
a
c
16/
0/
8/
4/
12/
b d
4/
0/
4/
16/
4/
add 3 alongs
Æ
c
Æ
d
Æ
b
Æ
t
s
t
a
c
16/
0/
11/
7/
12/
b d
4/
0/
4/
19/
7/
max flow: 23
s
t
a b
0/
0/
0/
0/
c d
0/
0/
0/
there’s too much flow
from a
Æ
d,
which prevents adding flow
from b
Æ
d
s
t
a b
2/
0/
0/
0/
c d
0/
2/
2/
To deal with this situation, we can allow augmentingpaths to go backward through edges. Backwardedges naturally subtract flow from the edge.
s
t
a b
2/
0/
0/
0/
c d
0/
2/
2/
add 1 alongs
Æ
b
Æ
d
Æ
a
Æ
c
Æ
t
since d
Æ
a is a
backward edge,we subtract 1from a
Æ
d
s
t
a b
2/
1/
1/
1/
c d
1/
1/
2/
now we have amax flow of 3
s
t
a b
2/
0/
0/
0/
c d
0/
2/
2/
s
t
a b
2
4
3
1
c d
3
3
2
2
residual with aug. path
network
figures from
Introduction to Algorithms, 2
nd
ed
by Cormen, Leiserson, Rivest and Stein