Part 5 · Chapter 22

Quadratic and Geometric Programming

General nonlinear programs must be attacked iteratively, but two families are special: their structure is rich enough to be interesting and rigid enough to be solved almost exactly. A quadratic program has a quadratic objective and linear constraints, so its KKT conditions collapse into a linear system plus a complementarity rule — a problem the simplex machinery can be bent to solve in finitely many pivots. A geometric program minimises a posynomial, and a remarkable duality turns the search for the optimal design into a small linear system for the cost fractions — often giving the optimal value before any variable is known. This chapter develops both.

Optimization Techniques Prof. Mithun Mondal Reading time ≈ 55 min
i What you'll learn
  • The quadratic program — a quadratic objective \(\tfrac12\mathbf{x}^{\top}\mathbf{Q}\mathbf{x} + \mathbf{c}^{\top}\mathbf{x}\) over linear constraints — and when it is convex.
  • How the KKT conditions of a QP reduce to a linear complementarity problem: linear equations plus the rule \(\lambda_i s_i = 0\).
  • The KKT matrix that solves an equality-constrained QP in one shot.
  • Wolfe's method — phase-one simplex with restricted basis entry to enforce complementarity.
  • Posynomials, the geometric programming problem, and the AM–GM inequality behind its duality.
  • The degree of difficulty, the dual weights \(\delta_k\) as cost fractions, and how to recover \(\mathbf{x}^\star\) from them.
Section 22-1

The Quadratic Programming Problem

A quadratic program (QP) is the simplest nonlinear program that is still genuinely nonlinear: the objective is quadratic, every constraint is linear. It sits exactly one step beyond the linear programs of Part 2, and it is the local model that Chapter 21's sequential methods solve at every iteration — which is why it deserves a treatment of its own.

Standard quadratic program
\[ \min_{\mathbf{x}}\ f(\mathbf{x}) = \tfrac{1}{2}\,\mathbf{x}^{\!\top}\mathbf{Q}\mathbf{x} + \mathbf{c}^{\!\top}\mathbf{x} \qquad \text{s.t.}\quad \mathbf{A}\mathbf{x} \le \mathbf{b}, \quad \mathbf{x} \ge \mathbf{0} \]

Here \(\mathbf{Q}\) is symmetric and \(n \times n\) — any non-symmetric matrix may be replaced by \(\tfrac12(\mathbf{Q} + \mathbf{Q}^{\top})\) without changing the value of the quadratic form, so symmetry costs nothing. The feasible region is a polyhedron, exactly as in linear programming; only the objective has curvature. Setting \(\mathbf{Q} = \mathbf{0}\) recovers an LP.

Everything hinges on the definiteness of \(\mathbf{Q}\), read exactly as in Section 19-5. Since \(\nabla^2 f = \mathbf{Q}\) everywhere, \(f\) is convex iff \(\mathbf{Q}\) is positive semidefinite. A convex QP over a polyhedron is the best-behaved nonlinear program there is: any KKT point is a global minimiser, and it can be found in finitely many pivots. An indefinite \(\mathbf{Q}\) makes the problem NP-hard in general — local minima proliferate, and the methods below only certify a KKT point.

🔑
The convexity dividing line
\[ \mathbf{Q} \succeq 0 \ \Longleftrightarrow\ f \text{ convex} \ \Longrightarrow\ \text{every KKT point is a global minimum} \]

With \(\mathbf{Q} \succ 0\) the minimiser is unique. With \(\mathbf{Q}\) indefinite the feasible polyhedron may hide many local minima, and finite algorithms lose their global guarantee. Check the definiteness of \(\mathbf{Q}\) before anything else.

Unlike an LP, a QP's optimum need not sit at a vertex. If the unconstrained minimiser \(-\mathbf{Q}^{-1}\mathbf{c}\) happens to be feasible, it is the answer and no constraint matters. Otherwise the solution is pushed onto the boundary — onto a face, an edge, or a vertex — wherever the elliptical contours first touch the polyhedron.

