Karush-Kuhn-Tucker conditions Created 2026-09-24 Updated 2026-10-14
The Karush-Kuhn-Tucker conditions combine membership of the feasible set with a balance of gradients and complementary slackness. For a minimization problem with differentiable functions on an open subset of , writeand use the optimization LagrangianA candidate satisfies the KKT conditions exactly when all four requirements hold:
- Primal feasibility: and , so is a feasible point.
- Dual sign feasibility: . The equality Lagrange multipliers are unrestricted real numbers.
- Stationarity: the gradient of the optimization Lagrangian in the decision variables vanishes,
- Complementary slackness: for every inequality optimization constraint.[ref]Lecture 7: Lagrange Multipliers and KKT Conditions. Lecture 7, §L7.1.1, Definition L7.1, printed p. 3: the four KKT requirements
The sign of each inequality Lagrange multiplier follows the chosen convention : on the feasible set, makes the optimization Lagrangian a lower bound on the objective function. An equality contributes zero on the feasible set for either sign of its Lagrange multiplier. Complementary slackness says an inequality with must have , while implies an active constraint. An active constraint can still have zero Lagrange multiplier; the quadratic minimization with a moving upper bound below gives an explicit example.
The name records William Karush's 1939 master's thesis and the 1951 work of Harold W. Kuhn and Albert W. Tucker.[ref]
Convex Optimization by Stephen Boyd and Lieven Vandenberghe. Chapter 5 bibliography, printed p. 272, and bibliography entries KT51 and Kuh76
Mathematical optimization Created 2026-09-24 Updated 2026-10-13
Mathematical optimization turns a preference into a precise question: among the allowed decisions, which gives the best outcome? A model separates the objective function, which measures quality, from the optimization constraints, which determine the feasible set. This language unifies finding a cheap plan for a transportation problem, efficient scheduling, or an accurate model in linear regression. The separation is useful because changing a preference and changing what is possible are different modeling decisions. See Boyd and Vandenberghe, introductory optimization models.
For an objective function , a maximization problem asks for a feasible point satisfying for every ; a minimization problem reverses the inequality. This is a global extremum. A local maximum or local minimum compares only nearby feasible points, so finding one does not settle the global question.
Consider allocating ten units between two complementary inputs:The budget constraint forces a tradeoff: an extra unit of costs a unit of . The best allocation is , with objective function value . Without the budget constraint, gives : there is no global maximum. Constrained optimization can therefore have a finite answer even when the corresponding problem with fewer optimization constraints does not. Its beauty is that geometry, calculus, and an arithmetic-geometric mean inequality can certify the same answer.
Nonnegative-orthant optimality certificate 2026-10-14
Consider the original linear programOne unit of costs twice as much as one unit of , so is a plausible answer. To certify it, multiply the three linear inequalities by , respectively, and add:The proposed feasible point attains , so its cost is the global minimum.
In the conic dual problem convention, the data and certificate areDirect matrix multiplication gives and . At , the slack variable is , so . The first linear inequality has positive slack and zero multiplier; the two positively weighted linear inequalities are tight. This is complementary slackness.
The entire dual feasible set can also be read off: write with . Then and . Maximizing this lower bound gives . A point such as is still a valid certificate of the weaker bound .
Objective function 2026-10-13
An objective function is a real-valued function assigning a score to each decision under consideration. An optimization problem seeks a feasible solution maximizing or minimizing this score. The optimizing decision and its score are different objects: in the budget constraint example, the decision is and the optimal value is .
Choosing an objective function expresses what matters. With and , maximizing makes every feasible point equally good; maximizing selects ; maximizing rewards balance. If are side lengths, is a rectangle's area, and the budget constraint fixes its perimeter at . The same mathematics then says that a square encloses the largest area among these rectangles.
For the product objective function, the positive level sets are hyperbolas. Each collects decisions with identical scores. The highest attainable level set touches the feasible set at ; higher ones miss it entirely.
The product is neither a convex function nor a concave function on the positive quadrant: along it is , while along it is . Yet its restriction to this feasible set is a strictly concave function. Thus the geometry of the allowed decisions can make an otherwise nonconcave maximization problem tractable. Replacing by always converts a maximization problem into an equivalent minimization problem.
// Target: mathematical-optimization.bigb
Past exam of the mathematics course of the University of Cambridge 2001 iii Paper 31 3 ii Solution Created 2026-10-03 Updated 2026-10-14
The objective function is nonnegative. We now construct a feasible zero-objective point, distinguishing the input problem's possible states.
If the primal is feasible and bounded below, strong duality and attainment for a linear program give , and withSet , , , , , andThe first three embedding equations hold. Substituting their equalities into the fourth gives precisely .
If the primal is infeasible, the Farkas alternative supplies with and . Take , , , and . These satisfy the same equations. If the primal is feasible and unbounded below, it has a direction in the recession cone with and . Set , , and . This is again a feasible nonzero embedding vector. Normalize the constructed vector by the sum of its nonnegative coordinates. In every case,The facts about optimal pairs and recession directions follow from the polyhedral alternatives of linear programming duality; they do not require knowing their values or witnesses to write the transformed coefficients.
To recover information from the transformed optimum, multiply the first three original embedding equations by , , and , respectively, and add. Their cross terms cancel; the fourth equation givesAt , nonnegativity forces and . The equations also implyThus any normalized zero-objective point has : if , all these coordinates vanish, and then , contradicting normalization.
If , division by gives a primal-feasible point and dual-feasible point with equal objective function values; hence they are optimal. If , then , , , andTherefore either certifies primal infeasibility, or is an improving recession direction certifying dual infeasibility and unboundedness whenever the primal is feasible. If only the latter certificate is obtained and primal feasibility is unknown, apply the same construction to the feasibility problem with objective function ; it gives either a feasible point or a direct primal infeasibility certificate.
A degenerate optimal point can have and convey neither conclusion. Choose an optimum in the relative interior of the optimal face of a linear program. The explicit existence argument above gives a point of this face with . A nonnegative coordinate which is positive somewhere on a face of a convex set is positive throughout its relative interior, so the chosen point has and can be decoded. The assertion follows because a small relative-interior displacement in the direction opposite a positive-coordinate point would otherwise make that coordinate negative. Equivalently one may obtain a maximum-support optimum; choosing an arbitrary degenerate boundary optimum is insufficient.
This reduction is useful because an interior-point method now has a known strictly feasible start, a compact standard simplex slice, and a known target objective function. Projective rescalings can recenter positive iterates, and the transformed problem supplies optimality or infeasibility information without a separate guessed optimum. Polynomial bit-complexity claims need rational data with a finite encoding length. The printed bound on arbitrary real coefficients by itself does not bound denominators or the size of nonzero determinants; it is not a substitute for that encoding assumption.
Past exam of the mathematics course of the University of Cambridge 2002 iii Paper 34 2 Solution Created 2026-10-03 Updated 2026-10-14
Let be an extreme point and consider its active constraints. Their row vectors span . Otherwise a nonzero vector is orthogonal to every active row. All inactive inequalities have strictly positive slack; since there are finitely many, a sufficiently small makes both and feasible. Their midpoint is , contradicting extremality.
Choose independent active rows and write the corresponding equalities as . The matrix has integer entries, so is a nonzero integer and . By Cramer's rule,where replaces column by . Every entry of has absolute value at most , even when is real. The determinant expansion has terms, each with absolute value at most . ThereforeThis proves the integer-matrix vertex coordinate bound; only the denominator determinant requires integrality.
For an exact finite-input ellipsoid method, the numerical data must have a specified encoding. In the standard model the input is the dimensions, the integer matrix and a rational right-hand side in binary, together with bounds derived from their encoding lengths. The vertex estimate above remains valid for arbitrary real , but arbitrary unencoded reals do not by themselves specify an exact computational decision problem. Clear the rational row denominators to obtain an equivalent integer system, and let bound the resulting integer coefficients and right-hand sides.
Two precautions make a feasibility account valid even for unbounded or lower-dimensional polyhedra. First, nonempty polyhedra need not have extreme points. Nevertheless they have a feasible point in the box with . To prove this feasible-point box bound for a polyhedron with lines, intersect the polyhedron with an orthant containing one feasible point. Minimize the sum of the signed coordinates in that orthant. Its nonempty sublevel sets are closed and bounded, so the minimum is attained. The compact minimum face has an extreme point, which is also extreme in the orthant intersection. Its active rows come from the integer system and signed coordinate inequalities, still bounded by . Applying the proved vertex estimate gives the box bound. This is an existence argument; the algorithm need not enumerate all orthants.
Second, a nonempty feasible set can have zero ambient volume. Use a small uniform relaxation with a certified rational infeasibility gap, rather than stopping on volume alone. For the integer system , putThe normalized integer Farkas infeasibility gap says that if the system is empty there is a multiplier with , and . Its bound follows by maximizing the certificate's value in the normalized multiplier polytope: a vertex has at most positive entries, and a determinant denominator bounded by . Any point satisfying the relaxed inequalities would then give the contradictionThus relaxation preserves emptiness. If the original system is nonempty, take its point . The bounded relaxed setcontains a Euclidean ball around of radius : each row changes by at most , and the expanded box leaves room for the ball. Hence is either empty or has an explicit positive inner-volume bound. This is the full-dimensional relaxation of integer inequalities principle.
Start with a ball, viewed as an ellipsoid, centered at zero with radius , which contains the search box. At each iteration test its center against all inequalities defining . If the center is feasible, the preserved-emptiness result answers that the original problem is nonempty. Otherwise a violated row supplies a separation oracle cut. Move that cut parallel to itself through the current center if necessary, and compute a smaller containing ellipsoid for the surviving half. Every feasible point remains in the new ellipsoid.
The central-cut ellipsoid volume bound gives a shrinkage factor at most for . After cuts, the volume is below that of a radius- ball. If no feasible center has been found, and therefore the original system are empty. Dimension one uses interval bisection. The logarithms of , and are polynomial in the encoded input size. Standard outward-controlled finite-precision ellipsoid updates preserve enclosure with polynomial bit complexity.
The coordinate bound therefore supplies the initial bounded search region; the rational gap supplies a valid stopping threshold. Neither unboundedness nor zero volume of the original polyhedron can be ignored when deciding emptiness.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 40 1 Solution Created 2026-10-03 Updated 2026-10-14
Introduce nonnegative slack variables and write for the objective value. The initial simplex dictionary, recovered from the original PDF rather than the corrupted converted table, isFor this minimization convention, nonnegative objective coefficients give dual feasibility. The dual simplex algorithm repairs a negative basic value while retaining those nonnegative reduced costs. If the leaving row is , , an entering variable must have ; choose the smallest ratio of its objective coefficient to .
Choose to leave. Eligible columns are , with ratios and . Thus enters. Solving its row and substituting givesNow only has a negative basic value. Its only eligible entering column is , so pivot there, with leaving. The resulting dictionary isSetting the nonbasic variables to zero gives a basic feasible solution. The final objective row also proves for every feasible point, because its nonbasic variables are nonnegative. Hence the unique relaxed optimum is
For the integer program, all four original slack variables are integers whenever the decision variables are integers. The fractional row can be writtenThe Gomory fractional cut keeps the fractional parts of these coefficients: and . It therefore gives , or . Its validity can also be seen directly: the displayed row makes an odd nonnegative integer. In original variables this cut is .
Introduce the new integer-valued slack , with initial row . It is primal infeasible but retains dual feasibility, so one more dual-simplex pivot has leave and enter. Substitute to obtainAll basic values at are nonnegative integers, including . The objective row proves a lower bound of on every point satisfying the valid cut, hence on every integer-feasible point. It is attained atThe strictly positive nonbasic objective coefficients also show uniqueness. One Gomory cut and its reoptimization are sufficient.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 40 2 Solution Created 2026-10-03 Updated 2026-10-14
Assume and the integer coefficient bound . There are integers to record. Each signed integer in can be encoded in bits, so a fixed-width dense encoding needsbits, including the dimensions and bound. Its size is . This is the bit-input model used for polynomial time; an arithmetic-operation count alone would not suffice.
We first construct a rational feasibility certificate for integer inequalities. Choose a feasible point and an orthant containing it, adding coordinate inequalities of the form or . The intersection is nonempty. Starting at a point of , if the active constraint normals have rank less than , choose a nonzero direction annihilating them. A sufficiently short move in either direction remains feasible, since every inactive constraint has positive slack. At least one direction has a finite endpoint: a nonzero coordinate of can be oriented toward the orthant boundary. Move to the first constraint met along such a direction. Its normal does not annihilate , so it is independent of the previously active normals. Their rank strictly increases. In at most moves we obtain a point with independent active constraints.
At that point for an invertible integer matrix . Its rows are original constraint rows or signed coordinate rows, and has entries from or zero. All entries have absolute value at most . By Cramer's rule,where replaces column by . The Hadamard determinant inequality bounds both determinants by . The denominator is a nonzero integer. Hence each coordinate has the claimed representation with numerator and denominator bounded in absolute value by . The orthant argument is needed because itself may contain lines and have no vertex. If is allowed literally, all coefficients and right sides vanish, and is feasible; the printed fraction bound then needs replaced by , since a nonzero denominator cannot have absolute value at most zero. The bound just proved uses the customary positive coefficient bound.
Recording such fractions takes bits. A verifier checks that denominators are nonzero, changes their signs if needed, and verifies all inequalities by exact integer arithmetic after multiplying by positive denominators. The intermediate integers still have polynomial bit length. Thus a yes-instance has a polynomial-size, polynomial-time verifiable witness, and .
For optimization, let be rational with a finite binary encoding; clear its denominators to make it integer, which multiplies the objective by a positive constant and preserves its minimizers. All bit bounds below include the encoding length of . Let and .
A useful refinement of the preceding vertex argument is that if an objective is bounded below, a feasible point can be moved to an orthant vertex without increasing its objective. Choose the annihilating direction to have . If the inequality is strict, the forward feasible interval must have a finite endpoint, since otherwise the objective would be unbounded below. If , choose either finite endpoint supplied by the orthant. Rank increases as before. There are only finitely many such vertices across the finitely many orthants. Every feasible point therefore has one of these vertices with no larger objective; taking the least vertex value proves that a finite optimum is attained at one of them.
The Cramer representations at this optimum have one common denominator , of magnitude at most . Therefore its objective value has a representation with denominator at most and numerator at most . In particular . No enumeration of orthants or vertices is part of the algorithm; they provide only polynomial-bit bounds.
Here is an exact linear optimization from a feasibility oracle. First call the assumed ellipsoid method feasibility routine on ; if it is empty, report infeasibility. Otherwise query feasibility with the extra inequality . A yes answer proves unboundedness below, because any finite optimum would be at least ; an unbounded objective necessarily gives a yes answer. Thus the infeasible, unbounded and finite-optimum cases are distinguished using two feasibility calls.
In the finite case, maintain an infeasible lower threshold and a feasible upper threshold . Bisect the interval, querying each time. After polynomially many calls its length is less than , and lies in the resulting interval. Distinct reduced fractions with positive denominators at most differ by at least , so there is only one possible value. It can be recovered in polynomial time by continued fractions: for the midpoint , , where is the denominator of . Thus occurs among the continued-fraction convergents of . Compute those by the Euclidean algorithm and choose the unique fraction with denominator at most in the interval. If , use the final exact convergent. The Euclidean algorithm and all thresholds have polynomial bit length.
Even if the feasibility routine returns only a decision, an optimal point can be recovered without assuming a witness-producing oracle. Add and for all . This bounded optimal convex polytope is nonempty, since the optimal vertex above lies in it. Clear the denominator of and setAll vertex coordinates of this fixed convex polytope have denominators at most by the same determinant argument. Minimize , recover its exact minimum by feasibility bisection and rational reconstruction, then fix it; do the same for , and so on. Each restriction is an optimal face of the same original bounded convex polytope, so its vertices are original vertices. The single denominator bound therefore works at every step; repeated new precision bounds do not grow exponentially. After steps all coordinates are fixed to a feasible optimizer. There are polynomially many calls on polynomial-length rational instances, converted to integer inequalities by clearing denominators. Consequently linear optimization has a polynomial-time algorithm whenever linear feasibility does, with exact optimal value and optimizer, and correct reports of infeasibility or unboundedness.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 66 2 ii Solution Created 2026-10-03 Updated 2026-10-14
The same relative coordinates give the proximity time of translating line segments asThis is a convex norm-constrained problem, rather than the linear feasibility problem for contact. One can solve it as a small second-order cone problem. If the distance between the initial line segments is at most , the answer is zero; if no feasible point exists, the threshold is never reached.
For an elementary analytic algorithm, consider the nine combinations in which each of is either free, fixed at zero or fixed at one. In each case, minimize the squared distance over the free parameters. Writing for plus the fixed endpoint contributions, and for the columns belonging to free parameters, stationarity isIf the Gram matrix is nonsingular, is affine in time. Retain only the time interval on which its entries lie in . The residual is then , and feasibility reduces toIntersect its solution interval with and the free-parameter validity interval, and record the first point. Include the four endpoint–endpoint cases, where there are no unfixed segment parameters. Take the earliest valid candidate among all cases. The actual closest pair belongs to one of these faces of the parameter square, so this enumeration cannot miss the first approach.
The complications are the quadratic threshold equation, changes of the active closest-point feature and singular Gram matrices for parallel or degenerate segments. In a singular case, keep the affine family of minimizers and its feasibility bounds, or use the original convex problem; a pseudoinverse answer alone can fall outside the segment even when another minimizer is feasible. Constant-distance cases and tangential threshold contact must also be retained. Merely checking moving endpoints misses approaches between interior points.
Past exam of the mathematics course of the University of Cambridge 2007 ib Paper 4 20C i Solution Created 2026-09-24 Updated 2026-10-14
Use payoff , so maximization of is equivalent to the required minimization. In the given simplex tableau, can increase the payoff. The simplex ratio test has candidate ratios in the row and in the row; the negative coefficient in the row imposes no upper bound. Thus enters the simplex basis and leaves.
Divide the pivot row by , then eliminate from the other rows. The resulting simplex dictionary isAll slack variables and original variables are nonnegative. The last row therefore proves for every feasible point; setting the nonbasic variables to zero attains it and leaves all basic variables nonnegative. HenceThe slack vector is .
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 38 1 a Solution Created 2026-10-03 Updated 2026-10-14
Fix a primal feasible point . For every dual feasible point , nonnegativity and the primal and dual inequalities giveHence the dual objective is bounded below by wherever it is feasible, which is weak duality. This is the meaning of “bounded” in this assertion; it does not say that the dual feasible set is bounded, or that it is nonempty. For example, with , , and a single variable, the primal is feasible and unbounded above, while its dual would require and is infeasible.
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 38 1 b Solution Created 2026-10-03 Updated 2026-10-14
Let the finite primal supremum be . First it is attained. The setis a finitely generated cone, hence closed by the argument in the root Solution. For a sequence of primal feasible points whose values approach , the pairs belong to . Their limit therefore belongs to . It gives a feasible point with , so necessarily .
Let index the tight primal inequalities at and let index its zero coordinates. Consider the closed convex cone generated by for and for . If were outside this cone, separation from a closed convex cone would give a direction withFor sufficiently small positive , remains a feasible point: the active constraints have the required signs, and every inactive constraint retains its positive slack. Its larger objective contradicts optimality. Therefore there are , supported on , and , supported on , such thatThis makes a dual feasible point. Moreover, the support restrictions giveTogether with weak duality, this proves strong duality and dual attainment:

