Flows and Cuts (TODO)
- Flows and Cuts (TODO)
- Flows
- Cuts
- Augmenting paths
- Residual Network
- Algorithms
- Bipartite Matching as a Flow Problem
- Edge- and Node-Disjoint Paths
- Image Segmentation as a Cut-Problem
- Flows and Convex Sets
- Minimum Cuts in Graphs
Flows and Cuts (TODO)
Flows
π‘ A network is a tuple , where the following hold:
- is a directed graph,
- is the source,
- is the target and,
- is the capacity function.
π‘ Let be a network. A flow in is a function with the conditions
- for all , the admissibility, and
-
for all it holds that
which is called the flow conservation.
The value of a flow is defined by
π The net inflow of the target equals the value of the flow, i.e.,
Cuts
π‘ An --cut for a network is a partition of (i.e., and ) with and . The capacity of an --cut is defined by
π Let be a flow and be an --cut in a network . It then holds that
π (Max-Flow-Min-Cut Theorem).
Every network fulfills
Augmenting paths
The fundamental concept behind many max-flow algorithms is to start with an arbitrary flow (e.g., constant is good for basically all cases) and improving it successively. A first approach to this could look as follows. Assume we find a directed path from source to target, where the flow has not used the full capacity of all the edge, i.e., for all in . Now let . If we now increase the value of the flow by in all edges of , we do not break flow conservation and the value of the flow has increased by . Sadly, there do exist flows that can not be improved with this scheme even though they are not optimal. One can not only increase flow in an outgoing edge, but also decrease flow in another incoming edge to increase the resulting flow. In this sense we can entertain paths from source to target in which edges can be directed both forwards and backwards. Let us assume, that we can increase flow in every edge that is directed in forwards direction by without breaking admissibility, and that we can decrease the flow in every edge that is directed in backwards direction by without having negative flow. Then we can modify flow along such a path without breaking flow conservation. If we successively optimize flow with these so-called augmenting paths one can only get stuck in maximal flows. Interestingly, this βalgorithmβ only has finitely many steps when the capacities of a flow are rational.
Residual Network
π‘ Let be a network without opposing edges and let be a flow in . The residual network is defined as follows:
- If with , then is also an edge in with .
- If with , then is in with
- Only edges ad defined in points 1 and 2 are in .
, , is called the residual capacity of edge .
π A flow in a network is a maximal flow if and only if there does not exist a directed path from the source to the target in the residual network . For every such maximum flow there does exist an --cut with .
Algorithms
Ford-Fulkerson
By searching for augmenting paths in the residual network we can find a max-flow in .
π If all capacities are integer values and at max as large as some and there are no opposing edges in a network then there exists an integer maximum flow that can be found in , where is the number of nodes and is the number of edges of the network.
Pseudocode
Other Algorithms
π‘ (Capacity-Scaling, Dinitz-Gabow, 1973).
If in a network all capacities are integers and at max as large as some , then there exists an integer maximum flow, that can be found in , where is the number of nodes and is the number of edges of the network.
π‘ (Dynamic Trees, Sleator-Tarjan, 1983).
A maximal flow of a network can be found in , where is the number of nodes and is the number of edges of the network.
Bipartite Matching as a Flow Problem
π The maximum size of a matching in a bipartite graph equals the value of a maximum flow in network .
Edge- and Node-Disjoint Paths
π‘ Recall Mengerβs Theorems:
π Mengerβs Theorem (Vertices):
Let be a graph. Then it holds that is -connected if and only if there exist disjoint --paths.
π Mengerβs Theorem (Edges):
Let be a graph. Then it holds that is -edge-connected if and only if there exist edge-disjoint --paths.
By cleverly converting a graph to a network we can turn the connectivity problem into a max-flow problem:
-
Edges:
We split the undirected edges of the original graph into two opposing edges, both with capacity 1. If we now add new vertices and to some vertices of the original graph via one outgoing (in the case of ) and one incoming edge (in the case of , as shown in the picture. The value of a max-flow directly corresponds to the number of edge-disjoint --paths.
-
Nodes:
We transform the graph to a network exactly the same way as before, only this time we also split any node of the original graph that is not or into and and add an extra edge from to with capacity , as shown in the picture. The value of a max-flow equals the number of disjoint --paths.