feasible region Ax ≤ b, x ≥ 0 −Q⁻¹c (infeasible) x★ active constraint the optimum need not be a vertex — a contour is tangent to an edge
QP geometry: curved contours meeting a polyhedron
Where QPs come from. Least squares fits \(\min \lVert \mathbf{A}\mathbf{x} - \mathbf{b}\rVert^2\) with sign or budget restrictions; Markowitz portfolio selection minimises variance \(\mathbf{x}^{\top}\boldsymbol{\Sigma}\mathbf{x}\) subject to a return target; model-predictive controllers solve one QP per sampling instant; support-vector machines are QPs in disguise. In every case \(\mathbf{Q}\) is a covariance or a Gram matrix — automatically positive semidefinite, so convexity comes for free.
Section 22-2

KKT Conditions for a QP

Apply the KKT conditions of Chapter 21 to the standard QP. Attach multipliers \(\boldsymbol{\lambda} \ge \mathbf{0}\) to \(\mathbf{A}\mathbf{x} \le \mathbf{b}\) and \(\boldsymbol{\mu} \ge \mathbf{0}\) to \(\mathbf{x} \ge \mathbf{0}\), and add slacks \(\mathbf{s} \ge \mathbf{0}\) to the inequalities. The stationarity condition \(\nabla f + \mathbf{A}^{\top}\boldsymbol{\lambda} - \boldsymbol{\mu} = \mathbf{0}\) is where the magic happens: because \(f\) is quadratic, \(\nabla f = \mathbf{Q}\mathbf{x} + \mathbf{c}\) is linear in \(\mathbf{x}\).

The KKT system of a quadratic program
\[ \begin{aligned} \mathbf{Q}\mathbf{x} + \mathbf{c} + \mathbf{A}^{\!\top}\boldsymbol{\lambda} - \boldsymbol{\mu} &= \mathbf{0} &&\text{(stationarity — linear)}\\ \mathbf{A}\mathbf{x} + \mathbf{s} &= \mathbf{b} &&\text{(feasibility — linear)}\\ \boldsymbol{\lambda}^{\!\top}\mathbf{s} = 0, \quad \boldsymbol{\mu}^{\!\top}\mathbf{x} &= 0 &&\text{(complementary slackness)}\\ \mathbf{x},\ \mathbf{s},\ \boldsymbol{\lambda},\ \boldsymbol{\mu} &\ge \mathbf{0} \end{aligned} \]

Read what has happened. Every condition is a linear equation or a sign restriction, except the two complementarity products. Strip those away and you are left with a system of \(n + m\) linear equations in \(2(n+m)\) non-negative unknowns — precisely the shape of a linear-programming constraint set. All the nonlinearity of the original problem has been squeezed into the combinatorial statement

🔑
The linear complementarity problem (LCP)
\[ \lambda_i\,s_i = 0 \ \ \forall i, \qquad \mu_j\,x_j = 0 \ \ \forall j \]

Each pair \((\lambda_i, s_i)\) has at most one nonzero member — a constraint is either tight (\(s_i = 0\), so it may push back with \(\lambda_i > 0\)) or slack (\(s_i > 0\), so it exerts no force and \(\lambda_i = 0\)). Solving a convex QP is solving this LCP.

The pairs are the complementary pairs; a solution in which at most one member of each pair is basic is a complementary basic feasible solution. Since the number of ways to choose one from each pair is finite, so is the search — and for convex QPs, any such solution found is globally optimal. Section 22-4 turns this observation into an algorithm.

Complementary pairMeaning if first is positiveMeaning if second is positive
\((\lambda_i,\ s_i)\)Constraint \(i\) is active and bindingConstraint \(i\) is inactive; it carries no multiplier
\((\mu_j,\ x_j)\)Variable \(x_j\) is pinned at its bound \(0\)Variable \(x_j\) is interior to its bound; \(\mu_j = 0\)
Section 22-3

Equality-Constrained QP

Drop the inequalities and the combinatorics vanish. With only equalities, \(\min \tfrac12\mathbf{x}^{\top}\mathbf{Q}\mathbf{x} + \mathbf{c}^{\top}\mathbf{x}\) subject to \(\mathbf{A}\mathbf{x} = \mathbf{b}\), the Lagrangian is \(L = \tfrac12\mathbf{x}^{\top}\mathbf{Q}\mathbf{x} + \mathbf{c}^{\top}\mathbf{x} + \boldsymbol{\lambda}^{\top}(\mathbf{A}\mathbf{x} - \mathbf{b})\), and setting both blocks of partials to zero gives one symmetric linear system.

