Solution
ID: past-exam-of-the-computer-science-course-of-the-university-of-oxford/2015/advanced-data-structures-and-algorithms/2/b/solution
Past exam of the computer science course of the University of Oxford 2015 Advanced data structures and algorithms 2 b Solution by
Codex 0 2026-10-31
Write flow balance using the positive-inflow conventionRemove the lower bounds on network flow by writing , where only is nonzero. Then , and its required flow balance isIn the order , the lower-bound contribution is , soThe resulting flow network edge capacities areAdd a new source with an edge of flow network edge capacity , and a new sink with edges and of flow network edge capacities and . A feasible flow saturating these new edges is equivalent to a solution for : ordinary flow conservation in the enlarged flow network produces exactly the residual supplies and demands above. All source and sink edges must be saturated, requiring flow value .
Extended flow network after removing the lower bound; labels show final flow divided by flow network edge capacity
. The auxiliary edges are blue. The displayed flow saturates the auxiliary source and sink edges, certifying that all adjusted demands are met. The original edge regains its four-unit lower bound only after this auxiliary problem is solved. Details.Start the Edmonds–Karp algorithm at zero flow. Repeated breadth-first search in the residual network permits the following shortest augmenting paths; when paths tie, choose the one through first.
| Step | Augmenting path | Added flow | Total flow value |
|---|---|---|---|
The first augmenting path has three edges. Once is saturated, the next shortest possibilities have four edges, so steps and respect the breadth-first search rule. Each augmentation adds the usual backward edges to the residual network, though these particular augmentations need only forward edges. Now is saturated, so no further augmenting path exists. The cut of a flow network with source side has cut capacity , proving that the obtained flow is a maximum flow.
The original-edge values for are in the order . Restore the lower bound to obtainAll original capacity constraints hold, and meets its lower bound. The net inflows at are respectivelyThe original network therefore admits a feasible circulation with vertex demands.
New to topics? Read the docs here!
