Maximum Flow Problems: Flows and Cuts Augmenting Path Algorithm
Maximum Flow Problems: Flows and Cuts Augmenting Path Algorithm
Maximum Flow Problems: Flows and Cuts Augmenting Path Algorithm
2
Residual Network (see pp. 44-46)
• An augmenting path is a directed path from the source to the sink in the
residual network
– Its capacity is the minimum (residual) capacity of the arcs it contains
– If the network contains an augmenting path, then we can send more units
of flow from the source to the sink
• An increase of units on arc (i, j) in the residual network corresponds
to, in the original network, increasing xij by units, or decreasing xji by
units, or increasing xij by a units while decreasing xji by (1-a) units,
0 < a < 1 (i.e., an aug. path may actually subtract flows from some arcs)
• Residual capacities do not uniquely determine the flows in the original
network. We will use the convention:
– if uij rij, set xij = uij - rij and xji = 0
– otherwise, set xij = 0 and xji = rij - uij
5
Labeling Algorithm
6
The Labeling Algorithm (main)
7
Procedure augment
8
Max-Flow Min-Cut Theorem
1 4
3
t = 4: d(1) = 3, d(2) = 1, d(3) = 2, d(4) = 0
The shortest augmenting path algorithm identifies the
augmenting path in the residual network containing the
fewest arcs and runs in O(n2m) time (labeling algorithm is
O(nmU), where U is the largest finite arc capacity).
10
Preflow-Push Algorithm
procedure preprocess;
begin
x := 0;
compute the exact distance labels d(i);
xsj = usj for each arc (s, j) A(s);
d(s) := n;
end;
procedure push/relabel(i);
begin
if the network contains an admissible arc (i, j) then
push = min{e(i), rij} units of flow from i to j
else replace d(i) by min{d(j) + 1 : (i, j) A(i) and rij > 0};
end;
13
Preflow-Push Algorithm
algorithm preflow-push;
begin
preprocess;
while the network contains an active node do
begin
select an active node i;
push/relabel(i);
end;
end;
14
Termination & Complexity
15