The KKT matrix
\[ \begin{bmatrix} \mathbf{Q} & \mathbf{A}^{\!\top} \\ \mathbf{A} & \mathbf{0} \end{bmatrix} \begin{bmatrix} \mathbf{x}^\star \\ \boldsymbol{\lambda}^\star \end{bmatrix} = \begin{bmatrix} -\,\mathbf{c} \\ \mathbf{b} \end{bmatrix} \]

There is no iteration here at all: one factorisation and the equality-constrained QP is solved exactly, complete with its multipliers. The system is nonsingular whenever \(\mathbf{A}\) has full row rank and \(\mathbf{Q}\) is positive definite on the null space of \(\mathbf{A}\) — that is, the objective curves upward in every direction that stays feasible. Note the matrix is symmetric but indefinite (the zero block guarantees it), so a plain Cholesky factorisation will not do.

This is the engine inside almost every practical QP solver. An active-set method guesses which inequalities are tight, treats that guess (the working set) as equalities, solves the KKT system above, then repairs the guess — dropping a constraint whose multiplier came out negative (it was pushing the wrong way) or adding one that the step would have violated. Each repair is a single pivot, and the process is finite.

The whole difficulty of a QP is the active set, not the arithmetic. If an oracle told you which constraints are tight at \(\mathbf{x}^\star\), you would solve one linear system and be finished. Everything the algorithms of the next section do — restricted pivoting, adding and dropping constraints — is machinery for discovering that set.
Section 22-4

Wolfe's Method

Wolfe's method is the classic way to exploit the LCP structure of Section 22-2 with nothing but a simplex code. The KKT equations are linear, so introduce artificial variables \(\mathbf{a} \ge \mathbf{0}\) and run a phase-one LP that drives them to zero. If the artificials reach zero, the remaining variables satisfy the KKT equations — and if we also never let a complementary pair go basic together, they satisfy complementarity too.

Wolfe's phase-one linear program
\[ \min\ \mathbf{1}^{\!\top}\mathbf{a} \qquad \text{s.t.}\quad \begin{aligned} \mathbf{Q}\mathbf{x} + \mathbf{A}^{\!\top}\boldsymbol{\lambda} - \boldsymbol{\mu} + \mathbf{a} &= -\,\mathbf{c} \\ \mathbf{A}\mathbf{x} + \mathbf{s} &= \mathbf{b} \end{aligned} \qquad \mathbf{x},\mathbf{s},\boldsymbol{\lambda},\boldsymbol{\mu},\mathbf{a} \ge \mathbf{0} \]
🔑
Restricted basis entry
Never let \(\lambda_i\) enter the basis while \(s_i\) is basic — nor \(\mu_j\) while \(x_j\) is basic (and vice versa)

This single side-rule on the entering-variable choice enforces \(\lambda_i s_i = 0\) and \(\mu_j x_j = 0\) at every iteration. The simplex method then does what it always does; the rule simply forbids some columns.

The procedure, then, is short:

  1. Verify \(\mathbf{Q} \succeq 0\); otherwise the method's guarantee is void.
  2. Write the KKT system with slacks \(\mathbf{s}\) and surpluses/multipliers \(\boldsymbol{\lambda}, \boldsymbol{\mu}\). If \(-c_j < 0\) in a stationarity row, multiply that row by \(-1\) so the artificial starts feasible.
  3. Add artificials \(\mathbf{a}\) to the stationarity rows and minimise \(\mathbf{1}^{\top}\mathbf{a}\) by the simplex method.
  4. At each pivot, apply the restricted basis entry rule; if the best candidate column is forbidden, take the next best.
  5. When \(\mathbf{1}^{\top}\mathbf{a} = 0\), read \(\mathbf{x}^\star\) off the basis. For a convex QP it is the global optimum; the \(\boldsymbol{\lambda}\) values are the shadow prices.

