min cut
min cut
flow network is a directed graph where each edge has a capacity, representing the maximum
A
amount of flow that can pass through1 it.
S
● ource Node (s):The starting point of the flow.
● Sink Node (t):The ending point of the flow.
● Flow:The amount of material that can be sent fromthe source to the sink through the
network.
● Cut:A partition of the vertices into two sets, Sand T, such that the source is in S and the sink
is in T.
● Capacity of a Cut:The sum of the capacities of theedges going from S to T.
ax Flow:The maximum flow in a network is the maximumamount of flow that can be sent
M
from the source to the sink without violating the capacity constraints of the edges.2
Min Cut:The minimum cut in a network is the cut withthe minimum capacity.
ax-Flow Min-Cut Theorem:The Max-Flow Min-Cut Theoremstates that the maximum flow in
M
a flow network is equal to the capacity of the minimum cut.3
Ford-Fulkerson Algorithm:
common algorithm to find the maximum flow is the Ford-Fulkerson algorithm. It works as
A
follows:
1. Initialize:
○ Set the flow on each edge to 0.
○ Create a residual graph, which initially copies the original graph.
2. Find an Augmenting Path:
○ Use a search algorithm (like BFS or DFS) to find a path from the source to the sink in the
residual graph. This path is called an augmenting path.
3. Augment the Flow:
○ Find the bottleneck capacity of the augmenting path, which is the minimum capacity of
any edge on the path.
○ Increase the flow on each edge of the augmenting path by the bottleneck capacity.
○ Update the residual graph by subtracting the bottleneck capacity from the forward edges
and adding it to the backward edges.4
4. Repeat:
○ Repeat steps 2 and 3 until no more augmenting paths can be found.
inding the Minimum Cut:Once the Ford-Fulkerson algorithmterminates, the minimum cut
F
can be found by examining the residual graph:
● etwork Flow Problems:Routing traffic, water flow,etc.
N
● Assignment Problems:Assigning tasks to workers, matchingstudents to colleges, etc.
● Image Segmentation:Dividing an image into meaningfulregions.
● Network Reliability:Analyzing network vulnerability.
y understanding the concepts of flow networks, maximum flow, minimum cut, and the
B
Ford-Fulkerson algorithm, you can effectively solve a variety of problems in computer science
and operations research.
ure! The Max-Flow Min-Cut Theorem is a fundamental concept in network flow theory. It states
S
that the maximum flow in a flow network from a source to a sink is equal to the total weight of
the edges in the smallest cut that separates the source and the sink. Let's break down the steps
to understand this concept in a simple and easy-to-learn manner:
flow network is a directed graph where each edge has a capacity, and each edge receives a
A
flow. The goal is to find the maximum flow from a source node (S) to a sink node (T).
he max-flow problem involves finding the maximum amount of flow that can be sent from the
T
source to the sink without violating the capacity constraints of the edges.
he min-cut problem involves finding the smallest set of edges that, if removed, would
T
disconnect the source from the sink. The total capacity of these edges is the minimum cut.
#### 4. **Ford-Fulkerson Algorithm**
he residual graph represents the remaining capacities of the edges after considering the
T
current flow. It includes reverse edges to account for possible flow reduction.
se a search algorithm (like BFS or DFS) to find paths from the source to the sink in the
U
residual graph where all edges have positive capacity.
Increase the flow along the augmenting path by the minimum capacity of the edges in the path.
Update the residual capacities accordingly.
#### 8. **Repeat**
epeat the process of finding augmenting paths and augmenting flow until no more augmenting
R
paths can be found.
#### 9. **Max-Flow**
he maximum flow is the total flow from the source to the sink after no more augmenting paths
T
can be found.
he min-cut can be found by identifying the edges that, if removed, would disconnect the source
T
from the sink. These edges are the ones that are fully utilized in the final residual graph.
### Example
̀``
S
/ \
10 5
/ \
A B
\ /
15 10
\ /
T
̀``
. **Residual Graph**: Initially, the residual graph is the same as the original graph since the
2
flow is 0.
. **Find Augmenting Path**: Use BFS to find a path from S to T. One possible path is S -> A ->
3
T.
. **Augment Flow**: The minimum capacity along the path S -> A -> T is 10. Increase the flow
4
along this path by 10 and update the residual capacities:
5. **Repeat**: Find another augmenting path. Another possible path is S -> B -> T.
- The minimum capacity along the path S -> B -> T is 5. Increase the flow along this path by 5
and update the residual capacities:
. **Max-Flow**: No more augmenting paths can be found. The maximum flow from S to T is the
6
sum of the flows along the paths found, which is 10 + 5 = 15.
. **Min-Cut**: The min-cut can be found by identifying the edges that are fully utilized in the
7
final residual graph. In this case, the edges S -> A and S -> B are fully utilized, forming the
min-cut with a total capacity of 10 + 5 = 15.
### Summary
he Max-Flow Min-Cut Theorem shows that the maximum flow in a network is equal to the
T
capacity of the smallest cut that separates the source from the sink. The Ford-Fulkerson
algorithm helps find this maximum flow by repeatedly finding augmenting paths and updating
the residual graph.