Mac Flow
Mac Flow
Mac Flow
In this handout: The problem statement Augmenting path algorithm for solving the problem
Goal:
Example: 4
O 4
B 6 4
C 5
O 4
5
5 4
4 C
4
B 4 5 6
1 D 5 4 5 4 5
O 4
5
5 4
4 1 C
Residual capacities
Suppose we have an arc with capacity 6 and current flow 5: 5 D B 6 Then there is a residual capacity of 6-5=1 for any additional flow through B D . On the other hand, at most 5 units of flow can be sent back from D to B, i.e., 5 units of previously assigned flow can be canceled. In that sense, 5 can be considered as the residual capacity of the reverse arc D B . To record the residual capacities in the network, we will replace the original directed arcs with undirected arcs: The number at B is the residual capacity of BD; 5 B 1 D the number at D is the residual capacity of DB.
Residual Network
The network given by the undirected arcs and residual capacities is called residual network. In our example, the residual network before sending any flow: 0 4 5 0 A 4 0 0 D 5 0
O 4
B 6 4 0 0 5 C
Note that the sum of the residual capacities on both ends of an arc is equal to the original capacity of the arc. How to increase the flow in the network based on the values of residual capacities?
Augmenting paths
An augmenting path is a directed path from the source to the sink in the residual network such that every arc on this path has positive residual capacity. The minimum of these residual capacities is called the residual capacity of the augmenting path. This is the amount that can be feasibly added to the entire path. The flow in the network can be increased by finding an augmenting path and sending flow through it.
5 0
0 5 B 1 6 4 0 0 C 5
0
D 5 0 0 0 5
O 0 4
5 B 1 4 4 0 0 5 C 1
0
D 0 4 0
5 B 2 1 3 4 4 1 0 0 C 1