Two cousins are worth naming. Beale's method partitions variables into basic and non-basic and expresses the objective in the non-basics, choosing the entering variable by the sign of the resulting free derivative — it handles the case where the optimum is interior to a face more naturally. Lemke's complementary pivoting algorithm attacks the LCP directly with an artificial variable \(z_0\) and a clever "almost-complementary path", and it remains the standard textbook LCP solver. Modern codes have largely replaced all three with active-set and interior-point methods, but the logic — find the active set, then solve a linear system — is unchanged.

Section 22-5

Posynomials & the GP Problem

Geometric programming (GP), developed by Duffin, Peterson and Zener in the 1960s, addresses a completely different structure: objectives built from sums of positive terms with arbitrary real exponents. Such functions describe engineering design almost perfectly — costs of material scale with area, of pumping with velocity cubed, of inventory inversely with order size.

Monomial and posynomial
\[ u_k(\mathbf{x}) = c_k\,x_1^{a_{1k}} x_2^{a_{2k}} \cdots x_n^{a_{nk}}, \qquad g(\mathbf{x}) = \sum_{k=1}^{N} u_k(\mathbf{x}), \qquad c_k > 0,\ x_i > 0 \]

Each \(u_k\) is a monomial (in the GP sense): a positive coefficient times a product of powers, where the exponents \(a_{ik}\) may be any real numbers — negative, fractional, whatever the physics demands. A sum of monomials is a posynomial ("positive polynomial"). Note the two standing restrictions: coefficients must be positive and variables must be strictly positive. Both are natural for a design problem in which \(x_i\) is a length, a flow rate, or a thickness.

The geometric program
\[ \min_{\mathbf{x} > \mathbf{0}}\ g_0(\mathbf{x}) \qquad \text{s.t.}\quad g_m(\mathbf{x}) \le 1, \quad m = 1, \dots, M \]

with every \(g_m\) a posynomial. The form looks restrictive but is not: any constraint \(h(\mathbf{x}) \le d\) with posynomial \(h\) and \(d > 0\) becomes \(h(\mathbf{x})/d \le 1\), and equality constraints are allowed when both sides are monomials. A posynomial is not convex in \(\mathbf{x}\) — but under the substitution \(x_i = e^{y_i}\) each term becomes \(e^{\mathbf{a}_k^{\top}\mathbf{y} + \ln c_k}\), and a sum of exponentials of affine functions is convex. This is why GP is a convex problem in disguise, and why its local optimum is always global.

5/x 2x min 5/x + 2x
Posynomial: competing terms fix the optimum
δ₁ = ½ δ₂ = ½ total optimal cost f★ u₁(x★) = δ₁f★, u₂(x★) = δ₂f★ the dual weights are cost fractions
Dual weights: how the optimal cost splits
Section 22-6

The AM–GM Inequality & the GP Dual

The whole of geometric programming rests on one classical inequality: a weighted arithmetic mean is never smaller than the corresponding weighted geometric mean.

Weighted arithmetic–geometric mean inequality
\[ \sum_{k=1}^{N} \delta_k U_k \ \ge\ \prod_{k=1}^{N} U_k^{\,\delta_k}, \qquad U_k > 0,\quad \delta_k \ge 0,\quad \sum_{k=1}^{N}\delta_k = 1 \]

Now play the trick. Given a posynomial \(g(\mathbf{x}) = \sum_k u_k(\mathbf{x})\) and any weights \(\delta_k\) summing to one, substitute \(U_k = u_k(\mathbf{x})/\delta_k\). The left side becomes \(\sum_k u_k = g(\mathbf{x})\) exactly, and the inequality reads

A lower bound on the posynomial, for every choice of weights
\[ g(\mathbf{x}) \ \ge\ \prod_{k=1}^{N} \left(\frac{u_k(\mathbf{x})}{\delta_k}\right)^{\delta_k} = \prod_{k=1}^{N} \left(\frac{c_k}{\delta_k}\right)^{\delta_k} \cdot \prod_{i=1}^{n} x_i^{\,\sum_k a_{ik}\delta_k} \]

Look at the last product: the variables have collected into a single power of \(x_i\) with exponent \(\sum_k a_{ik}\delta_k\). If we insist that every one of those exponents be zero, the bound stops depending on \(\mathbf{x}\) altogether — it becomes a number, valid for every feasible design. Those two demands on the weights are the dual constraints, and maximising the resulting number is the dual problem.

