Capacitated flow optimality conditions Created 2026-10-07 Updated 2026-10-14
For positive capacities and a feasible flow, optimality is equivalent to network dual potentials for which the network reduced cost is nonnegative at a lower bound, zero in the interior, and nonpositive at an upper bound. These signs make every feasible displacement nonnegative in total cost. They are also equivalent to absence of negative-cost cycles in the residual network. A zero-capacity edge is fixed and imposes no reduced-cost sign condition.
Past exam of the mathematics course of the University of Cambridge 2002 iii Paper 34 3 Solution Created 2026-10-03 Updated 2026-10-14
For a directed graph, the uncapacitated minimum-cost flow problem isPositive is external supply and negative is demand; summing the flow balances requires . There are no finite upper arc capacities. Let be the oriented incidence matrix with tail and head . For free dual potentials , the Lagrangian isIts infimum over nonnegative flows is exactly when every network reduced cost is nonnegative; otherwise the infimum is minus infinity. Thus the dual maximizes subject to these inequalities. For a primal feasible flow and dual feasible potentials,This derives weak duality and the complementary slackness condition . A feasible pair satisfying it has equal objectives and certifies optimality.
A spanning tree gives candidate network dual potentials by making all its arcs tight: choose one root potential and propagate along each tree arc, reversing this equation when traversing against the arc. An arbitrary tree does not automatically make the non-tree reduced costs nonnegative; those inequalities must be checked. If a guaranteed feasible construction is needed and there is no negative directed cycle, use dual network potentials from shortest-path distances: add an auxiliary source reaching every vertex, calculate distances , and take . The shortest-path inequality proves dual feasibility, with tightness on the shortest-path tree.
For the printed dashed tree, set all non-tree flows to zero and solve the balances from the leaves. This givesThe remaining arcs have zero flow. The total initial cost is . This is a basic feasible solution, though degenerate because the tree flow on is zero.
Normalize . Tree tightness givesThe non-tree reduced costs areThe negative reduced cost on identifies an improving entering arc for the network simplex algorithm. Adding it to the tree creates a unique undirected cycle. Sending along increases the flows on by and decreases those on by ; all other flows are unchanged. This balanced displacement preserves every node equation. Nonnegativity limits to the minimum of the four decreasing flows, namely . Choose arc to leave among the tied limiting arcs.
After this one pivot the nonzero flows areand every other arc flow is zero. The objective decreases by , giving cost .
For the new tree, tight potentials normalized at vertex 1 areAll tree reduced costs are zero. For the non-tree arcs they are , respectively, so the potentials are dual feasible. Their dual objective ismatching the primal cost. Complementary slackness therefore provesThis is the stopping test of the network simplex method: maintain a feasible tree flow, compute tight potentials, enter a negative-reduced-cost non-tree arc, make a maximal feasible cycle adjustment and exchange a limiting tree arc, until all reduced costs are nonnegative. Here exactly one improving step suffices.
Past exam of the mathematics course of the University of Cambridge 2006 iii Paper 38 2 Solution Created 2026-10-03 Updated 2026-10-14
In a minimum-cost flow problem, every directed arc has a per-unit cost and lower and upper capacities . Each vertex has a prescribed net supply , with . We seek flows minimizing subject to the flow conservation equationsThe uncapacitated minimum-cost flow case has and, here, .
For project scheduling, augment the precedence graph with a source , of duration , and a sink . Join to every task with no predecessor, and every task with no successor to . Extend the precedence matrix to these dummy arcs. This augmentation is needed because the printed matrix by itself contains no start or finish vertex. Assuming the precedence graph is a Directed acyclic graph, every task lies on a source-to-sink path. Unlimited parallel work then gives the linear programming formulationThe time variables are unrestricted; a common translation changes nothing, so we may fix . These inequalities say that each successor starts after its predecessor finishes. In a topological order, their coordinatewise earliest solution is , the recursion of the critical path method.
To derive project scheduling duality, associate a nonnegative multiplier with . The Lagrangian isIts infimum over the free time variables is finite precisely when the coefficients of all vanish. This gives one unit of net outflow at , one unit of net inflow at , and zero net flow at other vertices. Hence the dual isEquivalently, minimize with . The project duration is the negative of the optimal minimum-cost flow value. The sign is essential: the dual of the minimization problem maximizes total duration, selecting a longest precedence path.
The network simplex algorithm is a general method for minimum-cost flow. After shifting lower bounds to zero, first find a feasible flow, using artificial arcs and a phase-one objective if needed. A network simplex tree basis fixes each non-tree arc at a bound and determines the tree flows by flow conservation. Choose network dual potentials making the network reduced costzero on the tree. An arc at its lower bound is improving if ; an arc at its upper bound is improving in reverse if . Adding that residual arc creates one fundamental cycle. Increase flow around this cycle until an arc reaches a bound, then exchange the entering and leaving tree arcs, or flip the entering arc to its other bound. The flow conservation equations remain satisfied. Use an anti-cycling rule for degenerate pivots. If a negative-cost residual cycle has no finite limiting capacity, the objective is unbounded below; if phase one cannot remove artificial flow, the problem is infeasible. Otherwise, termination with no negative residual network reduced costs certifies optimality, since potentials cancel around cycles and every residual network circulation has nonnegative cost.
For this project the augmented arcs areIn the specified initial spanning tree, the unique unit-flow path is . The flow on its arcs is one and that on all other tree arcs is zero. Its total cost is , so this is a degenerate but feasible network simplex tree basis. Normalizing , the tree equations giveThere are two nonbasic arcs. Their network reduced costs areBring into the tree. The resulting cycle increases the flows on and decreases those on . The three decreasing arcs initially carry one unit, so the maximal step is one. Resolve the leaving-arc tie by removing . The resulting unit flow follows and has cost .
For the new tree, normalized potentials areThe only nonbasic arcs now have and , both nonnegative. All tree network reduced costs vanish, proving optimality after this single pivot. The earliest feasible schedule, obtained by the critical path method, isThe path has duration , so it and the timetable furnish a unit-flow certificate for project duration.
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 38 3 Solution Created 2026-10-03 Updated 2026-10-14
In a minimum-cost flow problem, a directed graph has arc flows , unit costs , lower and upper capacities , and net supplies summing to zero. The linear program minimizes subject to the flow balances and .
Give each graph vertex a network dual potential . With the outgoing-minus-incoming oriented incidence matrix , the optimization Lagrangian isMinimizing over the capacity intervals is separable. A candidate feasible flow minimizes this optimization Lagrangian if it takes its lower bound whenever the network reduced cost is positive, its upper bound whenever that network reduced cost is negative, and any allowed value when that network reduced cost is zero. Equivalently, for arcs with distinct lower and upper bounds,For every other feasible flow , these conditions give . This proves the Lagrangian sufficiency theorem certificate, rather than merely stating the capacitated flow optimality conditions.
Put . The four flow balances determineIntersecting the four capacity intervals gives . In particular,is a feasible flow. Write . Its cost along the feasible interval isHence is optimal precisely when . A network dual potential certificate isThe three interior arcs have zero network reduced costs and , which has the required nonnegative sign at its lower capacity.
For the network simplex algorithm, start with the network simplex tree basis consisting of arcs , and fix nonbasic arc at its lower bound 2. These are exactly the potentials just found. If , no improving pivot is needed. If , arc enters and its fundamental graph cycle increases all four flows by the same amount. At the remaining upper capacities are , so the simplex ratio test allows an increase of 2. Arc reaches its upper bound and leaves the tree. The new network simplex tree basis has arcs , with potentialsNow only the nonbasic arc has a possibly nonzero network reduced cost, namely . It is at its upper bound, so the sign is optimal. Thus for all real costs the complete answer isWhen , both endpoint basic feasible solutions and every intermediate feasible flow have the same cost.
To count basic solutions, a network simplex tree basis omits one arc of the four-cycle and fixes that arc at either bound. The possibilities areThere are eight tree/bound basic representations, seven distinct basic flow vectors, and two basic feasible solutions. The distinction in the first count matters: the upper bounds on and both give the identical flow at . Thus if “basic solutions” counts vectors rather than basis representations, the answer to (i) is seven; the frequently used count of basis/bound choices is eight. The answer to (ii) is unambiguously two, since only satisfy all capacities.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 38 3 a Solution Created 2026-10-03 Updated 2026-10-14
Label the vertices (left), (upper middle), (lower middle), (upper right), (lower right). Use the flow balance convention outgoing minus incoming equals supply. The printed initial flows, in the order , areThey obey all capacity constraints and the flow balances . The four strictly interior edges form a spanning tree. The remaining edges are at a bound: at zero, and at their upper bounds. Thus this is already a feasible network simplex tree basis; no artificial feasibility phase is needed. Its total cost is .
For a tree, choose network dual potentials with and zero network reduced cost on each tree edge. InitiallyThe nonbasic lower-bound edge has network reduced cost . Increase its flow and adjust around the graph cycle , reversing and . The available step is , so leaves at zero. This givesThe tree is now , and the potentials are .
Now is at its upper bound but has network reduced cost , so decreasing it improves cost. Its reverse residual network edge enters along the cycle . The forward edges increase; decrease. The step isThus leaves at its upper bound, andThe new tree has potentials .
The upper-bound edge now has network reduced cost . Enter its reverse direction along , decreasing and and increasing . The step is , so leaves at zero. The resulting flow isThe tree is , with potentials . The nonbasic edges have network reduced costs at its upper bound, at its lower bound, and at its lower bound. All have the correct signs, so there is no improving network simplex pivot. The next part proves these signs certify optimality.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 38 3 b Solution Created 2026-10-03 Updated 2026-10-07
For a minimum-cost flow with bounds , the capacitated flow optimality conditions consist of primal feasibility and network dual potentials whose network reduced costs obeyFor a zero-capacity edge both bounds coincide and no sign restriction is needed; all capacities here are positive. These are the bound form of complementary slackness. To derive necessity directly, construct the residual network: a possible increase has original cost and a possible decrease has reverse cost . An optimal flow cannot admit a negative-cost directed cycle, since a positive step around it preserves flow balance and lowers cost. If there is no such cycle, connect a new source by zero-cost edges to every vertex and let be shortest-path distances. They exist because no negative cycle is reachable. For every residual edge , . Taking makes every residual network reduced cost nonnegative, exactly the displayed sign conditions: both directions exist for an interior edge.
Conversely, for any other feasible flow , equal flow balances giveEach summand is nonnegative at a lower or upper bound, and zero at an interior edge. Hence the sign conditions suffice for optimality as well.
For the final flow, use in the order . All four tree edges have zero network reduced cost, while have costs . More explicitly, every feasible flow satisfiesOur flow attains equality. This gives a direct cost certificate of 220. The strict signs also force , at any optimum; flow balance then fixes all remaining edges, so this flow is unique.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 38 3 a Solution Created 2026-10-03 Updated 2026-10-06
Choose the oriented incidence matrix convention with at an edge's tail and at its head. Let be net supply, so . The uncapacitated minimum-cost flow problem on a finite directed graph isor . Negative denotes net demand. Costs may have either sign; the problem can be infeasible or unbounded.
For vertex network dual potentials , the optimization Lagrangian isThe infimum over is finite exactly when every network reduced cost is nonnegative. Thus the Lagrangian dual problem and complementary slackness areA feasible flow and feasible network dual potentials satisfying these equalities have equal costs and are optimal by weak duality.
If the underlying undirected graph is connected, deleting one redundant balance row makes the oriented incidence matrix have rank . A set of independent edge columns is exactly a spanning tree. Set all non-tree flows to zero, solve the tree balances, and check nonnegativity to obtain a basic feasible solution. Basic tree edges may have zero flow, which is degeneracy in linear programming. Requiring on tree edges determines network dual potentials up to a common additive constant. If every non-tree network reduced cost is nonnegative, the tree flow is optimal. This is the basis of the network simplex algorithm. If the graph is disconnected, solve the balances separately in each component; each component must have total net supply zero and uses its own spanning tree.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 38 3 b Solution Created 2026-10-03 Updated 2026-10-14
On the dashed spanning tree, the nonzero flows arewith and all non-tree flows zero. The tree balances give supply four at vertex , demands one at and , and demand two at . Its cost is .
Choose and make the tree network reduced costs zero. The resulting network dual potentials areFor the non-tree edges, in the order , the network reduced costs areOnly has negative network reduced cost, so it enters the basis.
Adding this edge to the tree creates the graph cycle . Increasing its flow by adds on and subtracts on . These signed changes preserve every flow balance. The simplex ratio test allows , and the objective decreases by because the cycle's signed cost is .
Take and remove from the basis. The other tied edge remains a zero-flow basic edge; this is a legitimate degenerate tree basis and requires no extra pivot. The new flow isIts cost is . For the new tree, chooseEvery network reduced cost is nonnegative: the new non-tree costs for are . All positive-flow edges have zero network reduced cost, and the dual objective is . Thus complementary slackness gives
Uncapacitated minimum-cost flow Created 2026-10-06 Updated 2026-10-14
An uncapacitated minimum-cost flow has nonnegative edge flows without finite upper capacities. The flow balances prescribe net supply at each vertex. For the oriented incidence matrix convention with tail and head , vertex network dual potentials have network reduced costs . Nonnegative network reduced costs and complementary slackness certify a feasible optimum. A feasible negative-cost directed cycle makes the problem unbounded below.

