Sub topic 6
Cuts: Upper Bounds on Any Flow
This chapter assumes you know what a flow network is and can check a flow against the capacity and conservation constraints, as covered in earlier chapters. You should also be able to read a short proof that works by summing equations.
Ford-Fulkerson keeps raising the flow until no augmenting path is left. That raises a question: once it stops, how do we know the flow can't get any bigger? Cuts answer it. A cut gives a hard ceiling on the value of every possible flow.
What an s-t cut is
An s-t cut (S, T) splits the vertices into two groups, S and T, with the source s in S and the sink t in T. Each vertex belongs to exactly one of the two groups.
The capacity of the cut, c(S, T), is the sum of the capacities of edges that go from S to T. Edges that go from T back to S do not count toward the capacity.
We will use this network throughout. Node 0 is s and node 5 is t.
The edges from S to T are 1→3, 4→3 and 4→t, so c(S, T) = 12 + 7 + 4 = 23. The edge 3→2 runs from T to S, so it is left out.
Net flow across a cut equals the flow value
For any feasible flow f and any s-t cut (S, T), the net flow across the cut is the flow on edges from S to T minus the flow on edges from T to S. This net flow always equals |f|, the value of the flow.
The proof sums conservation over S. For every vertex in S other than s, flow out minus flow in is 0. For s, flow out minus flow in is |f|. Add these up over all of S. An edge with both ends inside S appears once as outgoing and once as incoming, so it cancels. Only the edges that cross the cut remain, and their total is the net flow.
The upper bound (weak duality)
Starting from the net flow:
- |f| = (flow on S→T edges) − (flow on T→S edges)
- The flow on each S→T edge is at most its capacity, and the flow on each T→S edge is at least 0.
- So |f| ≤ sum of capacities of S→T edges = c(S, T).
Every flow is at most the capacity of every cut. If you find a flow and a cut with the same value, the flow is maximum and the cut is minimum.
Comparing cuts
| Source side S | Edges from S to T | Capacity |
|---|---|---|
| {s} | s→1, s→2 | 29 |
| {s, 1, 2} | 1→3, 2→4 | 26 |
| {s, 1, 2, 3, 4} | 3→t, 4→t | 24 |
| {s, 1, 2, 4} | 1→3, 4→3, 4→t | 23 |
Since every flow is at most 23 here, a flow of value 23 would have to be optimal. The next chapter shows that the smallest cut capacity is always reachable.
def cut_capacity(capacity, S):
n = len(capacity)
return sum(capacity[u][v] for u in range(n) for v in range(n)
if u in S and v not in S)
capacity = [
[0, 16, 13, 0, 0, 0],
[0, 0, 0, 12, 0, 0],
[0, 4, 0, 0, 14, 0],
[0, 0, 9, 0, 0, 20],
[0, 0, 0, 7, 0, 4],
[0, 0, 0, 0, 0, 0],
]
print(cut_capacity(capacity, {0})) _capacity(capacity, {0, 1, 2, 4})) # 23Exercise
In the network above, what is the capacity of the cut with S = {s, 2, 4}? Which crossing edge is not counted?
Show answer
The edges from S to T are s→1 (4), 4→3 (7) and 4→t (4), so the capacity is 31. The edge 3→2 crosses from T to S, so it is not counted.
Exercise
A friend reports a flow of value 25 in this network. Without looking at the flow, explain why it must be wrong.
Show answer
The cut S = {s, 1, 2, 4} has capacity 23. Every feasible flow is at most the capacity of every cut, so no valid flow can have value 25.