🔑
The geometric programming dual (unconstrained primal)
\[ \max_{\boldsymbol{\delta}}\ v(\boldsymbol{\delta}) = \prod_{k=1}^{N}\left(\frac{c_k}{\delta_k}\right)^{\delta_k} \]

subject to the normality condition \(\sum_{k} \delta_k = 1\), the orthogonality conditions \(\sum_{k} a_{ik}\,\delta_k = 0\) for each \(i = 1,\dots,n\), and \(\delta_k \ge 0\). For posynomials there is no duality gap: \(\max v(\boldsymbol{\delta}) = \min g(\mathbf{x}) = f^\star\).

Stare at what has been achieved. The primal is a nonlinear minimisation over \(n\) design variables; the dual constraints are \(n + 1\) linear equations in \(N\) weights. The nastiness has migrated from the objective into a linear system — and the dual objective involves the design variables not at all.

Dual conditionEquationWhere it comes from
Normality\(\sum_k \delta_k = 1\)The AM–GM inequality requires weights summing to one
Orthogonality\(\sum_k a_{ik}\delta_k = 0,\ \forall i\)Kills the \(x_i\)-dependence so the bound is a constant
Non-negativity\(\delta_k \ge 0\)Weights are proportions of the total cost
Section 22-7

Degree of Difficulty & Recovery

The dual has \(N\) unknowns tied down by \(n + 1\) linear equations. The gap between them measures how much work is left after the linear algebra is done, and it earns its own name.

🔑
Degree of difficulty
\[ D = N - (n + 1) = (\text{number of terms}) - (\text{number of variables} + 1) \]

If \(D = 0\), the dual constraints determine \(\boldsymbol{\delta}^\star\) uniquely by solving a square linear system — no optimization at all, and \(f^\star = v(\boldsymbol{\delta}^\star)\) follows by substitution. If \(D > 0\) there are \(D\) free directions and the dual must genuinely be maximised (a well-behaved concave problem after taking logs).

The zero-degree-of-difficulty case is the showpiece of the subject: the optimal cost is obtained from a linear system, before a single design variable is known. And when the constraints are consistent but \(D < 0\), the dual system is over-determined and the formulation should be re-examined.

Recovering the design is the last step, and it follows from the condition under which AM–GM holds with equality — namely when all the \(U_k\) are equal. Tracing that back gives the interpretation that makes GP so useful to engineers:

Dual weights are cost fractions
\[ \delta_k^\star = \frac{u_k(\mathbf{x}^\star)}{f^\star} \qquad\Longleftrightarrow\qquad u_k(\mathbf{x}^\star) = \delta_k^\star\,f^\star \]

Each \(\delta_k^\star\) is the fraction of the total optimal cost contributed by term \(k\). That is a design insight in its own right — it says where the money goes in an optimal design, and it is often invariant to the coefficients. Setting each monomial equal to its share \(\delta_k^\star f^\star\) yields \(N\) equations in the \(n\) unknowns \(x_i\); taking logarithms makes them linear, and any \(n\) independent ones give \(\mathbf{x}^\star\).

The GP recipe in five lines. (1) Write the objective as a posynomial and count \(N\), \(n\), and \(D = N - n - 1\). (2) Write normality and orthogonality. (3) Solve for \(\boldsymbol{\delta}^\star\) — directly if \(D = 0\), by maximising \(v\) if \(D > 0\). (4) Evaluate \(f^\star = \prod_k (c_k/\delta_k^\star)^{\delta_k^\star}\). (5) Recover \(\mathbf{x}^\star\) from \(u_k(\mathbf{x}^\star) = \delta_k^\star f^\star\).

Constrained GPs extend the same idea. Each constraint \(g_m(\mathbf{x}) \le 1\) contributes its own block of weights \(\delta_{mk}\), the normality condition applies only to the objective's block, orthogonality runs over all blocks, and each constraint acquires a multiplier \(\lambda_m = \sum_k \delta_{mk}\) appearing in the dual objective as \(\prod_m \prod_k (c_{mk}\lambda_m/\delta_{mk})^{\delta_{mk}}\). A constraint with \(\lambda_m^\star = 0\) is inactive at the optimum — the same complementary-slackness message as Section 22-2, arriving by a different road.

