| Status | Source | Problem Name | Difficulty | Tags | ||
|---|---|---|---|---|---|---|
| Wesley's Anger Contest | Normal | |||||
Tutorial
| Resources | |||||
|---|---|---|---|---|---|
| CMU | |||||
| cp-algorithms | |||||
So far, every edge in our flow network has had a capacity that serves as an upper bound on the flow through it: . We now consider networks where each edge additionally has a lower bound , so that any valid flow must satisfy
In other words, we're now required to push at least units of flow along . This single extension is surprisingly powerful: many problems that look nothing like flow ("each task must be performed at least times", "each person sings between and songs") reduce to it.
Feasible Circulation
Let's start with the simplest version, where there is no source or sink. A circulation is an assignment of flow to every edge such that
- every edge respects its bounds: , and
- conservation holds at every vertex: the flow in equals the flow out.
The question is whether a valid circulation exists at all.
I will first illustrate the flow graph we can set up to solve this problem, then explain why it works. First, we create two new nodes and and connect with capacity . Then, we apply the following transformation to every edge :
- Connect and with capacity .
- Reduce the capacity of to .
![]()
The idea is that in this transformed network, flow through will first be routed through the blue cycle () until all units are saturated, and only the excess will pass through itself. This then means that all lower bounds will be satisfied iff all blue edges are saturated. To determine whether this is possible, we just need to run a maximum flow from to and check whether the resultant flow is exactly .
To recover the actual circulation, just take the flow found in the auxiliary network and add back the lower bound: .
Feasible Flow With a Source and Sink
Now suppose we do have a source and sink , and we want any flow from to respecting the lower bounds. The conservation constraint should hold everywhere except and .
We reduce this to the circulation case with one extra edge: add an edge from back to with lower bound and capacity . This "return edge" carries the net flow value back from the sink to the source, so conservation now holds at and as well, and the whole network becomes a circulation problem. Apply the construction above, and the flow value of the original network is exactly the flow sent along the edge.
Maximum / Minimum Flow With Lower Bounds
Often we don't just want a feasible flow — we want the maximum (or minimum) flow from to subject to the lower bounds. Do it in two phases:
Find a feasible flow using the construction above. If the blue edges can't be saturated, no valid flow exists and we stop.
Augment in the residual network. Remove the auxiliary , , and the edge, then run an ordinary max flow from to on the leftover residual graph. Adding these augmenting paths to the feasible flow keeps it feasible (we only ever increase flow on edges that have spare capacity) while pushing the value as high as possible.
For minimum flow, instead run a max flow from to in the residual graph and subtract it: we cancel as much circulating flow as possible while keeping every edge above its lower bound.
Problems
| Status | Source | Problem Name | Difficulty | Tags | ||
|---|---|---|---|---|---|---|
| CF | Normal | |||||
| CF | Normal | |||||
| CF | Normal | |||||
| AC | Normal | |||||
| CF | Very Hard | |||||
Module Progress:
Join the USACO Forum!
Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!