Index
Help
1
2
3
4
5
6
1
2
3
4
5
6
def
UpdateFlow(Path):
delta = MinResCap(Path)
for
(u,v)
in
Edges(Path):
if
ForwardEdge(u,v):
flow[(u,v)] = flow[(u,v)] + delta
else
:
flow[(v,u)] = flow[(v,u)] - delta
s = PickSource()
t = PickSink()
while
not
maximal:
Path = ShortestPath(s,t)
if
Path:
UpdateFlow(Path)
else
:
maximal = true
ShowCut(s)