Section 22-8

Worked Examples

1 Is the QP convex?

Problem. Classify \(f(\mathbf{x}) = 2x_1^2 + 2x_2^2 - 2x_1x_2 - 4x_1 - 6x_2\) as a standard QP and decide whether it is convex.

Solution. Match \(f = \tfrac12\mathbf{x}^{\top}\mathbf{Q}\mathbf{x} + \mathbf{c}^{\top}\mathbf{x}\). The quadratic part gives \(\mathbf{Q} = \begin{bmatrix} 4 & -2 \\ -2 & 4 \end{bmatrix}\) (the off-diagonal is \(-2\) because \(\tfrac12(q_{12} + q_{21}) = -2\) must reproduce the \(-2x_1x_2\) term), and \(\mathbf{c} = (-4, -6)^{\top}\). Leading minors: \(4 > 0\) and \(\det \mathbf{Q} = 16 - 4 = 12 > 0\), so \(\mathbf{Q} \succ 0\) by Sylvester's criterion. The QP is strictly convex — any KKT point is the global minimum.

2 Solving a QP through its KKT conditions

Problem. Minimise the \(f\) of Example 1 subject to \(x_1 + x_2 \le 2\), \(x_1, x_2 \ge 0\).

Solution. First test whether the constraint bites. The unconstrained stationary point solves \(4x_1 - 2x_2 = 4\), \(-2x_1 + 4x_2 = 6\), giving \((7/3,\ 8/3)\) — whose sum is \(5 > 2\), so the constraint is violated and must be active: \(x_1 + x_2 = 2\), with \(s = 0\) and \(\lambda \ge 0\). Guessing \(x_1, x_2 > 0\) sets \(\boldsymbol{\mu} = \mathbf{0}\), and stationarity reads \(4x_1 - 2x_2 - 4 + \lambda = 0\), \(4x_2 - 2x_1 - 6 + \lambda = 0\). Subtracting eliminates \(\lambda\): \(6x_1 - 6x_2 + 2 = 0\), i.e. \(x_1 = x_2 - \tfrac13\). With \(x_1 + x_2 = 2\) this gives \(\mathbf{x}^\star = (5/6,\ 7/6)\) and \(\lambda^\star = 4 - 4(5/6) + 2(7/6) = 3\). All signs check — \(\lambda^\star = 3 > 0\), \(\mathbf{x}^\star > \mathbf{0}\) — so the guessed active set was right, and \(f^\star = -49/6 \approx -8.17\). The multiplier says each unit of extra budget in \(x_1 + x_2 \le 2\) would buy about \(3\) units of objective.

3 The KKT matrix in one shot

Problem. Minimise \(f = x_1^2 + x_2^2\) subject to \(x_1 + x_2 = 4\).

Solution. Here \(\mathbf{Q} = 2\mathbf{I}\), \(\mathbf{c} = \mathbf{0}\), \(\mathbf{A} = [1\ \ 1]\), \(b = 4\). The KKT matrix gives \(\begin{bmatrix} 2 & 0 & 1 \\ 0 & 2 & 1 \\ 1 & 1 & 0 \end{bmatrix}\begin{bmatrix} x_1 \\ x_2 \\ \lambda \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 4 \end{bmatrix}\). The first two rows force \(x_1 = x_2 = -\lambda/2\); the third then gives \(-\lambda = 4\), so \(\lambda^\star = -4\) and \(\mathbf{x}^\star = (2, 2)\), \(f^\star = 8\). No iteration, no line search — a single \(3\times 3\) solve. (An equality multiplier is free in sign, so \(\lambda^\star < 0\) is no cause for alarm.)

4 Geometric programming with zero degree of difficulty

Problem. Minimise \(f(x) = \dfrac{5}{x} + 2x\) for \(x > 0\) by the GP dual.

