Network flow models
Networks use nodes for locations and arcs for permitted connections. Capacity limits how much may pass; arc cost prices each unit. Project networks from Chapter 1 use a different interpretation: their arc weights are durations and their controlling path is longest.
8.1 Conservation and minimum-cost flow
On directed arc , let be flow, capacity and unit cost. Let be external supply at node , positive for a source, negative for a demand and zero for transshipment.
For a lower bound , substitute , use capacity , and change node supply to . Include the constant cost of the lower-bound flow. Transportation and assignment are special cases of node balance.
In a residual network, unused forward capacity carries the original cost; cancellation of existing flow is a backward arc with the negative original cost. A feasible flow is minimum-cost exactly when its residual network contains no negative-cost directed cycle. If a negative cycle exists, send its minimum residual capacity around the cycle; node balances are preserved and cost decreases. Recheck until no such cycle remains.
8.2 Shortest paths
Let be the length, time or cost of traversing arc once. A shortest path minimises the sum of these weights from source to a destination.
With negative weights in a general directed graph, Bellman–Ford performs up to full passes over the arcs, where is the node count. A further reachable improvement indicates a reachable negative cycle; a destination has no finite shortest-walk value if such a cycle can also reach that destination. Unreachable nodes retain infinite distance.
8.3 Maximum flow, residual capacity and cuts
A maximum-flow model has source , sink , nonnegative capacities and zero net supply at intermediate nodes. Flow value is net outflow from , equal to net inflow to .
Keep residual arcs associated with their original arcs when both directions exist. Repeat augmentation until no residual source-to-sink path remains. Nodes reachable from in that final residual network define a minimum cut and certify optimality. With integral capacities, integral augmentations produce an integral maximum flow.
A feasible flow of 9 units/hour meets a cut of the same capacity. Arc labels show flow/capacity.
8.4 Minimum spanning connections
A minimum spanning tree (MST) connects all nodes of a connected undirected weighted graph with minimum total edge cost. It is a connection-design model, not a route or a shipment allocation. A tree on nodes has edges and no cycle.
Kruskal's method scans edges in increasing weight and accepts an edge only if it joins two separate components. Prim's method grows a tree by repeatedly adding the cheapest edge between the current tree and an outside node. Either method yields an MST. Ties can produce several MSTs with the same total cost; disconnected input gives a minimum spanning forest, not one spanning tree.
Last-minute recall
- State whether an arc label is cost, length, duration or capacity.
- Use outflow minus inflow equals positive supply consistently.
- Residual backward arcs permit cancelling previous decisions.
- Dijkstra requires nonnegative weights.
- A feasible flow matching a cut capacity is maximum.
- Cut capacity counts outward arcs only.
- An MST has edges and no cycle.