M6 · Lagrange duality, LP duality and the simplex method

Lectures 27 Oct, 3 Nov, 12 Nov · about 2.5 hours · Goal: derive the dual of a given problem (with its domain), use weak/strong duality, write the dual of any LP and use the duality theorem, and run or reason about the simplex method. Simplex is the only topic taught after MT3, so it has never been tested this year.

How this page works

Sections A–D condense MT3 units 05 and 06 into what finals ask. E–F teach the simplex method from scratch, following the 2021 run of this course (lectures L22–L24, same professor, same order), because the 12 Nov 2026 class was not recorded here.

Notation (his): primal problem (P): $\min f(x)$ s.t. $g_i(x)\ge0$, $h_j(x)=0$. Lagrangian $\mathcal L(x,\lambda,\mu)=f(x)-\sum_i\lambda_ig_i(x)+\sum_j\mu_jh_j(x)$ with $\lambda\ge0$, $\mu$ free. Dual function $t(\lambda,\mu)=\min_x\mathcal L$ (papers also write $q$). $\mu$ is free in sign because an equality $h_j=0$ can be violated in either direction. $p^*$ / $d^*$ = optimal primal / dual values. LP in standard form (he says "canonical form"): $\min c^\top x$ s.t. $Ax=b$, $x\ge0$, $A$ is $m\times d$ of rank $m$ (its $m$ rows are independent).

Glossary: $\lambda_{\min}(Q)$ = smallest eigenvalue of $Q$. Range of $M$ = all vectors $Mz$. Concave = $-t$ is convex (graph bends down). KKT point: a point with multipliers satisfying the KKT conditions (M5). Extreme point (corner): a feasible point that is not the midpoint of two other feasible points. Slater: some $x$ satisfies every non-linear inequality strictly. Symbol warning: $d$ is the dimension but $d^*$ is the dual optimum; scalars along rays are written $s$; in 2024 Q5, $a,b$ are $\min u$, $\max u$.

0. Why this module

  • Derive a dual: 2015 Q2, 2020 P2 Q2, 2021 P2 Q4, MT3 2026 Q6 (10 marks each).
  • LP duality: 2016 Q7 = 2025 Q5 (15 and 10 marks), 2024 Q5, MT3 2026 Q5.
  • Simplex: 2017 Q7 (15 marks), 2020 P2 Q3 (10 marks), and T/F 2025 (s), (t).
The whole module in one sentence

Price the constraints ($\lambda,\mu$), minimise over $x$ freely: the result $t(\lambda,\mu)$ is always a lower bound on $p^*$; for convex problems (and LPs) the best lower bound is exact, and for LPs the best prices are $\mu^\top=c_B^\top B^{-1}$ at the optimal basis, which is exactly what the simplex method computes.

A. The dual function (MT3 unit 05)

Definition

$t(\lambda,\mu)=\min_{x\in\mathbb R^d}\mathcal L(x,\lambda,\mu)$, an unconstrained minimum over all $x$. It may be $-\infty$. Domain = where it is finite. $(\lambda,\mu)$ is dual feasible if $\lambda\ge0$ and $t>-\infty$.

$t$ is always concave (a minimum of functions affine in $(\lambda,\mu)$), even when (P) is not convex.

The only two computations you ever need:

  1. Linear in $x$: $\min_x\,a^\top x+\text{const}$ is the const if $a=0$, else $-\infty$. So "coefficient of $x$ $=0$" becomes an equality constraint of the dual.
  2. Quadratic in $x$: $\min_x\frac12x^\top Mx+v^\top x$ is $-\frac12v^\top M^{-1}v$ at $x=-M^{-1}v$ if $M\succ0$; $-\infty$ if $M$ has a negative eigenvalue; if $M\succeq0$ is singular, finite only when $v$ is in the range of $M$. So "$M(\lambda,\mu)\succeq0$" becomes the domain.
Running example

$\min x_1^2+x_2^2$ s.t. $g=x_1+x_2-1\ge0$. $\mathcal L=x_1^2+x_2^2-\lambda(x_1+x_2-1)$. Hessian $2I$: domain all $\lambda$; minimiser $x_i=\lambda/2$; $t(\lambda)=\lambda-\frac{\lambda^2}2$. Dual: $\max_{\lambda\ge0}t$: $\lambda^*=1$, $d^*=\frac12$. Primal: $x^*=(\frac12,\frac12)$, $p^*=\frac12$. Equal.

The dual function lies below the primal optimum

The curve is $t$ over its domain; the dashed line is $p^*$. Pick a problem.

