Sub topic 6
Cuts: Upper Bounds on Any Flow
The Ford-Fulkerson method from the previous chapter keeps pushing flow until no augmenting path is left. That raises a question: when it stops, how do you know the flow is the largest possible? To prove that, you need a number that no flow can exceed. An s-t cut gives you that number.
This chapter assumes you know the definitions from earlier chapters: a flow network with capacities c(u, v), a source s, a sink t, and a feasible flow f that obeys the capacity and conservation constraints. It also assumes you can follow a short proof that sums over vertices.
What an s-t Cut Is
An s-t cut (S, T) splits the vertex set V into two disjoint parts, with s in S and t in T. Every vertex goes into exactly one part. The cut does not have to be "connected" in any sense. Any split that puts the source on one side and the sink on the other is a valid cut.
With V vertices you have 2^(V-2) possible cuts, because each vertex other than s and t can go to either side.
An edge (u, v) relates to a cut in one of three ways:
| Edge type | Condition | Counts toward cut capacity? |
|---|---|---|
| Forward (crossing) | `u` in `S`, `v` in `T` | Yes |
| Backward (crossing) | `u` in `T`, `v` in `S` | No |
| Internal | both ends on the same side | No |
Cut capacity
The capacity of a cut is the sum of capacities of its forward edges:
c(S, T) = sum of c(u, v) over all edges with u in S and v in T
Only edges from S to T count. Edges that point back from T into S add nothing to the capacity, however large they are. This asymmetry causes most mistakes with cuts, and it is also why the bound in this chapter works.
A Running Example
We use the six-vertex network from the Edmonds-Karp code: node 0 is s, node 5 is t, and nodes 1 to 4 are intermediate.
For this cut, the forward edges are 1→3 (12), 4→3 (7) and 4→t (4), so c(S, T) = 23. The edge 3→2 has capacity 9 but points from T into S, so it is excluded.
Here are a few other cuts of the same network for comparison:
| S | Forward edges | Capacity |
|---|---|---|
| {s} | s→1, s→2 | 29 |
| {s, 1} | s→2, 1→3 | 25 |
| {s, 1, 2} | 1→3, 2→4 | 26 |
| {s, 1, 2, 4} | 1→3, 4→3, 4→t | 23 |
| {s, 2, 4} | s→1, 2→1, 4→3, 4→t | 31 |
Net Flow Across a Cut
Given a flow f, the net flow across a cut is the flow on forward edges minus the flow on backward edges:
f(S, T) = sum of f(u, v) for u in S, v in T − sum of f(v, u) for v in T, u in S
Flow subtracts in the backward direction, while capacity ignores backward edges completely. Keep the two definitions separate.
Lemma: every cut carries exactly the flow value
For any feasible flow f and any s-t cut (S, T), f(S, T) = |f|.
The proof sums the conservation equations. For each vertex u, define its excess as (flow out of u) minus (flow into u).
- For
u = s, the excess is|f|by definition of the flow value. - For every other
uinS, the excess is 0, becauseuis nott(sincetis inT) and conservation holds. - Adding the excesses over all
uinStherefore gives|f|. - In that sum, consider an edge with both ends in
S. Its flow appears once as outflow of one endpoint and once as inflow of the other, so it cancels. - Only crossing edges survive. Forward edges contribute
+f, backward edges contribute−f. The result is exactlyf(S, T).
So the flow value can be measured at any cut, not only at the source.
Weak Duality: Flow Never Exceeds Cut Capacity
Now combine the lemma with the capacity constraint:
|f| = f(S, T) = (forward flow) − (backward flow) ≤ (forward flow) ≤ (forward capacity) = c(S, T)
The first inequality holds because backward flow is never negative. The second holds because each forward edge carries at most its capacity.
This gives the main result of the chapter:
The inequality becomes an equality exactly when every forward edge is saturated (flow equals capacity) and every backward edge carries zero flow. Keep that condition in mind. The next chapter shows that Ford-Fulkerson always ends in that state for some cut.
Using the bound as a certificate
The bound gives you a way to check optimality. Suppose you have a flow of value 23 and a cut of capacity 23. No flow can beat 23 because of this cut, and your flow reaches 23, so it is maximum. You don't need to know which algorithm produced the flow. In the other direction, any cut capacity you compute is a valid upper bound, even if it is not the smallest one.
Checking It in Code
The script below uses a flow of value 12 that is deliberately not maximum and sends 5 units along the backward-crossing edge 3→2. It checks the lemma on every cut and finds the smallest cut capacity by brute force.
from itertools import combinations
# Nodes: 0 = s, 1..4 = intermediate, 5 = t
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],
]
# A feasible flow of value 12 (not maximum)
flow = [
[0, 12, 0, 0, 0, 0],
[0, 0, 0, 12, 0, 0],
[0, 0, 0, 0, 5, 0],
[0, 0, 5, 0, 0, 8],
[0, 0, 0, 1, 0, 4],
[0, 0, 0, 0, 0, 0],
]
def cut_capacity(capacity, S):
n = len(capacity)
return sum(capacity[u][v] for u in S for v in range(n) if v not in S)
def net_flow(flow, S):
n = len(flow)
forward = sum(flow[u][v] for u in S for v in range(n) if v not in S)
backward = sum(flow[v][u] for u in S for v in range(n) if v not in S)
return forward - backward
n = len(capacity)
s, t = 0, n - 1
flow_value = sum(flow[s][v] for v in range(n)) - sum(flow[v][s] for v in range(n))
middle = [v for v in range(n) if v not in (s, t)]
best_cap, best_S, count = float('inf'), None, 0
for k in range(len(middle) + 1):
for extra in combinations(middle, k):
S = {s, *extra}
count += 1
assert net_flow(flow, S) == flow_value # theap = cut_capacity(capacity, S)
assert flow_value <= cap # weak duality
if cap < best_cap:
best_cap, best_S =)
print("flow value:", flow_value) # 12
print("cuts checked:", count) # 16
print("min ccap) # 23
print("min cut S:", best_S) # [0, 1, 2, 4]
print("net flow across itow, set(best_S))) # 12On the cut S = {0, 1, 2, 4}, the forward flow is 4 = 17 and the backward flow on 3→2 is 5, so the net flow is 12. The gap between 12 and 23 shows there is room to improve this flow. Edmonds-Karp on the same network reaches 23, which matches the minimum cut.
Edge Cases and Common Errors
| Mistake or edge case | What actually happens | Column | Column |
|---|---|---|---|
| Adding capacities of backward edges to `c(S, T)` | Gives an overestimate that is still an upper bound but no longer the cut's capacity, and the min-cut equality fails. | ||
| Ignoring backward flow when computing `f(S, T)` | The net flow no longer equals ` | f | `, as the 17 vs 12 example shows. |
| Putting `t` in `S` or `s` in `T` | That split is not an s-t cut, and the bound does not apply. | ||
| Antiparallel edges `u→v` and `v→u` | Only the one pointing from `S` to `T` counts toward capacity. | ||
| An edge with infinite capacity crosses forward | That cut has infinite capacity and can never be the minimum, which modeling tricks use to forbid certain cuts. | ||
| `t` unreachable from `s` | The cut `S` = vertices reachable from `s` has capacity 0, so the max flow is 0. | ||
| Disconnected `S` | Still a valid cut. Nothing requires either side to be connected. |
Exercises
Exercise
In the running example, compute the capacity of the cut S = {s, 1, 3}, T = {2, 4, t}. Which crossing edges are excluded and why?
Show answer
Forward edges are s→2 (13), 3→2 (9), and 3→t (20), giving capacity 42. The edges 2→1 (4) and 4→3 (7) cross from T into S, so they are excluded from the capacity.
Exercise
For the value-12 flow in the code, compute the net flow across S = {s, 1, 3} by hand and confirm it equals 12.
Show answer
Forward flows: s→2 = 0, 3→2 = 5, 3→t = 8, total 13. Backward flows: 2→1 = 0, 4→3 = 1, total 1. Net flow = 13 − 1 = 12, which equals |f|.
Exercise
Someone hands you a flow of value 20 and a cut of capacity 20 in the same network. Without running any algorithm, what can you conclude? What must be true of the edges crossing that cut?
Show answer
The flow is maximum and the cut is minimum, because |f| ≤ c(S, T) for every flow and cut, and here the two values are equal. Equality requires every S→T edge to be saturated and every T→S edge to carry zero flow.
Exercise
Why can't we define cut capacity as forward capacity minus backward capacity, to mirror the net-flow formula?
Show answer
The bound relies on backward flow being at least 0, not at most its capacity. Subtracting backward capacity could make the "capacity" smaller than the actual flow. For example, a backward edge that carries no flow would still lower the number. The result would not be an upper bound.