More Common Definitions
The Residual Capacity is more commonly defined as:
- or
Also here we require that the flow network is bidirectional, which is not a common requirement.
Flow Network
- A network is a directed graph with a non-negative capacity function
- A flow network is a network with a source vertex and a sink vertex , and it is denoted by .
- A flow in a flow network is a function that satisfies the following properties:
- Capacity constraint: .
- Bidirectional Network: .
- (If , but , then we add the edge with capacity )
- Flow conservation: , where:
- .
- Opposite Flow Offset: For each edge , At most one of and is positive.
- (If , then we adjust a new flow as follows: , )
- The value of a flow is (Usually, )
Residual Network
-
The residual network (of a flow network with a flow ) is defined as , where, is the residual capacity function defined as .
-
An augmenting path is a path in such that . - The bottleneck of an augmenting path is the minimum residual capacity of the edges in the path: .
Cut
- A cut in a flow network is a set such that and .
- The set is the set of edges from to .
- The set is the set of edges from to .
- A minimum cut is a cut such that is minimized.
- , for any cut and flow .
- , for any cut and flow .
- If , then is a maximum flow and is a minimum cut.
- (Max-Flow Min-Cut Theorem) For any flow , the following are equivalent:
- is a maximum flow
- There is no augmenting path in the residual network of
- There is a cut such that
- When the Ford-Fulkerson algorithm terminates, the current flow is the maximum flow.
- If and are minimum cuts, then both and are minimum cuts.
Maximal Flow Problem
- Input: A flow network .
- Output: A flow of maximum value.
Ford-Fulkerson Algorithm
Augmenting Paths
Naive Implementation
- (Theorem) At every intermediate stage of the Ford-Fulkerson algorithm, the flow values are integers.
- (Theorem) The Ford-Fulkerson algorithm terminates in at most iterations, where .
Scaling Ford-Fulkerson Algorithm
Edmonds-Karp Algorithm
- stronger polynomial time complexity
- Uses BFS to find the shortest augmenting path