What to notice: every value of $t$ is below $p^*$ (weak duality). In all three, the top of the curve touches $p^*$: zero duality gap, even for the two non-convex problems.

B. Weak and strong duality

Weak duality (always)

For any feasible $x$ and dual feasible $(\lambda,\mu)$: $t(\lambda,\mu)\le\mathcal L(x,\lambda,\mu)=f(x)-\sum\lambda_ig_i(x)\le f(x)$. Hence $d^*\le p^*$.

Gap estimate: $f(\bar x)-p^*\le f(\bar x)-t(\lambda,\mu)$. 2016 Q5: $f(\bar x)=1$, dual value $0.99$ ⇒ within $0.01$. 2024 final T/F (j): dual value $-1$, $f(\bar x)=0.5$ ⇒ $f(\bar x)-f^*\le1.5$: True.

Strong duality ($d^*=p^*$)
  • LPs: whenever one side has a finite optimum.
  • Convex problems with Slater's condition (some $x$ with $g_i(x)>0$ for the non-linear $g_i$).
  • Some non-convex problems (a quadratic on a ball or sphere). Prove it by exhibiting a feasible $x$ with $f(x)=d^*$.

If strong duality holds with $x^*$, $(\lambda^*,\mu^*)$: complementary slackness $\lambda_i^*g_i(x^*)=0$, and $x^*$ minimises $\mathcal L(\cdot,\lambda^*,\mu^*)$: the KKT conditions hold. To recover $x^*$ from the dual: minimise $\mathcal L(\cdot,\lambda^*,\mu^*)$; a unique minimiser that is feasible is $x^*$.

T/F: "If strong duality holds then both primal and dual are feasible" (2025 (o)): True (both values are finite and equal). "The dual of a QP is a QP" (2025 (n)): True.

C. Deriving duals: four worked questions

