Lagrange multiplier method

Let $\mathcal{X}\subseteq \R^n$, $f: \mathcal{X}\to\R$, and $h: \R^n \to\R^m$.

Problem

$$ \begin{align*} \text{Minimise } & f(\v x) \\ \text{over } & \v x\in\mathcal{X} \\ \text{subject to } & h(\v x) = \v b. \end{align*} $$

We can transform this constrained optimisation problem to an unconstrained one:

Problem

$$ \begin{align*} \text{Minimise } & L(\v x, \lambda) = f(\v x) - \v \lambda^T(h(\v x) - \v b), \quad \text{the ``Lagrangian"}, \\ \text{over } &\v x\in\mathcal{X}. \\ \end{align*} $$

This gives a penalty of $-\v \lambda^T$ per unit of constraint violation.

Theorem (Lagrange sufficiency) open_in_new

Let $\v x^\ast \in \mathcal{X}$ and $\v \lambda^\ast \in\R^m$.

If $\v x^\ast$ is a minimiser of $L(\v x,\v \lambda^\ast)$ and $h(\v x^\ast) = \v b$, then $\v x^\ast$ is a minimiser of $f(\v x)$ subject to $h(\v x) = \v b$.

More precisely, let $\mathcal{X}(\v b) = \sb{\v x\in\mathcal{X}}{h(\v x) = \v b}$. If $$ \begin{align*} L(\v x^\ast, \v \lambda^\ast) = \min_{\v x\in\mathcal{X}} L(\v x, \v \lambda^\ast)\quad \text{and}\quad h(\v x^\ast) = \v b, \end{align*} $$ then $$ \begin{align*} f(\v x^\ast) = \min_{\v x\in\mathcal{X}(\v b)} f(\v x). \end{align*} $$

Proof

Note that this is just a sufficient condition, not a necessary one.

Strategy using Lagrange sufficiency theorem open_in_new

To solve

Problem

$$ \begin{align*} \text{Minimise } &f(\v x) \\ \text{over } &\v x\in\mathcal{X} \\ \text{subject to } &h(\v x) \leq \v b, \end{align*} $$

  1. Add a slack variable to change the inequality constraint to an equality:

Problem

$$ \begin{align*} \text{Minimise } &f(\v x) \\ \text{over } &\v x\in\mathcal{X}, \\ &\v s\in\R^m, \v s\geq 0 \\ \text{subject to } &h(\v x) + \v s = \v b. \end{align*} $$

  1. Set the Lagrangian $$ \begin{align*} L(\v x,\v s,\v \lambda) = f(\v x) - \v \lambda^T (h(\v x) + \v s - \v b). \end{align*} $$

  2. Find $$ \begin{align*} \Lambda = \sb{\v \lambda\in\R^m}{\inf_{\v x\in\mathcal{X},\ \v s\geq 0} L(\v x,\v s,\v \lambda) > -\infty}. \end{align*} $$

  3. For each $\v \lambda\in\Lambda$, find the minimiser $\v x^\ast(\v \lambda), \v s^\ast(\v \lambda)$, i.e. $$ \begin{align*} L(\v x^\ast(\v \lambda), \v s^\ast(\v \lambda), \v \lambda) = \inf_{x\in\mathcal{X},\ \v s\geq 0} L(\v x,\v s,\v \lambda). \end{align*} $$

  4. Find $\v \lambda^\ast$ such that $(\v x^\ast(\v \lambda^\ast), \v s^\ast(\v \lambda^\ast))$ is feasible, i.e. $\v x^\ast(\v \lambda^\ast)\in\mathcal{X}$, $\v s^\ast(\v \lambda^\ast)\geq 0$, and $h(\v x^\ast(\v \lambda)) + \v s^\ast(\v \lambda^\ast) = \v b$.

  5. By Lagrange sufficiency theorem, $\v x^\ast(\v \lambda^{\ast})$ is optimal for the original constrained problem.

Example

Theorem (complementary slackness) open_in_new

Using the notation here, let $\v \lambda\in\Lambda$ and $\v x^\ast, \v s^\ast$ such that $$ \begin{align*} L(\v x^\ast, \v s^\ast, \v \lambda) = \inf_{\v x\in\mathcal{X},\ \v s\geq 0} L(\v x,\v s,\v \lambda). \end{align*} $$

Then for any $i=1,2,\ldots,m$, $$ \begin{align*} \begin{cases} \lambda_i = 0, \\ (h(\v x^\ast))_i \leq b_i, \end{cases} \quad \text{or} \quad \begin{cases} \lambda_i < 0, \\ (h(\v x^\ast))_i = b_i. \end{cases} \end{align*} $$

Proof

Example