Active-Set Methods for Quadratic Programming
Anchor (Master): Nocedal & Wright 2006 Numerical Optimization 2e (Springer) Ch. 16 (§16.2 direct solution of the KKT system, §16.4 inertia-controlling factorizations, §16.5 active-set methods for convex QP, §16.7 anti-cycling and finite termination); Fletcher 1987 Practical Methods of Optimization 2e (Wiley) Ch. 10 (the active-set / working-set strategy, Lagrange-multiplier sign tests, and the link to SQP)
Intuition Beginner
A quadratic program is the simplest constrained problem with real curvature: the cost is a smooth bowl, and the rules are all straight lines or flat walls. Picture a tilted bowl resting in a room whose floor and walls are flat panels. Drop a marble in. If the bowl's lowest point sits inside the room, the marble settles there and no wall matters. If the lowest point is outside, the marble rolls until it jams against one or more walls and stops where the walls hold it.
The whole difficulty is figuring out which walls the marble ends up pressed against. That set of touched walls is called the working set. If you somehow knew it in advance, the problem would collapse: hold exactly those walls as tight rules, ignore the rest, and solve the easy bowl-with-flat-rules problem in one shot. You do not know it in advance, so you guess, solve the easy problem for that guess, and then check the guess.
Two checks correct a wrong guess. First, the step you computed might try to pass through a wall you were ignoring; if so, you stop at that wall and add it to the working set. Second, a wall you are pressing might actually be pulling you back from a better point; the sign of its price tells you, and if the price is wrong you drop that wall and let go. Each correction strictly improves matters, the walls are finite in number, so after finitely many guesses the working set is right and the marble has found its resting place.
Visual Beginner
Picture a bowl-shaped cost over a region fenced by three straight walls. The free bottom of the bowl lies outside the fenced region, so the best allowed point sits where the bowl's contours first touch the fence — pressed against one wall, or wedged into a corner where two walls meet.
cost contours (rings around the free bottom *)
________________
/ _______ \ wall 1
/ / \ \ ____________________
| | * | | /
\ \_______/ /|/ <- free bottom * is OUTSIDE
\________________ / | the allowed region
best -> o | working set = {wall 1}
feasible | wall 2
x* |
----------------------------------
wall 3 (floor)
guess a working set -> solve the easy "press these walls" problem
step crosses an idle wall? add it (blocking constraint)
a pressed wall has wrong-sign price? drop it
repeat: finitely many walls => finitely many guesses
| situation | what the method does | working-set change |
|---|---|---|
| step stays inside the region | take the full step | none |
| step would cross an idle wall | stop at that wall | add the blocking wall |
| a pressed wall has a wrong-sign price | release it | drop that wall |
| full step taken and all prices right | stop: optimal | none |
The takeaway: the hard part of a quadratic program is identifying the touched walls, and the active-set method finds them by guessing, solving an easy equality problem, and fixing the guess one wall at a time.
Worked example Beginner
Minimize the cost — a round bowl centered at — subject to two straight rules: and . The free bottom breaks the first rule, since , so the best allowed point sits on a wall.
Step 1. Guess the working set. Guess that only the first wall is pressed: . Hold that as a tight rule and find the lowest bowl point on the line.
Step 2. Solve the easy problem. On the line , the closest point to the center is found by stepping from the center straight toward the line. That gives and , which add to , so the line rule holds.
Step 3. Check the other rule. Is ? Here , so the ignored wall is not crossed. Good.
Step 4. Check the price. The pressed wall has a price equal to , found from how hard the bowl pushes into it: the center is distance giving a positive pull outward. A positive price means the wall genuinely holds the marble back, so we keep it.
What this tells us. The guess "only the first wall is pressed" passed both checks: no ignored wall was crossed, and the pressed wall's price was positive. So is the answer, with cost . The method guessed the working set, solved a one-line problem, and confirmed the guess — the entire active-set idea in one pass.
Check your understanding Beginner
Formal definition Intermediate+
A quadratic program (QP) in is
with symmetric, , and finitely many linear constraints indexed by (equalities) and (inequalities). The QP is convex when and strictly convex when ; otherwise it is nonconvex (indefinite ). The feasible set is a polyhedron. At a feasible the active set collects the equalities and the inequalities holding with equality, exactly as in 44.02.02.
Definition (equality-constrained QP and its KKT system). With all active constraints stacked as rows of and right-hand side , the equality-constrained QP (EQP) is subject to . Its first-order optimality conditions are the linear KKT (saddle-point) system
where is the vector of multipliers; this is the QP instance of the constrained-Newton KKT matrix of 44.03.03. Writing the EQP for a step from a feasible (so is the gradient and ) puts the system in the homogeneous-constraint form \begin{psmallmatrix} G & A^\top \\ A & 0\end{psmallmatrix}\begin{psmallmatrix} p \\ -\lambda\end{psmallmatrix} = \begin{psmallmatrix} -g \\ 0\end{psmallmatrix}.
Definition (inertia condition). The inertia of a symmetric matrix is the triple of its numbers of positive, negative, and zero eigenvalues. The KKT matrix K = \begin{psmallmatrix} G & A^\top \\ A & 0\end{psmallmatrix} with has the correct inertia if and only if has full row rank and is positive definite on the null space , i.e. the reduced Hessian for a basis of . Under the correct inertia is nonsingular and the EQP has the unique minimizer given by the KKT solve.
Definition (null-space and range-space solves). Let the columns of be a basis of and let span a complement so that is nonsingular. The null-space method writes , fixes from (here ), and solves the reduced system for the free component, giving . The range-space (Schur-complement) method eliminates first, solving for the multipliers and then ; it requires on all of . The new symbols (Hessian), the working set , the inertia triple , and the basis matrices are recorded in _meta/NOTATION.md.
Definition (primal active-set method). A working set is a subset of active constraints whose gradients are linearly independent, treated as equalities. Starting from a feasible , each iteration solves the EQP step over (constraints in held to ), then takes with step length
If the minimizing index is a blocking constraint, added to . If and the EQP multipliers satisfy for all , the point is optimal; otherwise the most-negative-multiplier constraint is dropped from the working set.
Counterexamples to common slips
- Nonconvex QP is NP-hard, not merely "Newton with constraints." When is indefinite, the QP can have exponentially many local minima and checking global optimality is NP-hard; the primal active-set method finds a KKT point but not necessarily a global minimizer. Convexity () is exactly what makes every KKT point global, by
44.02.02. - The full Hessian need not be positive definite for the EQP to be well posed. The KKT matrix is nonsingular under the inertia condition — only on , plus full row rank — even when is indefinite on . Demanding globally is the range-space method's hypothesis, not the EQP's.
- A multiplier becoming negative does not mean the iterate is wrong; it means a wall should be released. A working-set constraint with is one the objective would prefer to cross; dropping it and re-solving strictly decreases . Keeping it because "it was active" stalls the method short of the optimum.
Key theorem with proof Intermediate+
The signature result is the finite termination of the primal active-set method on a strictly convex QP. It isolates the two mechanisms — strict decrease of the objective whenever a constraint is dropped, and the impossibility of repeating a working set without cycling — that make a finite, combinatorial search over working sets converge to the global solution.
Theorem (finite termination of the primal active-set method, strictly convex QP). Let and suppose the QP is feasible. Starting from a feasible point with a working set of linearly independent active constraints, and resolving ties by an anti-cycling rule (Bland's rule or a lexicographic perturbation), the primal active-set method reaches the unique global minimizer in finitely many iterations.
Proof. Each iteration solves the EQP over the current working set . Since , the reduced Hessian for any spanning , so by the inertia condition the KKT matrix is nonsingular and the EQP step is the unique minimizer of on the affine set . Two cases.
If , then strictly decreases along : because minimizes on the working-set face only when , a nonzero EQP step has , and the step length (the ratios defining are positive, as each blocked constraint has and ). Thus . Either and is the working-set minimizer, or and a blocking constraint enlarges the working set while strictly drops.
If , then is the EQP minimizer for , and its multipliers solve the KKT system. If all for , the full KKT conditions of 44.02.02 hold (stationarity and primal feasibility hold by construction; dual feasibility is the sign test; complementary slackness holds since inactive constraints carry zero multiplier), so is the global minimizer by convexity. Otherwise some ; dropping yields a working set on whose larger face has a strictly decreasing feasible direction, so the next nonzero step strictly decreases .
Finiteness: between two iterations with at the same working set, would have to return to the same value, impossible because strictly decreases on every nonzero step and a working set determines its EQP minimizer uniquely (strict convexity). The only obstruction is degeneracy, where a sequence of zero-length steps cycles through working sets at one vertex; Bland's rule or a lexicographic perturbation forbids revisiting a working set, so the number of distinct working sets — finite, being subsets of the constraint index set — bounds the iteration count.
Bridge. This finite-termination theorem builds toward sequential quadratic programming, where exactly this QP solver runs as the inner iteration, and it appears again in every active-set solver for linear and quadratic programs, the simplex method being the linear special case . This is exactly the combinatorial shadow of the KKT conditions of 44.02.02: the working set is a guess of the active set, the EQP solve enforces stationarity on that guess, and the multiplier sign test is dual feasibility deciding whether the guess is correct. The foundational reason the method is finite is that strict convexity makes each working set determine a unique EQP minimizer and each nonzero step strictly decreases , so no working set recurs once anti-cycling forbids degenerate loops. Putting these together, the active-set method generalises the equality-constrained KKT solve of 44.03.03 from a fixed constraint set to a search over candidate active sets, and is dual to the complementary-slackness bookkeeping: adding a blocking constraint is "an inequality became active," dropping a negative-multiplier constraint is "an active inequality wants to go slack," and the method terminates precisely when the active-set guess and the multiplier signs are mutually consistent — the discrete realization of the KKT certificate.
Exercises Intermediate+
Advanced results Master
The KKT system, its inertia, and the equivalence of solution methods
The equality-constrained QP reduces to the symmetric saddle-point system K\begin{psmallmatrix} p \\ -\lambda\end{psmallmatrix} = \begin{psmallmatrix} -g \\ 0\end{psmallmatrix}, K = \begin{psmallmatrix} G & A^\top \\ A & 0\end{psmallmatrix}, and the central structural fact is the inertia formula when has full row rank, with a null-space basis [Nocedal & Wright §16.2]. The correct inertia is therefore equivalent to , the unique-minimizer condition for the EQP. The null-space method and the range-space (Schur-complement) method , , are two factorizations of the same applied to the same right-hand side; they coincide on the unique solution whenever both are defined, with the range-space form demanding globally and the null-space form needing only the reduced-Hessian positive-definiteness. A direct symmetric-indefinite factorization of is the third route, and inertia-controlling factorizations monitor during elimination to detect when a working-set change has destroyed the correct inertia.
The primal active-set iteration as a finite combinatorial search
The primal active-set method performs a walk over working sets , each a linearly independent subset of active constraints, solving one EQP per iteration. The step length is the largest scalar keeping feasibility, computed by the ratio test over idle constraints with ; the minimizing index is the blocking constraint added to . When the working-set EQP returns , the iterate is the minimizer of on the current face, and its multipliers are tested: a constraint with is dropped, opening a descent direction (Exercise 6); all certifies global optimality by 44.02.02 under convexity [Nocedal & Wright §16.5]. The method maintains primal feasibility throughout and decreases on every nonzero step, so it is a feasible-point, monotone-descent algorithm — the QP analogue of the simplex method, which is the specialization where the objective is linear and every vertex is a candidate solution. Dual active-set methods invert the roles, maintaining dual feasibility (correct multiplier signs) and working toward primal feasibility, and admit a warm start from an infeasible primal point, which is why dual QP solvers dominate inside SQP where successive subproblems differ slightly.
Degeneracy, cycling, and finite termination
Finite termination on a strictly convex QP rests on two facts: a working set determines a unique EQP minimizer (strict convexity), and each nonzero step strictly decreases , so no working set recurs once degenerate loops are excluded. Degeneracy — more than active constraints at a vertex — admits zero-length steps that change the working set without moving the iterate, the only mechanism by which a working set could recur. Bland's smallest-index rule and lexicographic perturbation both forbid recurrence: Bland's rule by a deterministic tie-break with a combinatorial no-cycling proof, lexicography by perturbing the right-hand side to make every vertex nondegenerate [Fletcher 1987 Ch. 10]. The count is then bounded by the number of distinct working sets, finite as a subset of a finite index set, though worst-case exponential — the same complexity shadow that the simplex method casts, with interior-point QP methods offering the polynomial-time alternative for the convex case.
Convex versus nonconvex QP and the role of the active set in SQP
For convex QP () every KKT point is a global minimizer by 44.02.02, strictly convex QP () has a unique global minimizer, and the active-set method finds it finitely. Nonconvex QP (indefinite ) is NP-hard: the feasible polyhedron's vertices can host exponentially many local minima, and verifying global optimality is intractable; the active-set method, run with inertia-controlling factorizations that detect negative curvature, locates a KKT point satisfying the second-order condition on the critical cone but not a global optimum. The decisive downstream role is as the inner solver of sequential quadratic programming: SQP replaces a smooth nonlinear program by a sequence of QP subproblems whose objective is the Lagrangian's quadratic model and whose constraints are the linearized nonlinear constraints, and the QP's own KKT system is the linearization of the original problem's KKT conditions. The active-set machinery — the working set as a guess of the nonlinear active set, the EQP solve, the inertia condition guaranteeing a well-posed step — is exactly what SQP calls at each outer iteration, and the LICQ and second-order sufficient conditions of 44.02.02 are the regularity hypotheses under which the resulting SQP iteration attains local quadratic convergence.
Synthesis. The quadratic program is exactly the constrained problem at which curvature and linear geometry first meet, and the central insight of this unit is that solving it splits cleanly into a continuous part — the equality-constrained KKT solve of 44.03.03, well posed precisely under the inertia condition — and a combinatorial part, the search over working sets that guess the active set of 44.02.02. The foundational reason the active-set method terminates is strict convexity forcing each working set to a unique EQP minimizer with strict objective decrease on every nonzero step, so the finite supply of working sets bounds the iteration once anti-cycling excludes degenerate loops. Putting these together, the method generalises the fixed-constraint Newton-KKT solve to a problem where the active constraints are unknown, and is dual to the complementary-slackness bookkeeping of 44.02.02: a blocking constraint is an inequality going active, a negative-multiplier drop is an active inequality going slack, and termination is the discrete fixed point where the active-set guess and the multiplier signs agree. This is exactly the engine that appears again in sequential quadratic programming, where the QP is the inner subproblem, in interior-point QP, where the same saddle-point KKT system is perturbed along the central path, and in the simplex method, the linear specialization — three algorithms sharing the KKT-system core proved nonsingular here by the inertia condition.
Full proof set Master
Proposition 1 (inertia of the KKT matrix). Let have full row rank and be a basis of . Then for K = \begin{psmallmatrix} G & A^\top \\ A & 0\end{psmallmatrix}; in particular iff .
Proof. Choose so that is nonsingular and is nonsingular (possible since has full row rank), with . Form the congruence M = \begin{psmallmatrix} Y^\top & 0 \\ Z^\top & 0 \\ 0 & I\end{psmallmatrix} acting on via with S = \begin{psmallmatrix} Y & Z & 0 \\ 0 & 0 & I\end{psmallmatrix} (so is square nonsingular of size ). Computing block-by-block: the rows give and , and the block gives . After eliminating the cross terms by a further congruence (subtracting multiples to clear and the block against the nonsingular off-diagonal), is congruent to \mathrm{diag}(Z^\top G Z)\ \oplus\ \begin{psmallmatrix} 0 & AY \\ (AY)^\top & \ast \end{psmallmatrix}. The block with nonsingular off-diagonal has inertia . By Sylvester's law of inertia (congruence preserves inertia), . Since is , the value occurs iff , i.e. .
Proposition 2 (nonsingularity and uniqueness of the EQP minimizer). Under the inertia condition of Proposition 1, is nonsingular and the EQP s.t. has a unique global minimizer given by the KKT solve.
Proof. Correct inertia has no zero eigenvalues, so is nonsingular and the KKT system has a unique solution . On the feasible affine set, parametrize ; then is strictly convex in because , hence has the unique minimizer , giving the unique global minimizer . The multiplier solving exists since (as ) and is unique by full row rank of . This pair is the KKT solution.
Proposition 3 (equivalence of null-space and range-space solves). When and has full row rank, the null-space step and the range-space step with are equal, and both equal the unique EQP step with .
Proof. Both solve the same nonsingular KKT system \begin{psmallmatrix} G & A^\top \\ A & 0\end{psmallmatrix}\begin{psmallmatrix} p \\ \lambda\end{psmallmatrix} = \begin{psmallmatrix} -g \\ 0\end{psmallmatrix}, which under and full-rank has a unique solution by Proposition 2 (the inertia condition holds a fortiori). The range-space derivation eliminates from the top block and substitutes into , giving , i.e. , then back-substitutes for . The null-space derivation sets (so automatically) and solves , giving . Both produce the unique vector with and , so .
Proposition 4 (strict decrease on a nonzero active-set step). Let and let be the EQP step over working set at feasible . Then for every with the active-set step length.
Proof. The EQP step minimizes on , so and, since , , i.e. by and . Along the ray, using . For the factor , so strictly decreases; since every blocking ratio has nonnegative numerator and positive denominator, and a zero numerator only at a degenerate vertex, handled by anti-cycling.
Proposition 5 (optimality certificate and finite termination). With and an anti-cycling rule, the primal active-set method terminates at the global minimizer in finitely many iterations.
Proof. When , minimizes on the working-set face and the KKT multipliers are uniquely defined (Proposition 2). If all for , the four KKT conditions of 44.02.02 hold — stationarity from the EQP solve, primal feasibility from feasible iterates, dual feasibility from the sign test, complementary slackness from zero multipliers on idle constraints — and convexity makes the global minimizer. If some , dropping produces a strict descent direction (Exercise 6), so the next nonzero step strictly decreases (Proposition 4). The objective is therefore strictly monotone over iterations separated by nonzero steps; since strict convexity ties each working set to a unique EQP minimizer and hence a unique objective value, no working set producing a nonzero step recurs. Degenerate zero-step sequences are the only way a working set could repeat, and the anti-cycling rule (Bland or lexicographic) forbids recurrence. The number of distinct working sets is finite (subsets of the constraint index set with linearly independent gradients), bounding the iteration count.
Connections Master
The KKT optimality theory of
44.02.02is the direct parent: the working set is a combinatorial guess of the active set defined there, the EQP solve enforces stationarity on that guess, the multiplier-sign drop test is dual feasibility deciding whether the guess is correct, and the blocking-constraint addition is complementary slackness turning an idle inequality active. Termination of the active-set method is precisely the iterate reaching a point where all four KKT conditions hold simultaneously, and convexity () is exactly what upgrades that KKT certificate to global optimality. The nonconvex second-order critical-cone condition there is what an indefinite-QP active-set solver must additionally check.The equality-constrained Newton/KKT solve of
44.03.03supplies the per-iteration linear algebra: the EQP subproblem is the QP instance of the constrained-Newton KKT system, the inertia condition and the reduced-Hessian positive-definiteness are inherited verbatim, and the null-space step is the same projected-curvature object that the constrained Newton step factors. The active-set method is the constrained-Newton solve repeated over a search of candidate constraint sets, with each inner solve well posed exactly when that unit's KKT-matrix nonsingularity criterion holds.Sequential quadratic programming
44.04.03is the principal downstream consumer: SQP replaces a nonlinear program by a sequence of QP subproblems whose KKT systems are the linearizations of the original KKT conditions of44.02.02, and the active-set QP solver developed here is the inner iteration SQP runs at every outer step. The warm-starting advantage of dual active-set QP is what makes the SQP inner loop cheap, since successive subproblems differ only slightly, and the inertia/positive-definiteness condition is the regularity hypothesis under which the SQP step is well defined.Interior-point methods for QP
44.04.04are the polynomial-time alternative inner solver: they apply the constrained-Newton machinery to the perturbed KKT equations along a central path rather than searching working sets combinatorially, but solve the same symmetric saddle-point system \begin{psmallmatrix} G & A^\top \\ A & 0\end{psmallmatrix} at each step, so the inertia condition and the null-space/range-space factorizations established here are shared between the two method families, with active-set methods favored for warm starts and small active-set changes and interior-point methods favored for large, cold-started convex QPs.
Historical & philosophical context Master
Quadratic programming as a named problem class and the active-set strategy for it grew directly out of the linear-programming work of the late 1940s and 1950s. The simplex method of George Dantzig (1947) is the specialization, a vertex-walking active-set method for linear objectives, and the recognition that a quadratic objective over linear constraints could be solved by the same working-set bookkeeping came soon after. Marguerite Frank and Philip Wolfe gave an early algorithm for quadratic programming in 1956 [Frank & Wolfe 1956] (Naval Research Logistics Quarterly 3, 95-110), and Philip Wolfe published a simplex-based method for QP in 1959 [Wolfe 1959] (Econometrica 27, 382-398) that adapted the simplex active-set walk to the KKT conditions of the quadratic problem. The complementary-pivoting viewpoint was systematized by Richard Cottle and George Dantzig through the linear complementarity problem and by Carlton Lemke with his complementary-pivot algorithm in 1965.
The numerically stable, factorization-updating form of active-set QP that solvers use today is due to the optimization-software tradition of the 1970s and 1980s, with Gill, Murray, and Wright developing inertia-controlling factorizations and stable null-space and range-space updates [Gill-Murray-Wright 1981], and Roger Fletcher giving the standard textbook treatment of the working-set strategy, the multiplier sign test, and the link to sequential quadratic programming [Fletcher 1987 Ch. 10]. The synthesis in Nocedal and Wright [Nocedal & Wright §16] places the active-set method beside the interior-point alternative and frames QP as the computational core of SQP for general nonlinear programming. The finite-termination guarantee descends from the anti-cycling rules introduced for the simplex method — Robert Bland's smallest-index rule (1977) and the lexicographic perturbation of Dantzig, Orden, and Wolfe — transferred to the quadratic setting.
Bibliography Master
@book{nocedalwright2006qp,
author = {Nocedal, Jorge and Wright, Stephen J.},
title = {Numerical Optimization},
edition = {2},
series = {Springer Series in Operations Research and Financial Engineering},
publisher = {Springer},
year = {2006}
}
@book{fletcher1987practical,
author = {Fletcher, Roger},
title = {Practical Methods of Optimization},
edition = {2},
publisher = {Wiley},
address = {Chichester},
year = {1987}
}
@book{gillmurraywright1981qp,
author = {Gill, Philip E. and Murray, Walter and Wright, Margaret H.},
title = {Practical Optimization},
publisher = {Academic Press},
address = {London},
year = {1981}
}
@article{frankwolfe1956,
author = {Frank, Marguerite and Wolfe, Philip},
title = {An algorithm for quadratic programming},
journal = {Naval Research Logistics Quarterly},
volume = {3},
number = {1--2},
pages = {95--110},
year = {1956}
}
@article{wolfe1959simplex,
author = {Wolfe, Philip},
title = {The simplex method for quadratic programming},
journal = {Econometrica},
volume = {27},
number = {3},
pages = {382--398},
year = {1959}
}
@article{lemke1965complementary,
author = {Lemke, Carlton E.},
title = {Bimatrix equilibrium points and mathematical programming},
journal = {Management Science},
volume = {11},
number = {7},
pages = {681--689},
year = {1965}
}
@article{bland1977cycling,
author = {Bland, Robert G.},
title = {New finite pivoting rules for the simplex method},
journal = {Mathematics of Operations Research},
volume = {2},
number = {2},
pages = {103--107},
year = {1977}
}