Five-step recipe
  1. Lagrangian with $\lambda\ge0$ per inequality, $\mu$ free per equality (use the question's sign form).
  2. Minimise over $x$ with no constraints (rule 1 or 2).
  3. Write $t$ with its domain (marks are given for the domain).
  4. Dual: $\max t$ s.t. $\lambda\ge0$, in the domain.
  5. Solve it (often one variable), then exhibit a feasible $x$ with $f(x)=d^*$ ⇒ strong duality and $x$ optimal.
Worked: MT3 2026 Q6 (10 marks)

Dual of $\min\frac12x^\top x-h^\top x$ s.t. $Ax=b$.

  1. $\mathcal L=\frac12x^\top x-h^\top x+\mu^\top(b-Ax)$, $\mu$ free.
  2. Strictly convex in $x$: $\nabla_x\mathcal L=x-h-A^\top\mu=0$ ⇒ $x(\mu)=h+A^\top\mu$. Domain: all $\mu$.
  3. Substitute: $t(\mu)=b^\top\mu-\frac12\|h+A^\top\mu\|^2$.
  4. Dual: $\max_{\mu\in\mathbb R^m}\ b^\top\mu-\frac12\|h+A^\top\mu\|^2$ (expanded: $-\frac12\mu^\top AA^\top\mu+(b-Ah)^\top\mu-\frac12\|h\|^2$). With the opposite sign convention for $\mu$ you get the same problem with $\mu\to-\mu$.
  5. Its optimum satisfies $A(h+A^\top\mu)=b$, i.e. $x(\mu^*)$ is feasible: strong duality.
Worked: 2021 final P2 Q4 (10 marks), non-convex

$\min\frac12x^\top Qx$ s.t. $\|x\|^2\le1$, $Q$ symmetric, possibly indefinite.

  1. $g=1-\|x\|^2\ge0$: $\mathcal L=\frac12x^\top Qx-\lambda(1-\|x\|^2)=\frac12x^\top(Q+2\lambda I)x-\lambda$. A function of the one variable $\lambda$.
  2. Quadratic with no linear term: min is $0$ (at $x=0$) if $Q+2\lambda I\succeq0$, else $-\infty$. So $t(\lambda)=-\lambda$ on the domain $\lambda\ge-\frac{\lambda_{\min}(Q)}2$.
  3. Dual: $\max-\lambda$ s.t. $\lambda\ge0$, $\lambda\ge-\frac{\lambda_{\min}}2$. Indefinite ⇒ $\lambda_{\min}<0$: $\lambda^*=-\frac{\lambda_{\min}}2$, $d^*=\frac{\lambda_{\min}}2$.
  4. Exhibit $x$: a unit eigenvector $v$ for $\lambda_{\min}$ gives $f(v)=\frac{\lambda_{\min}}2=d^*$ and is feasible. So $x^*=\pm v$, $p^*=d^*$ (zero gap, although non-convex). E.g. $Q=\mathrm{diag}(3,-2,1)$: $d^*=p^*=-1$ at $x=\pm e_2$.

2015 Q2 ($\min x^\top Ax$ s.t. $\|x\|^2\le1$) is the same without the $\frac12$: $p^*=\min(\lambda_{\min}(A),0)$.

Worked: 2020 final P2 Q2 (10 marks), equality constraint

$p^*=\min x^2-y^2+2(x+y)$ s.t. $x^2+y^2=1$.

  1. $\mathcal L=x^2-y^2+2x+2y+\mu(x^2+y^2-1)=(1+\mu)x^2+2x+(\mu-1)y^2+2y-\mu$.
  2. Finite iff both quadratic coefficients are positive: domain $\mu>1$ (at $\mu=1$ the $y$-part is linear, so $-\infty$). Then $x=-\frac1{1+\mu}$, $y=-\frac1{\mu-1}$ and $$t(\mu)=-\frac1{1+\mu}-\frac1{\mu-1}-\mu .$$
  3. Dual optimality: $t'(\mu)=\frac1{(1+\mu)^2}+\frac1{(\mu-1)^2}-1=0$. Multiply by $(\mu^2-1)^2$: $(\mu-1)^2+(\mu+1)^2=(\mu^2-1)^2$, i.e. $\mu^4-4\mu^2-1=0$, so $\mu^2=2+\sqrt5$ and $\mu^*=\sqrt{2+\sqrt5}\approx2.058$. It is the maximum: $t\to-\infty$ as $\mu\to1^+$ and as $\mu\to\infty$, and $t$ is concave. Value: $t=-\frac{2\mu}{\mu^2-1}-\mu=-\mu\frac{\mu^2+1}{\mu^2-1}$, and $\frac{3+\sqrt5}{1+\sqrt5}=\frac{1+\sqrt5}2=\varphi$, so $d^*=-\varphi\sqrt{2+\sqrt5}\approx-3.330$.
  4. $p^*=d^*$? Yes: at $\mu^*$, the minimiser $x(\mu^*)\approx(-0.327,-0.945)$ satisfies $x^2+y^2=1$ (that is exactly $t'(\mu^*)=0$), so it is feasible with $f=\mathcal L=t(\mu^*)$. Zero gap.

D. LP duality (MT3 unit 06)

Converting any LP to standard form: $a^\top x\le\beta$ → add slack $s\ge0$; $a^\top x\ge\beta$ → subtract surplus $s\ge0$; free $x_j=u_j-v_j$ with $u,v\ge0$; $\max c^\top x=-\min(-c^\top x)$.

The pairs to memorise $$\min c^\top x\ \text{s.t.}\ Ax=b,\ x\ge0\quad\longleftrightarrow\quad\max b^\top\mu\ \text{s.t.}\ A^\top\mu\le c\ (\mu\text{ free})$$ $$\min c^\top x\ \text{s.t.}\ Ax\ge b,\ x\ge0\quad\longleftrightarrow\quad\max b^\top y\ \text{s.t.}\ A^\top y\le c,\ y\ge0$$

Derivation (rule 1, taking $h=b-Ax$ so the $\mu$-term is $-\mu^\top(Ax-b)$; $\lambda\ge0$ for $x\ge0$): $\mathcal L=c^\top x-\mu^\top(Ax-b)-\lambda^\top x=(c-A^\top\mu-\lambda)^\top x+b^\top\mu$; finite iff $c=A^\top\mu+\lambda$ with $\lambda\ge0$, i.e. $A^\top\mu\le c$.

Primal (min)Dual (max)
equality constraintfree variable
$\ge$ inequalityvariable $\ge0$
variable $\ge0$$\le$ constraint
free variableequality constraint
$\le$ inequalityvariable $\le0$
variable $\le0$$\ge$ constraint

When unsure of signs, convert to standard form and use the first pair.

Duality theorem of LP
  • Weak: $b^\top\mu=x^\top A^\top\mu\le x^\top c$ for feasible pairs.
  • If either has a finite optimum, so does the other, with equal values.
  • Primal unbounded ⇒ dual infeasible; dual unbounded ⇒ primal infeasible.
  • But "dual infeasible ⇒ primal unbounded" needs the primal to be feasible (both can be infeasible).
  • An LP need not have a minimum: it can be infeasible or unbounded (2025 final (s): False).
Worked: 2025 final Q5 (10 marks) = 2016 Q7

$\min x_1-x_2$ s.t. $2x_1+5x_2\ge10$, $x_1+x_2\ge1$, $x\ge0$.

  1. (a) $\mathcal L=c^\top x-y^\top(Ax-b)-\lambda^\top x=x^\top(c-A^\top y-\lambda)+b^\top y$ with $y,\lambda\ge0$; finite iff $c-A^\top y=\lambda\ge0$. Dual: $\max b^\top y$ s.t. $A^\top y\le c$, $y\ge0$.
  2. (b) Here $c=(1,-1)$, $b=(10,1)$, $A=\begin{pmatrix}2&5\\1&1\end{pmatrix}$: need $2y_1+y_2\le1$ and $5y_1+y_2\le-1$ with $y\ge0$. The second is impossible (left side $\ge0$): dual infeasible. (The printed key writes these rows with $A$ instead of $A^\top$, i.e. $2y_1+5y_2\le1$, $y_1+y_2\le-1$; same conclusion, but use $A^\top$.)
  3. (c) Primal is feasible (e.g. $(0,2)$), dual infeasible ⇒ primal unbounded, $p^*=-\infty$, and $d^*=-\infty$ (a max over an empty set). Directly: $x=s(0,1)$, $s\ge2$, is feasible with value $-s\to-\infty$.
  4. (d) Flip to $2x_1+5x_2\le10$: the feasible set is bounded with corners $(0,1),(1,0),(5,0),(0,2)$; values $-1,1,5,-2$: $p^*=-2$ at $(0,2)$. Dual (writing $-2x_1-5x_2\ge-10$): $\max-10y_1+y_2$ s.t. $-2y_1+y_2\le1$, $-5y_1+y_2\le-1$, $y\ge0$: $y^*=(\frac15,0)$, $d^*=-2$. Equal.
Worked: MT3 2026 Q5 (10 marks)

$\min c^\top x$ s.t. $a^\top x\le3$, $x\in\mathbb R^d$.

  1. (a) KKT ($g=3-a^\top x\ge0$): $c=-\lambda a$, $\lambda\ge0$, $\lambda(a^\top x-3)=0$, $a^\top x\le3$.
  2. (b) Dual: $\max_{\lambda\ge0}-3\lambda$ s.t. $c=-\lambda a$.
  3. (c) $c=-a$: $c^\top x=-a^\top x\ge-3$, value $-3$, attained at any $x$ with $a^\top x=3$, e.g. $x=\frac{3}{\|a\|^2}a$. $c=a+v$ with $v^\top a=0$, $v\ne0$: $x=-sv$ is feasible ($a^\top x=0$) and $c^\top x=-s\|v\|^2\to-\infty$: unbounded along $-v$.
Worked: 2024 final Q5 (10 marks), LP via KKT

$\max u^\top x$ s.t. $\sum x_i\le1$, $x\ge0$; $u$ has distinct non-zero entries, $a=\min u_i$, $b=\max u_i$.

  1. As $\min-u^\top x$ with multipliers $\lambda$ (for $1-\sum x_i\ge0$) and $\lambda_i$ (for $x_i\ge0$): $-u_i=-\lambda+\lambda_i$. LP ⇒ KKT sufficient.
  2. (a) $\sum x_i\le1$ inactive ⇒ $\lambda=0$ ⇒ $u_i=-\lambda_i\le0$ for all $i$: $a<b<0$; and $\lambda_i>0$ forces $x_i=0$: optimal value $0$.
  3. (b) Active: some $x_l>0$ ⇒ $\lambda_l=0$ ⇒ $u_l=\lambda\ge u_i$ for all $i$: $\lambda=b>0$, $x=e_l$ ($l$ the index of the largest $u$), value $b$. Nothing can be said about $a$.

E. Corners are basic feasible solutions

  • Choose $m$ linearly independent columns of $A$: the basis $B$ (the rest form $N$). Set the non-basic variables $x_N=0$ and solve $Bx_B=b$: $x_B=B^{-1}b$. This is a basic solution; if $x_B\ge0$ it is a basic feasible solution (BFS). A zero in $x_B$: degenerate.
  • BFS = extreme point (corner) of $\{Ax=b,\ x\ge0\}$. There are at most $\binom dm$.
  • Fundamental theorem of LP: if a feasible solution exists, a BFS exists; if an optimal solution exists, an optimal BFS exists. So it is enough to search corners.
Running LP example (used in F)

$\min-x_1-2x_2$ s.t. $x_1+x_2\le4$, $x_2\le3$, $x\ge0$. Slacks $s_1,s_2$: variables $(x_1,x_2,s_1,s_2)$, $A=\begin{pmatrix}1&1&1&0\\0&1&0&1\end{pmatrix}$, $b=(4,3)$, $c=(-1,-2,0,0)$.

basissolution$c^\top x$
$x_1,x_2$$(1,3,0,0)$ BFS−7
$x_1,s_1$columns dependent—
$x_1,s_2$$(4,0,0,3)$ BFS−4
$x_2,s_1$$(0,3,1,0)$ BFS−6
$x_2,s_2$$(0,4,0,-1)$ infeasible—
$s_1,s_2$$(0,0,4,3)$ BFS0

F. The simplex method (12 Nov; from his 2021 lectures L23–L24)

Idea: walk from corner to corner, each time moving along an edge that lowers $c^\top x$, until no edge goes down. Algebraically: swap one basic variable for one non-basic variable at a time.

F1. At a BFS: is it optimal?

  1. From $Ax=b$: $Bx_B+Nx_N=b$ ⇒ $x_B=\hat b-B^{-1}Nx_N$ with $\hat b=B^{-1}b$. Write $\hat a_j=B^{-1}a_j$ (the column $a_j$ expressed in the basis).
  2. Substitute into the cost: $c^\top x=c_B^\top\hat b+\sum_{j\in N}\big(c_j-c_B^\top B^{-1}a_j\big)x_j$.
  3. The numbers $r_j=c_j-c_B^\top B^{-1}a_j$ are the reduced costs. Increasing a non-basic $x_j$ from $0$ changes the cost at rate $r_j$.
Optimality test

If $r_j\ge0$ for every non-basic $j$, the BFS is optimal. The full KKT multipliers are then: $\mu=B^{-\top}c_B$ for $Ax=b$, and $\lambda=c-A^\top\mu$ for $x\ge0$, i.e. $\lambda_B=0$, $\lambda_N=r_N\ge0$. (2017 Q7 calls the first one $\lambda^*$.) Then $\mu^\top=c_B^\top B^{-1}$ is dual feasible ($A^\top\mu\le c$) with $b^\top\mu=c^\top x$: it is the dual optimum (2017 Q7: $\lambda^*=B^{-\top}c_B$; MT3 2025 Q5). A BFS returned by the simplex method is therefore a KKT point (2025 final (t), "may not be a KKT point": False).

F2. One pivot

  1. Entering: pick a non-basic $l$ with $r_l<0$ (e.g. the most negative).
  2. Direction: raise $x_l=\alpha$, keep other non-basics at $0$: $x_B=\hat b-\alpha\,\hat a_l$.
  3. Ratio test: stay feasible ($x_B\ge0$): $\bar\alpha=\min\{\hat b_i/\hat a_{il}:\ \hat a_{il}>0\}$, attained at row $k$.
  4. Leaving: the basic variable of row $k$ hits $0$ and leaves; $l$ enters. Cost changes by $\bar\alpha\,r_l\le0$.
  5. Unbounded: if $\hat a_l\le0$ (no positive entry), $\alpha$ can grow forever and $c^\top x\to-\infty$.
  6. Degenerate: if $\bar\alpha=0$ the point doesn't move, only the basis changes; this is how cycling can happen.
  7. Termination: without degeneracy the cost strictly decreases, no BFS repeats, and there are finitely many BFS ($\le\binom dm$): finite.
Worked by hand: the running example from the slack basis
  1. Start $B=\{s_1,s_2\}$: $x=(0,0,4,3)$, cost $0$, $\mu=0$, reduced costs $r=(-1,-2)$ for $(x_1,x_2)$. Not optimal.
  2. Pivot 1: $x_2$ enters ($r=-2$). $\hat a_2=(1,1)$, $\hat b=(4,3)$: ratios $4$ and $3$, minimum $3$ in row 2: $s_2$ leaves. New BFS $(0,3,1,0)$, cost $-6$.
  3. (Pivot 1 used $B=I$, the slack columns, so $\hat a_2=a_2$ and $\hat b=b$.) Now $B=\{s_1,x_2\}$: $B=\begin{pmatrix}1&1\\0&1\end{pmatrix}$, $B^{-1}=\begin{pmatrix}1&-1\\0&1\end{pmatrix}$, $c_B=(0,-2)$, $\mu^\top=c_B^\top B^{-1}=(0,-2)$ (negative prices are normal: $\mu$ is free). Reduced costs: $x_1$: $-1-(1,0)\cdot\mu=-1$; $s_2$: $0-(0,1)\cdot\mu=2$.
  4. Pivot 2: $x_1$ enters. $\hat b=B^{-1}b=(1,3)$, $\hat a_1=B^{-1}(1,0)=(1,0)$: only row 1 has a positive entry, ratio $1$: $s_1$ leaves. New BFS $(1,3,0,0)$, cost $-7$.
  5. $B=\{x_1,x_2\}$: $B=\begin{pmatrix}1&1\\0&1\end{pmatrix}$ again (columns of $x_1,x_2$), $c_B=(-1,-2)$, $\mu^\top=c_B^\top B^{-1}=(-1,-1)$, reduced costs of $s_1,s_2$: $1,1\ge0$: optimal, $x^*=(1,3)$, $p^*=-7=b^\top\mu=d^*$.
Traps
  • $\mu^\top=c_B^\top B^{-1}$ (a row vector), i.e. $\mu=B^{-\top}c_B$. Writing $B^{-1}c_B$ is wrong (the 2025 MT3 Q5 key has this slip).
  • From a non-optimal basis, $c_B^\top B^{-1}$ is not dual feasible (slack basis: $\mu=0$, but $A^\top\mu=0\not\le c$).
  • The ratio test uses only rows with $\hat a_{il}>0$.
Simplex on the running example's picture

Feasible polygon of $x_1+x_2\le4$, $x_2\le3$, $x\ge0$; corners = BFS. Rotate the cost direction $c=(\cos\theta,\sin\theta)$ (minimise $c^\top x$). The path is the simplex method from the origin (most negative reduced cost enters).

θ ≈ 243° is close to the example's $c=(-1,-2)$. Find a θ where two corners tie (an edge of optimal solutions) and one where the problem has its optimum at the origin.

G. Exam recipe

Four question types
  1. "Derive the dual": the five steps of C; state the domain; solve the 1-D dual; exhibit $x$.
  2. "Dual of this LP; feasible? unbounded? flip a constraint": write the pair (D), test dual feasibility by inspection, use the theorem, check corners for the bounded case.
  3. "Standard form, basis, BFS, optimal?, one pivot" (2020 P2 Q3): slacks; $x_B=B^{-1}b$; $\mu^\top=c_B^\top B^{-1}$; reduced costs; entering, ratio test, leaving.
  4. Simplex theory (2017 Q7): $x^0=(B^{-1}b,0)$; direction $(-\hat a_l,e_l)$; unbounded iff $\hat a_l\le0$ with $r_l<0$; dual $\mu=B^{-\top}c_B$.

How he asks it

Evidence
  • 27 Oct (recorded): "Primal is a constrained QP (cannot be easily solved); dual is an unconstrained QP (we can solve)." "If strong duality holds, I can solve the dual problem, get the function value, but I still need to find the $x$… minimise the Lagrangian."
  • 3 Nov (recorded): LP, KKT for LP, the dual, the duality theorem (three statements), canonical form, basic solutions, FTLP (i).
  • 2021 L24 (same course, 18 Nov 2021): the simplex steps exactly as in F: optimality "$c_j-c_B^\top B^{-1}a_j\ge0$", "$l$ enters, $k$ leaves", unbounded when no $k$ exists, degeneracy when $\bar\alpha=0$, finite termination because the BFS are finite.
  • The 2025 final reused the 2016 LP question with new numbers; 2017 Q7 (simplex theory) and 2020 P2 Q3 (one pivot) have not been reused yet.

Practice

T1 2024 final 1(j)T/F

A dual feasible point has dual value $-1$ and a primal feasible $\bar x$ has $f(\bar x)=0.5$. Then $f(\bar x)-f(x^*)\le1.5$.

  1. (a) True
  2. (b) False
Show answer

True. $-1\le f^*$, so $f(\bar x)-f^*\le0.5+1$.

T2 2025 final 1(n)T/F

The dual problem of a quadratic programming problem is another quadratic program.

  1. (a) True
  2. (b) False
Show answer

True (rule 2 gives a concave quadratic in the multipliers, e.g. MT3 2026 Q6; with a singular Hessian an extra linear equality constraint appears, still a QP).

T3 2025 final 1(o)T/F

If strong duality holds then the primal and dual are both feasible.

  1. (a) True
  2. (b) False
Show answer

True (his key), reading strong duality as equal finite optimal values.

T4 2025 final 1(s)T/F

Linear programming problems always have a global minimum.

  1. (a) True
  2. (b) False
Show answer

False. They can be unbounded (2025 Q5) or infeasible.

T5 2025 final 1(t)T/F

The BFS recovered from the simplex algorithm may not be a KKT point.

  1. (a) True
  2. (b) False
Show answer

False. At termination $r\ge0$ gives $\lambda=c-A^\top\mu\ge0$ with $\lambda_B=0$: KKT.

T6 New T/FT/F

If the dual of an LP is infeasible, the primal is unbounded.

  1. (a) True
  2. (b) False
Show answer

False. Both can be infeasible. (It's true if the primal is feasible.)

T7 New T/FT/F

The dual function of a non-convex problem can be non-concave.

  1. (a) True
  2. (b) False
Show answer

False. It is always concave (minimum of affine functions).

T8 New T/FT/F

In the simplex method, if every entry of $\hat a_l=B^{-1}a_l$ is positive for the entering variable, the LP is unbounded.

  1. (a) True
  2. (b) False
Show answer

False. Unbounded when no entry is positive ($\hat a_l\le0$); positive entries give a ratio test.

T9 New T/FT/F

Strong duality for LPs requires Slater's condition.

  1. (a) True
  2. (b) False
Show answer

False. A finite optimum on either side is enough.

P1 2020 final P2 Q3 (10 marks)Descriptive

$\min x_1+x_2$ s.t. $x_1+2x_2\le4$, $x_2\le1$, $x\ge0$. (a) Standard form ($A,b,c$). (b) Basis and BFS where both constraints are active. (c) Is it optimal? (d) One simplex pivot: entering and leaving variables.

Show answer
  1. (a) Variables $(x_1,x_2,s_1,s_2)$: $A=\begin{pmatrix}1&2&1&0\\0&1&0&1\end{pmatrix}$, $b=(4,1)$, $c=(1,1,0,0)$.
  2. (b) Both active ⇒ $s_1=s_2=0$: basis $\{x_1,x_2\}$, $B=\begin{pmatrix}1&2\\0&1\end{pmatrix}$, $x_B=B^{-1}b=(2,1)$: BFS $(2,1,0,0)$, cost 3.
  3. (c) $B^{-1}=\begin{pmatrix}1&-2\\0&1\end{pmatrix}$, $\mu^\top=c_B^\top B^{-1}=(1,-1)$. Reduced costs: $s_1$: $0-1=-1$; $s_2$: $0-(-1)=1$. $r_{s_1}<0$: not optimal.
  4. (d) $s_1$ enters; $\hat a=B^{-1}e_1=(1,0)$, $\hat b=(2,1)$: ratio $2/1$ in row 1: $x_1$ leaves. New BFS $(0,1,2,0)$, cost 1. (One more pivot, $s_2$ in and $x_2$ out, reaches the optimum $x=0$, cost 0.)
P2 2017 final Q7 (15 marks), simplex theoryDescriptive

(Paraphrased from the scan.) Standard form LP, basis $B$, $x^0=(B^{-1}b,0)$. (b) The next iterate is $x^1=x^0+\alpha u$: state the descent direction $u$ identified in the iteration and give reasons. (c) If all elements of $u$ are positive, what can you conclude about optimality? (d) $(x^*,\lambda^*)$ is a KKT point; determine $\lambda^*$ from the simplex algorithm.

Show answer
  1. (a) $Ax^0=BB^{-1}b+N\cdot0=b$; it uses $m$ independent columns; feasible iff $x_B\ge0$.
  2. (b) $u=(-B^{-1}a_l,\,e_l)$ in $(x_B,x_N)$ coordinates ($d$ components), for an $l$ with $r_l<0$. $Au=-a_l+a_l=0$, so $x^0+\alpha u$ stays on $Ax=b$, and the cost changes at rate $c^\top u=r_l<0$: a descent direction.
  3. (c) "All elements of $u$ $\ge0$" means $-B^{-1}a_l\ge0$: then $x^0+\alpha u\ge0$ for every $\alpha\ge0$ while the cost falls at rate $r_l<0$: the LP is unbounded, no optimum.
  4. (d) $\lambda^*=B^{-\top}c_B$, i.e. $\lambda^{*\top}=c_B^\top B^{-1}$; $A^\top\lambda^*\le c$ because all reduced costs are $\ge0$, and $b^\top\lambda^*=c_B^\top x_B$.
P3 2020 MT3 Q1(d), (e)MCQ

(d) $\max5x_1+2x_2$ s.t. $x_1+x_2\le3$, $2x_1+3x_2\ge5$, $x\ge0$: optimal pair A. $x=(3,1)$, $y=(4,1)$; B. $x=(4,1)$, $y=(1,0)$; C. $x=(3,0)$, $y=(5,0)$; D. none. (e) Optimal value of the dual of $\max2x_1+x_2+3x_3$ s.t. $x_1-x_2+x_3\ge5$, $x\ge0$: A. $-1$; B. $-3$; C. none of the above; D. $-5$.

Show answer

(No official key; my working.) (d) C: $x=(3,0)$ gives $15$; dual $\min3y_1-5y_2$ s.t. $y_1-2y_2\ge5$, $y_1-3y_2\ge2$, $y\ge0$ at $(5,0)$ gives $15$. A and B are infeasible. (e) C: the primal is unbounded ($x_1\to\infty$), so the dual is infeasible.

N1 New, 2025-styleDescriptive

Write the dual of $\max x_1+2x_2$ s.t. $x_1+x_2\le4$, $x_1-x_2\ge-2$, $x_1\ge0$, $x_2$ free.

Show answer

As a min: $\min-x_1-2x_2$. Using the table (constraints written as $\ge$: $-x_1-x_2\ge-4$, $x_1-x_2\ge-2$): dual $\max-4y_1-2y_2$ s.t. $-y_1+y_2\le-1$ (for $x_1\ge0$), $-y_1-y_2=-2$ (for $x_2$ free), $y\ge0$. Solution $y=(\frac32,\frac12)$, value $-7$; primal optimum $(1,3)$, max value $7$ (min value $-7$). Equal.

Self-test (no looking)

S1

Define the dual function and its domain; state weak duality.

Show answer

$t(\lambda,\mu)=\min_x\mathcal L$; domain = where finite; $\lambda\ge0$ and in the domain = dual feasible; $t\le f(x)$ for all feasible $x$.

S2

The LP dual pair in standard form, and the four-row correspondence table.

Show answer

$\min c^\top x$, $Ax=b$, $x\ge0$ ↔ $\max b^\top\mu$, $A^\top\mu\le c$. Equality ↔ free; $\ge$ ↔ $\ge0$; $x\ge0$ ↔ $\le$; free ↔ equality.

S3

Reduced cost formula, optimality test, ratio test, unbounded test.

Show answer

$r_j=c_j-c_B^\top B^{-1}a_j$; optimal iff all $r_j\ge0$; $\bar\alpha=\min\{\hat b_i/\hat a_{il}:\hat a_{il}>0\}$; unbounded iff $r_l<0$ and $\hat a_l\le0$.

S4

Dual of $\min\frac12x^\top Qx$ on the unit ball: $t$, domain, $d^*$.

Show answer

$t=-\lambda$ on $\lambda\ge-\lambda_{\min}/2$; $d^*=\min(0,\lambda_{\min}/2)$, attained by an eigenvector.

Summary card

M6 · Duality, LP, simplex on one card
  • $\mathcal L=f-\sum\lambda_ig_i+\sum\mu_jh_j$; $t=\min_x\mathcal L$ (concave); domain = finite; dual: $\max t$, $\lambda\ge0$.
  • Linear in $x$: coefficient $=0$ (dual equality). Quadratic: $M\succeq0$ domain, value $-\frac12v^\top M^{-1}v$.
  • Weak: $t\le f$; gap estimate $f(\bar x)-p^*\le f(\bar x)-t$. Strong: LP (finite), convex + Slater, or exhibit $x$ with $f=d^*$. Then KKT; recover $x$ by minimising $\mathcal L$.
  • Ball: $t=-\lambda$ on $\lambda\ge-\lambda_{\min}/2$, $p^*=d^*=\min(0,\lambda_{\min}/2)$. MT3 2026 Q6: $t=b^\top\mu-\frac12\|h+A^\top\mu\|^2$.
  • LP: $\min c^\top x$, $Ax=b$, $x\ge0$ ↔ $\max b^\top\mu$, $A^\top\mu\le c$. $Ax\ge b,x\ge0$ ↔ $A^\top y\le c,y\ge0$. Table: eq↔free, ≥↔≥0, x≥0↔≤, free↔eq.
  • Theorem: finite optimum ⇒ equal values; unbounded ⇒ other infeasible; both infeasible possible.
  • BFS $=(B^{-1}b,0)\ge0$ = corner; optimal BFS exists if an optimum exists.
  • Simplex: $r_j=c_j-c_B^\top B^{-1}a_j$; all $\ge0$ optimal; enter $r_l<0$; $x_B=\hat b-\alpha\hat a_l$; ratio $\min\hat b_i/\hat a_{il}$ over $\hat a_{il}>0$; none positive ⇒ unbounded; $\bar\alpha=0$ degenerate; dual $\mu^\top=c_B^\top B^{-1}$.