Solution. Two terms, one variable: \(N = 2\), \(n = 1\), so \(D = 2 - 2 = 0\). Coefficients \(c_1 = 5\) (exponent \(-1\)) and \(c_2 = 2\) (exponent \(+1\)). Orthogonality: \(-\delta_1 + \delta_2 = 0\). Normality: \(\delta_1 + \delta_2 = 1\). Hence \(\delta_1^\star = \delta_2^\star = \tfrac12\) — the two terms split the optimal cost evenly. Then \(f^\star = v = \left(\tfrac{5}{1/2}\right)^{1/2}\left(\tfrac{2}{1/2}\right)^{1/2} = \sqrt{10}\cdot\sqrt{4} = \sqrt{40} \approx 6.325\). Recovery: \(u_1(x^\star) = \delta_1^\star f^\star\) means \(5/x^\star = 3.162\), so \(x^\star = 1.581\). Calculus confirms it: \(f' = -5/x^2 + 2 = 0\) gives \(x^\star = \sqrt{5/2} = 1.581\). Note the optimal cost appeared before the optimal design.

5 A three-term GP in two variables

Problem. Minimise \(f(x_1, x_2) = \dfrac{8}{x_1 x_2} + 2x_1 + 4x_2\), \(x_1, x_2 > 0\).

Solution. \(N = 3\), \(n = 2\), so \(D = 3 - 3 = 0\) again. Exponent vectors: \(u_1 \sim (-1,-1)\), \(u_2 \sim (1, 0)\), \(u_3 \sim (0, 1)\). Orthogonality on \(x_1\): \(-\delta_1 + \delta_2 = 0\); on \(x_2\): \(-\delta_1 + \delta_3 = 0\); normality: \(\delta_1 + \delta_2 + \delta_3 = 1\). So \(3\delta_1 = 1\) and \(\delta_1^\star = \delta_2^\star = \delta_3^\star = \tfrac13\) — each term pays a third of the bill. Then \(f^\star = (24)^{1/3}(6)^{1/3}(12)^{1/3} = (24 \cdot 6 \cdot 12)^{1/3} = 1728^{1/3} = 12\). Recovery: \(2x_1^\star = \tfrac13(12) = 4 \Rightarrow x_1^\star = 2\); \(4x_2^\star = 4 \Rightarrow x_2^\star = 1\). Check: \(8/(2\cdot1) + 2(2) + 4(1) = 4 + 4 + 4 = 12\) ✓.

6 Design of an open-top box

Problem. An open-top rectangular tank must hold \(100\ \text{m}^3\). Minimise its total sheet area \(S = x_1x_2 + 2x_1x_3 + 2x_2x_3\) subject to \(x_1x_2x_3 = 100\).

Solution. Eliminate the height with \(x_3 = 100/(x_1x_2)\): \(S = x_1x_2 + \dfrac{200}{x_2} + \dfrac{200}{x_1}\), a posynomial with \(N = 3\), \(n = 2\), \(D = 0\). Exponents: \((1,1)\), \((0,-1)\), \((-1,0)\). Orthogonality on \(x_1\): \(\delta_1 - \delta_3 = 0\); on \(x_2\): \(\delta_1 - \delta_2 = 0\); with normality, \(\delta_1^\star = \delta_2^\star = \delta_3^\star = \tfrac13\). Then \(S^\star = (3)^{1/3}(600)^{1/3}(600)^{1/3} = (1{,}080{,}000)^{1/3} \approx 102.6\ \text{m}^2\). Recovery: \(200/x_1^\star = \tfrac13(102.6) = 34.2\) gives \(x_1^\star = 5.85\ \text{m}\), likewise \(x_2^\star = 5.85\ \text{m}\), and \(x_3^\star = 100/34.2 = 2.92\ \text{m}\). The design rule falls out of the weights: base and sides each absorb a third of the material, and the optimal tank is square in plan and half as deep as it is wide — a conclusion independent of the required volume.

Review

Chapter Summary

The QP

Quadratic objective, linear constraints; \(\mathbf{Q} \succeq 0\) makes it convex, and then any KKT point is global.

KKT ⇒ LCP

All the QP's conditions are linear except \(\lambda_is_i = 0\) and \(\mu_jx_j = 0\) — the nonlinearity is purely combinatorial.

Solving a QP

Guess the active set, solve the KKT matrix \(\begin{bmatrix}\mathbf{Q} & \mathbf{A}^{\top}\\ \mathbf{A} & \mathbf{0}\end{bmatrix}\), repair the guess; Wolfe does it by restricted-entry simplex.

Posynomials

Sums of positive terms with real exponents; non-convex in \(\mathbf{x}\) but convex under \(x_i = e^{y_i}\), so local = global.

The GP dual

AM–GM plus normality and orthogonality gives \(v(\boldsymbol{\delta}) = \prod_k (c_k/\delta_k)^{\delta_k}\) with no duality gap.

Degree of difficulty

\(D = N - n - 1\); when \(D = 0\) the weights — and hence \(f^\star\) — come from a linear system, and \(u_k(\mathbf{x}^\star) = \delta_k^\star f^\star\) recovers the design.

Practice

Problems

For the QPs, form \(\mathbf{Q}\), test definiteness, and write the KKT conditions before solving. For the GPs, always count \(D\) first. Difficulty rises down the list.

  1. Write \(f(x_1,x_2) = 3x_1^2 + 4x_1x_2 + 2x_2^2 - x_1 + 5x_2\) in the standard form \(\tfrac12\mathbf{x}^{\top}\mathbf{Q}\mathbf{x} + \mathbf{c}^{\top}\mathbf{x}\), and decide whether the QP is convex.
  2. Explain why a QP's optimum, unlike an LP's, need not occur at a vertex of the feasible region. Sketch a case where it lies strictly inside.
  3. State the full KKT system for \(\min \tfrac12\mathbf{x}^{\top}\mathbf{Q}\mathbf{x} + \mathbf{c}^{\top}\mathbf{x}\) s.t. \(\mathbf{A}\mathbf{x} \le \mathbf{b},\ \mathbf{x} \ge \mathbf{0}\), and identify the complementary pairs.
  4. Minimise \(f = x_1^2 + x_2^2 - 6x_1 - 8x_2\) subject to \(x_1 + x_2 \le 5\), \(x_1, x_2 \ge 0\), by testing whether the unconstrained minimiser is feasible first.
  5. Solve \(\min\ x_1^2 + 2x_2^2\) s.t. \(x_1 + x_2 = 3\) using the KKT matrix, and interpret the multiplier.
  6. State the restricted-basis-entry rule of Wolfe's method and explain precisely which KKT condition it enforces.
  7. Set up (do not solve) Wolfe's phase-one LP for \(\min\ 2x_1^2 + x_2^2 - 2x_1x_2 - 4x_1\) s.t. \(x_1 + x_2 \le 3\), \(x_1, x_2 \ge 0\).
  8. Show that a posynomial need not be convex in \(\mathbf{x}\), but that \(g(e^{y_1},\dots,e^{y_n})\) is convex in \(\mathbf{y}\).
  9. Find the degree of difficulty of \(f = 4x_1x_2^{-1} + 3x_1^{-2}x_2 + 2x_1x_2\), and of \(f = x_1^{-1}x_2^{-1} + x_1 + x_2 + x_1x_2\).
  10. Minimise \(f(x) = 3x^{-2} + 12x\) for \(x > 0\) using the GP dual, then verify with calculus.
  11. Minimise \(f(x_1,x_2) = \dfrac{16}{x_1x_2} + x_1 + 4x_2\) by the dual; give \(\boldsymbol{\delta}^\star\), \(f^\star\), and \(\mathbf{x}^\star\).
  12. A closed cylindrical can of volume \(V\) is to use minimum sheet metal. Formulate the area as a posynomial in radius and height, solve by GP, and show that the optimal height equals the diameter — for every \(V\).
  13. Prove that \(\delta_k^\star = u_k(\mathbf{x}^\star)/f^\star\) by identifying when the AM–GM inequality holds with equality, and explain why this makes the dual weights a design insight rather than an algebraic artefact.
Tip: both halves of this chapter say the same thing in different dialects — find the structure, and the nonlinear problem collapses into a linear one. In a QP, the only nonlinear content is which constraints are tight; hand that active set to a solver and a single symmetric system finishes the job. In a GP, the only nonlinear content is how the cost divides among the terms; the normality and orthogonality equations pin those fractions down, and when \(D = 0\) they pin them down completely. So before reaching for any iterative method, ask the structural question first: for a QP, is \(\mathbf{Q}\) positive semidefinite and is the unconstrained minimiser feasible? For a GP, what is \(N - n - 1\)? Those two questions decide almost everything that follows.