Let . By strong duality, an optimal dual vector exists. Complementary slackness at makes the dual constraints equalities at indices , where . The vector has exactly that same support. It is nonnegative and satisfies , while remains dual feasible because dual feasibility depends on , not on the right-hand side. HenceThe objective gap is zero, so is optimal for the modified programme. This is support-preserving right-hand-side changes in linear programming.
For every perfect matching , each vertex occurs exactly once, so the feasibility inequalities giveIf a perfect matching uses only tight edges, equality holds. It therefore attains a lower bound valid for every perfect matching, proving minimum cost. In a bipartite graph this is the weak duality and complementary slackness certificate for the assignment problem. The Hungarian algorithm maintains feasible row and column potentials and seeks a perfect matching among tight edges.
The last objective row is . Every feasible solution has nonnegative , so . The displayed basic feasible solution has all three zero and attains 51, proving optimality. Equivalently, the resource dual prices give the same upper bound and satisfy complementary slackness.
Feasibility makes both sums and nonnegative. Their sum is the gap . At optimal points the assumed equal optimal values make that gap zero, forcing each nonnegative sum to vanish. HenceIn fact every individual nonnegative product in the two sums vanishes, giving the componentwise complementary slackness conditions too.
For feasible points the duality gap decomposes asEach term in both sums is nonnegative. Therefore the gap is zero exactly when every product vanishes, namely the two sets of complementary slackness equations in the question (with or its negative making no difference to a zero product). If the equations hold, equality and weak duality prove optimality of both points. Conversely, if both are optimal and the optimal values are equal as assumed, the gap is zero, forcing each product to vanish. This proves both directions.
Consider the minimization problemThe objective function is a strictly convex function with its unconstrained optimization minimum at . If , it decreases throughout the feasible set until the bound is reached. If , the feasible set already contains . HenceWith , the optimization Lagrangian and KKT conditions areSubstituting gives the unique inequality Lagrange multiplierFor , the active constraint has . For , there is strict slack and . At , the active constraint has zero Lagrange multiplier: the boundary happens to pass through the unconstrained optimum. Feasibility and complementary slackness must both be checked; solving only would allow infeasible candidates.
The same quadratic objective with active, just-touching and inactive upper bounds
. Details. An independent certificate follows by completing the square:The Lagrange dual function is a concave function of . Its maximum over occurs at and equals . Thus every case has an explicit lower bound attained by a feasible point; the KKT conditions provide a certificate that can be checked without searching all real numbers.
Resource congestion price Created 2026-10-06 Updated 2026-10-14
A resource congestion price signals scarcity at a capacity-constrained link. Under multiplicative resource-price dynamics, its increase indicates excess demand and its decrease indicates spare capacity. A route pays the sum of these prices, its route congestion price. A zero resource congestion price at an optimum satisfies complementary slackness with possible spare capacity.
Second-order-cone optimality certificate 2026-10-14
A curved feasible set can have the same certificate structure. ConsiderWrite and use the second-order cone . In this coordinate ordering,Self-duality of a second-order cone makes . The equality forces and , leaving . Its dual objective function is , maximized at . Thus every feasible point satisfies , and attains that bound: .
A curved primal constraint and an interval of dual certificates
. The left panel is the slice of the second-order cone, so its boundary is . The right panel is the dual slice , : admissible form , and reaches at . The optimal slack variable and dual variable lie on different cone boundary rays with zero dot product. Details.The zero dot product is . Individual coordinate products need not be nonnegative here: the cancellation occurs across coordinates. The valid complementary slackness condition is cone-level orthogonality, rather than the coordinatewise interpretation of the nonnegative orthant.
For a square invertible constraint matrix in , suppose and . This fixed dual vector stays optimal under a changed right-hand side exactly when . Sufficiency follows from primal feasibility and equal primal/dual objectives. Necessity follows from complementary slackness: since every is positive, every optimal primal constraint must bind, forcing . The inequalities define the whole validity cone, including degenerate boundary optima.
Strictly slack dual constraints force zero primal variables Created 2026-10-25 Updated 2026-10-31
For the primal linear program maximising with , , and its dual linear program minimising with , , let be optimal. The complementary slackness identity gives . Thus a strict inequality in the th dual constraint forces . One optimal dual feasible solution can therefore force zero components in every primal optimum. The same argument with roles reversed says that forces the th primal constraint to be an equality.
For the linear program maximizing subject to , , let be optimal and let be an optimal dual linear program solution. Complementary slackness makes on every positive coordinate of . Any nonnegative supported on those coordinates therefore hasThe same is dual feasible when the right-hand side is changed to . Equality of feasible objectives and weak duality prove optimality of for that modified problem.
There is also a direct primal proof. If had and , then would remain feasible and nonnegative for sufficiently small . On zero coordinates of , support inclusion makes its perturbation nonnegative; on positive coordinates, smallness preserves positivity. Its objective would improve, contradicting optimality of .
For shipments with factory row sums at most capacities and shop column sums exactly demands , the displayed dual potentials give . The sign ensures . Equality proves optimality. It occurs when every used cell is tight and every row with spare capacity has , the relevant complementary slackness conditions. A dummy demand column with zero costs converts unused capacity into a balanced transportation problem.
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.

