IB Optimisation
A set $S\subseteq \R^n$ is said to be convex if for every $\v x,\v y\in S$ and $\lambda\in[0,1]$, $$ \begin{align*} \lambda \v x + (1-\lambda) \v y \in S. \end{align*} $$
This means $S$ contains all points on the line segment joined by two points in $S$.
A function $f: S\to\R$ is said to be convex if
-
$S$ is convex; and
-
for all $\v x,\v y\in S$ and $\lambda\in(0,1)$, $$ \begin{align*} f\big(\lambda \v x + (1-\lambda)\v y\big) \leq \lambda f(\v x) + (1-\lambda) f(\v y). \tag{*} \end{align*} $$
This means the graph is always under the secant line between two points.
$f$ said to be strictly convex if strict inequality holds in (*).
An $n\times n$ matrix $A$ is said to be positive semidefinite, denoted as $A\succeq 0$, if $\v x^T A\v x \geq 0$ for all $x\in\R^n$.
We write $A\succeq B$ to mean $A-B\succeq 0$, and $A\preceq B$ to mean $B-A\succeq 0$.
For a twice differentiable function $f:\R^n \to \R$, the Hessian $\nabla^2 f(x)$ is defined to be an $n\times n$ matrix with entrices $$ \begin{align*} \big[\nabla^2 f(x)\big]_{ij} = \frac{\partial^2 f(x)}{\partial x_i x_j}. \end{align*} $$
A twice differentiable function $f: \R^n \to \R$ is convex iff $\nabla^2 f(\v x)$ $\succeq 0$ for all $\v x\in\R^n$.
Let $f: \R^n \to \R$ be convex.
$$ \begin{align*} \text{Minimise } & f(\v x) \\ \text{over } & \v x\in\R^n. \end{align*} $$
A local minimum is a global minimum. The idea is to take steps along $-\nabla f(x)$ direction. Then roughly $$ \begin{align*} f(x - \epsilon\nabla f(x)) \approx f(x) - \epsilon |\nabla f(x)|^2 < f(x). \end{align*} $$
-
For $t=0$, start from an initial point $x_0$.
-
Repeat until some criterion is satisfied: at some $t$,
-
Choose a descent direction $\v v_t$ such that $\nabla f(x_t)^T \v v_t < 0$.
-
Choose a step size $\epsilon_t$.
-
Update $x_{t+1} = x_t + \epsilon_t v_t$.
-
A $\alpha$-strongly convex function cannot change too slowly, and a $\beta$-smooth function cannot change too quickly. This is illustrated in the following theorem:
Let $\v x,\v y\in\R^n$. If $f$ is $\beta$-smooth, then $$ \begin{align*} f(\v y) \leq f(\v x) + \nabla f(\v x)^T (\v y - \v x) + \frac{\beta}{2}|\v x-\v y|^2. \end{align*} $$ If $f$ is $\alpha$-strongly convex, then $$ \begin{align*} f(\v y) \geq f(\v x) + \nabla f(\v x)^T (\v y - \v x) + \frac{\alpha}{2}|\v x - \v y|^2. \end{align*} $$
If $f$ is $\beta$-smooth, then $$ \begin{align*} f\Big(\v x - \frac{1}{\beta}\nabla f(\v x)\Big) \leq f(\v x) - \frac{1}{2\beta}|\nabla f(\v x)|^2 \end{align*} $$
Proof: plug in $\v y = \v x - \frac{1}{\beta}\nabla f(\v x)$ to the previous theorem.
Let $f$ be $\alpha$-strongly convex. Let $p^\ast = \inf_\v x f(\v x)$ be the optimal value.
For any $\v x\in\R^n$, $$ \begin{align*} p^\ast \geq f(\v x) - \frac{1}{2\alpha} |\nabla f(\v x)|^2. \end{align*} $$
If $f$ is $\alpha$-strongly convex and $\beta$-smooth that is minimised at $x^\ast$, then the gradient descent with constant step size $1/\beta$, i.e. $$ \begin{align*} \v x_{t+1} = \v x_t - \frac{1}{\beta}\nabla f(\v x) \end{align*} $$ satisfies $$ \begin{align*} f(\v x_t) - f(x^\ast) \leq \left(1-\frac{\alpha}{\beta}\right)^t (f(\v x_0) - f(\v x^\ast)). \end{align*} $$ A more common but looser bound is $$ \begin{align*} f(\v x_t) - f(x^\ast) \leq e^{-(\alpha/\beta)t}(f(\v x_0) - f(\v x^\ast)). \end{align*} $$
To ensure $f(\v x_t) - f(\v x^\ast) \leq \epsilon$, we need $t = (\beta/\alpha)\log((f(\v x_0) - f(\v x^\ast))/\epsilon)$.
-
The relation $t\sim \log (1/\epsilon)$ is called linear convergence.
-
The ratio $\beta/\alpha > 1$ is called the condition number. The closer it is to 1, the faster the convergence.
The update rule in Newton's method is $$ \begin{align*} \v x_{t+1} = \v x_t - (\nabla^2 f(\v x_t))\inv \nabla f(\v x_t) \end{align*} $$
We approximate using the second-order Taylor expansion $$ \begin{align*} f(\v y) \approx f(\v x_t) + \nabla f(\v x_t)^T (\v y - \v x_t) + \frac{1}{2} (\v y - \v x_t)^T \nabla^2 f(\v x_t) (\v y - \v x_t) \end{align*} $$ and set $\v x_{t+1}$ to minimise the right hand side $$ \begin{align*} \v x_{t+1} = \arg\min_{\v y} \left[f(\v x_t) + \nabla f(\v x_t)^T (\v y - \v x_t) + \frac{1}{2} (\v y - \v x_t)^T \nabla^2 f(\v x_t) (\v y - \v x_t)\right]. \end{align*} $$ Since the second-order approximation is convex, we set the derivative to zero: $$ \begin{align*} 0 &= \nabla f(\v x_t) + \nabla^2 f(\v x_t) (\v y - \v x_t) \\ \v y &= \v x_t - (\nabla^2 f(\v x_t))\inv \nabla f(\v x_t). \end{align*} $$
For $f: \R \to \R$, this is the same as trying to find the root of $f'$ using a linear approximation: $$ \begin{align*} x_{t+1} = x_t - \frac{f'(x_t)}{f''(x_t)}. \end{align*} $$
For some $n\times n$ real matrix $A$, denote $\|A\|$ as the smallest $a\geq 0$ such that $|A\v z| \leq a|\v z|$ for all $\v z\in\R^n$.
Suppose $f$ is a twice-differentiable $\alpha$-strongly convex function for $\alpha>0$, minimised at $x^\ast$.
Suppose further that the Hessian of $f$ is $l$-Lipschitz, i.e. for all $\v x,\v y\in\R^n$, $\|\nabla^2 f(\v x) - \nabla^2 f(\v y)\| \leq l|\v x - \v y|$.
Then Newton's method satisfies $$ \begin{align*} f(x_t) - f(x^\ast) \leq \frac{2\alpha^3}{l^2}\left(\frac{l}{2\alpha^2}|\nabla f(\v x_0)|\right)^{2^{t+1}} \end{align*} $$
You can first do normal gradient descent, and then Newton's method when it is close enough.
Let $f: \R^n\to\R$ be a convex objective function and $f_i: \R^n \to \R$ be linear for $1\leq i\leq m$, i.e. $f_i(\v x) = \v a_i^T \v x - b_i$.
$$ \begin{align*} \text{Minimise } & f(\v x) \\ \text{over } & \v x\in\R^n \\ \text{subject to } & f_i(\v x) \leq 0 \quad\text{for } 1\leq i\leq m. \end{align*} $$
We convert this to an unconstrained problem
$$ \begin{align*} \text{Minimise } & f(\v x) + \sum_{i=1}^{m} \phi(f_i(\v x)) \\ \text{over } & \v x\in\R^n. \end{align*} $$
Often we pick $\phi(x) = -\log(-x)$, the logarithmic barrier function, leading to
$$ \begin{align*} \text{Minimise } & t f(\v x) + \Phi(\v x) \\ \text{over } & \v x\in\R^n \\ \text{where } &\Phi(\v x) = -\sum_{i=1}^{m} \log(-f_i(\v x)). \end{align*} $$
$t>0$ is a parameter to trade-off the relative importance of $f$ and $\Phi$.
This is a convex optimisation problem (Derivation).
-
Find a feasible solution $\v x$ (i.e. satisfying $f_i(\v x)\leq 0$for all $i$) and choose some $t>0$ and $\alpha>1$.
-
Repeat until $t$ is large enough:
-
Compute the minimiser $x^\ast(t)$ of $tf(\v x) + \Phi(\v x)$ using Newton's method with initial point $\v x$.
-
Update $x := x^\ast(t)$ and $t:=\alpha t$.
-
At each $t$ update, the problem is not changed too much, so Newton's method is expected to converge quickly.
Let $\mathcal{X}\subseteq \R^n$, $f: \mathcal{X}\to\R$, and $h: \R^n \to\R^m$.
$$ \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:
$$ \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.
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*} $$
To solve
$$ \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*} $$
-
Add a slack variable to change the inequality constraint to an equality:
$$ \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*} $$
-
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*} $$
-
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*} $$
-
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*} $$
-
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$.
-
By Lagrange sufficiency theorem, $\v x^\ast(\v \lambda^{\ast})$ is optimal for the original constrained problem.
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*} $$
Let $\mathcal{X}\subseteq \R^n$, $f: \mathcal{X}\to\R$, $h: \R^n \to \R^m$, and $\v b\in\R^m$.
For a primal 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*} $$
let the Lagrangian $L(\v x, \v \lambda) = f(\v x) - \lambda^T (h(\v x) - \v b)$ and $\Lambda = \sb{\lambda\in\R^m}{ \min_{x\in\mathcal{X}} L(\v x,\v \lambda)>-\infty}$.
The dual objective function is defined as $$ \begin{align*} g(\v \lambda) = \min_{x\in\mathcal{X}} L(\v x,\v \lambda) \end{align*} $$ and the dual problem is defined as
$$ \begin{align*} \text{Maximise }& g(\v \lambda) \\ \text{over }& \v \lambda\in\Lambda. \end{align*} $$
$g$ is concave, i.e. $-g$ is convex. (Why?) Therefore it is generally easier to solve.
See here for notation.
We say strong duality holds for a problem if $$ \begin{align*} \min_{\v x\in\mathcal{X}(\v b)} f(\v x) = \max_{\v \lambda\in\Lambda} g(\v \lambda). \end{align*} $$
Lagrange method works (almost) corresponds to when strong duality holds. (Why?)
A function $\phi: \R^m \to \R$ is said to have a supporting hyperplane at $\v b\in\R^m$ if there exists some $\v \lambda\in\R^m$ such that for all $\v c\in\R^m$, $$ \begin{align*} \phi(\v c) \geq \phi(\v b) + \lambda^T(\v c - \v b). \end{align*} $$
-
If $\phi: \R^m \to\R$ is differentiable at $\v b$ and has a supporting plane $\v \lambda$ at $\v b$, then $\v \lambda = \nabla\phi(\v b)$. (Proof)
-
$\phi$ is convex iff there exists a supporting hyperplane at every point $\v b\in\R^m$.
See here for notation.
Define the value function $\phi: \R^m \to \R$ as $$ \begin{align*} \phi(\v c) = \min_{\v x\in \mathcal{X}(\v c)} f(\v x) \end{align*} $$ where $\mathcal{X}(\v c) = \sb{\v x\in\mathcal{X}}{h(\v x) = \v c}$.
See here for notation. Let $\v \lambda\in\Lambda$.
Strong duality holds for $\v \lambda$ iff the value function $\phi$ has a supporting hyperplane at $\v b$.
Let $\mathcal{X}\subseteq \R^n$ be a convex set and $f: \R^n \to\R$ and $h_j: \R^n\to\R$ be convex functions for all $j=1,2,\ldots,m$.
Strong duality holds for the optimisation problem
$$ \begin{align*} \text{Minimise }&f(\v x) \\ \text{over } &\v x\in\mathcal{X} \\ \text{subject to }& h_j(\v x) \leq b_j, \quad \forall j = 1,2,\ldots,m \end{align*} $$
A linear program is an optimisation problem where the objective function and constraints are all linear, i.e. one in the form
$$ \begin{align*} \text{Minimise } &\v c^T \v x \\ \text{subject to } & \v a_i^T \v x \geq \v b_i, &&i\in M_1, \\ &\v a_i^T \v x \leq \v b_i, &&i\in M_2, \\ &\v a_i^T \v x = \v b_i, &&i\in M_3, \\ &x_j \geq 0, &&j\in N_1, \\ &x_j \leq 0, &&j\in N_2. \end{align*} $$
The general form of a linear program is
$$ \begin{align*} \text{Minimise } & \v c^T \v x \\ \text{subject to } & A\v x \leq \v b. \end{align*} $$
The standard form of a linear program is
$$ \begin{align*} \text{Minimise } & \v c^T \v x \\ \text{subject to } &A\v x = \v b, \\ &\v x\geq \v 0. \end{align*} $$
Any linear programs can be written in the general form or the standard form. (Derivation)
Let $C$ be a convex set.
A point $\v x\in C$ is said to be an extreme point of $C$ if it cannot be written as a convex combination of two distinct point in $C$, i.e. for $\v y,\v z\in C$ and $t\in(0,1)$, $$ \begin{align*} \v x = t\v y + (1-t)\v z\implies \v y=\v z=\v x. \end{align*} $$
Let $f$ be a convex function on a bounded convex set $C$.
$f$ attains its maximum at an extreme point of $C$.
Since linear programs are convex maximisation problems, if we find all the extreme points of the feasible set, then we can solve any linear programs.
Consider a standard form linear program, with $A$ being an $m\times n$ matrix.
For an $m\times n$ matrix $A$, denote
-
$\v a_1^T, a_2^T, \ldots, \v a_m^T$ the rows of $A$;
-
$\v A_1, \v A_2, \ldots, \v A_n^T$ the columns of $A$.
-
Assumption A: the rows $\v a_i$ of $A$ are linearly independent.
This is WLOG: if rows are linearly independent, we can remove some redundant equality constraints.
Then the rank of $A$ is $m$. Also the row vectors $\v a_i$ are in $\R^n$ so $m\leq n$.
-
Assumption B: every set of $m$ columns of $A$ are linearly independent (and therefore forms a basis).
A point $\v x\in\R^n$ is called a basic solution if $A\v x = \v b$ and $\v x$ has at most $m$ non-zero entries.
$\v x$ is called a basic feasible solution if $\v x$ is a basic solution and $\v x\geq 0$.
Exhaust all possible sets of $m$ indices (all $\pmat{n \\ m}$ subsets of $\set{1,2,\ldots,n}$).
For a particular choice of indices $B(1), B(2), \ldots, B(m) = 1, 2,\ldots,n$, we allow $x_{B(1)}, x_{B(2)}, \ldots, x_{B(m)}$ (the basic variables) to be non-zero (or zero) and insist the rest of $x_i$'s (non-basic variables) to be zero.
We get rid of the zero entrices in $A\v x = \v b$: let $$ \begin{align*} \text{basis matrix } B &= \underbrace{ \pmat{A_{1\,B(1)} & A_{1\,B(2)} & \ldots & A_{1\,B(m)} \\ A_{2\,B(1)} & A_{2\,B(2)} & \ldots & A_{2\,B(m)} \\ \vdots & \vdots & & \vdots \\ A_{m\, B(1)} & A_{m\,B(2)} & \ldots & A_{m\,B(m)}}}_{\text{basic columns}}, \\ \v x_B &= \pmat{x_{B(1)} \\ x_{B(2)} \\ \vdots \\ x_{B(m)}}. \end{align*} $$ Then we get $$ \begin{align*} \v A_{B(1)} x_{B(1)} + \ldots + \v A_{B(m)} x_{B(m)} = B\v x_B = \v b \end{align*} $$
By assumption B, $B$ has rank $m$, so $\v x_B = B\inv \v b$ is the unique solution.
-
Assumption C: all basic feasible solutions have exactly $m$ non-zero entrices, i.e. if $B$$\inv \v b \geq \v 0$, then $B\inv \v b > \v 0$.
A vector $\v x$ is a basic feasible solution of $A\v x = \v b$ iff it is an extreme point of the set $\mathcal{X}(\v b) = \sb{\v x}{A\v x = \v b, \v x\geq\v 0}$.
A linear program that is bounded and feasible satisfies strong duality.
Proof: linear functions are convex, and convex optimisation problems satsify strong duality.
Let $A$ be a matrix. See here for notation.
For the primal problem
$$ \begin{align*} \text{Minimise } & \v c^T \v x \\ \text{subject to } & \v a_i^T \v x \geq b_i, &&i\in M_1, \\ & \v a_i^T \v x \leq b_i, && i\in M_2, \\ & \v a_i^T \v x = b_i, && i\in M_3, \\ & x_j \geq 0, && j\in N_1, \\ & x_j \leq 0, && j\in N_2, \\ & x_j \text{ free}, && j\in N_3, \end{align*} $$
the dual problem is
$$ \begin{align*} \text{Maximise } & \v b^T \v \lambda \\ \text{subject to } & \lambda_i \geq 0, &&i\in M_1, \\ & \lambda_i \leq 0, && i\in M_2, \\ & \lambda_i \text{ free}, && i\in M_3, \\ &\v A_j^T \v \lambda \leq c_j, &&j\in N_1, \\ &\v A_j^T \v \lambda \geq c_j, &&j\in N_2, \\ &\v A_j^T \v \lambda = c_j, &&j\in N_3. \end{align*} $$
For a linear program defined here, let $\v x$ be primal feasible and $\v \lambda$ be dual feasible (i.e. feasible solutions of the primal and feasible problems).
$\v x$ and $\v \lambda$ are optimal for the two respective problems iff complementary slackness holds, i.e. $$ \begin{align*} \lambda_i(\v a_i^T \v x - b_i) &= 0 &&\forall i\in M_1\cup M_2\cup M_3, \\ (c_j - \v A_j^T \v \lambda) x_j &= 0 &&\forall j\in N_1\cup N_2\cup N_3. \end{align*} $$
Consider a linear program in standard form. Let $\v x$ be a basic solution. See here for notation.
the corresponding vector of reduced costs $\bar{\v c}$ is defined as $$ \begin{align*} \bar{\v c}^T = \v c^T - \v c_B^T B\inv A \end{align*} $$ where $\v c_B^T = (c_{B(1)}, c_{B(2)}, \ldots, c_{B(m)})$.
In a standard form linear program, a basic feasible solution $\v x$ is optimal iff the corresponding reduced costs $\bar{\v c} \geq \v 0$.
The simplex tableau is given by $$ \begin{align*} & \begin{array}{|rl|rl|} \hline \text{current costs} & -\v c^T \v x =-\v c_B^T \v x_B & \text{reduced costs vector} & \bar{\v c} \\\hline \text{current BFS} & \v x_B = B\inv \v b & \text{basic directions} &B\inv A \\\hline \end{array} \\ \\ \equiv \quad & \begin{array}{|c|cccc|} \hline -\v c_B^T \v x_B & \bar c_1 & \bar c_2 & \ldots & \bar c_n \\\hline x_{B(1)} & | & | & & | \\ \vdots & B\inv \v A_1 & B\inv \v A_2 & \ldots & B\inv \v A_n \\ x_{B(m)} & | & | & & | \\\hline \end{array} \end{align*} $$
-
Choose a basic feasible solution $\v x$ and compute the full simplex tableau for $\v x$.
-
Repeat until $\bar{\v c} \geq \v 0$ (then $\v x$ is optimal):
-
Choose some $j$ such that $\bar c_j < 0$.
-
Consider the $j$-th column $u = B\inv A_j$ (pivot column). If no entry of $u$ is positive, then the optimal cost is $-\infty$ and we are done.
-
For each $i$ such that $u_i > 0$, compute $x_B(i)/u_i$. Let $l$ be the row index such that this ratio is minimised.
-
To make column $A_{B(l)}$ exit the basis and $A_j$ enter the basis, add to each row of the tableau a multiple of the $l$-th row (pivot row) so that $u_l$ (pivot element) becomes 1 and all other entries of the pivot column are 0.
-
Player 1 (P1) has $m$ choices of actions labelled $1,2,\ldots,m$, and player 2 (P2) has $n$ choices labelled $1,2,\ldots,n$.
Let an $m\times n$ matrix $A = (a_{ij})$ be the payoff matrix. If P1 plays $i$ and P2 plays $j$, P1 wins $a_{ij}$ and P2 loses $a_{ij}$.
Suppose P1 plays first. If P1 plays $i$, P2 will make the optimal choice to let P1 win $\min_{j\in\set{1,2,\ldots,n}} a_{ij}$. P1's problem is
$$ \begin{align*} \text{Maximise } &\min_{j\in\set{1,2,\ldots,n}} a_{ij} \\ \text{over } &i\in\set{1,2,\ldots,m}. \end{align*} $$
Similarly if P2 plays first, P2's problem is
$$ \begin{align*} \text{Minimise } &\max_{i\in\set{1,2,\ldots,m}} a_{ij} \\ \text{over } &j\in\set{1,2,\ldots,n}. \end{align*} $$
An outcome $(i^\ast, j^\ast)$ of a two-person zero sum game is called a saddle point if $$ \begin{align*} \max_i \min_j a_{ij} = \min_j \max_i a_{ij} \end{align*} $$ and the extrema are attained at $(i^\ast, j^\ast)$.
If the payoff matrix has a saddle point, the players' decisions are the same regardless of who plays first.
We now allow P1 to randomly choose action $i$ with probability $p_i$. P1 picks the distribution $\v p=(p_1,p_2,\ldots,p_m)$ and P2 picks $\v q=(q_1, q_2, \ldots, q_n)$.
If P1 plays $\v p$, P2 will make the optimal choice $j$ to let P1 win $\min_j \sum_i p_i a_{ij}$. P1's problem is
$$ \begin{align*} \text{Maximise } & \min_j \sum_i p_i a_{ij} \\ \text{over } & \v p \in\R^m \\ \text{subject to } & \sum_i p_i = 1, \\ & \v p\geq \v 0, \end{align*} $$
which is equivalent to
$$ \begin{align*} \text{Maximise } & v \\ \text{over } & v\in\R,\ \v p\in\R^m \\ \text{subject to } & A^T \v p \geq v \v e, \\ & \v e^T \v p = 1, \\ & \v p\geq \v 0 \end{align*} $$
where $\v e = (1,1,\ldots,1)^T$.
Similarly P2's problem is
$$ \begin{align*} \text{Minimise } & \max_i \sum_j q_j a_{ij} \\ \text{over } & \v q\in\R^n \\ \text{subject to } & \sum_j q_j = 1, \\ & \v q \geq \v 0, \end{align*} $$
which is equivalent to
$$ \begin{align*} \text{Minimise } & w \\ \text{over } & w\in\R, \ \v q\in\R^n \\ \text{subject to } & A\v q \leq w\v e, \\ & \v e^T \v q = 1, \\ & \v q \geq 0. \end{align*} $$
These two problems are dual of each other. (Derivation)
In a mixed strategy two-person zero sum game, a strategy $\v p\in\R^m$ is optimal for P1 iff there exists $\v q\in\R^n$ and $v\in\R$ such that the following holds:
-
primal feasibility: $A^T \v p \geq v \v e$, $\v e^T \v p=1$ and $\v p\geq \v 0$;
-
dual feasibility: $A\v q\leq v \v e$, $\v e^T \v q = 1$ and $\v q\geq \v 0$; and
-
complementary slackness: $v = \v p^T A \v q$.
Tips for finding optimal strategies:
-
Look for a saddle point of the payoff matrix.
-
Look for dominating actions: if we have rows $i$ and $i'$ with $a_{ij}\geq a_{i'j}$ for all $j$, then P1 will never play $i'$. Similar for columns.
-
Solve the linear program graphically or using the simplex method.
A directed graph is a tuple $G=(V,E)$ where $V$ is the set of vertices and $E\subseteq V\times V$ is a set of ordered edges.
$G$ is called an undirected graph if $E$ is symmetric, i.e. for all $(v,v')\in E$, we have $(v',v)\in E$ as well.
Let a graph $G = (V, E)$ where $V=\set{1,2,\ldots,n}$.
For each edge $(i,j)\in E$, an amount $x_{ij}$ flows from vertex $i$ to vertex $j$. We impose the following constraints:
-
Flow is conserved at each vertex. We fix a vector $\v b\in\R^n$ which indicates the amount of flow $b_i$ that enters a vertex $i$. A vertex with $b_i>0$ is called a source and a vertex with $b_i<0$ is called a sink.
-
$n\times n$ matrices $\underline{M} = (\underline{m}_{ij})$ and $\overline{M} = (\overline{m}_{ij})$ give the lower and upper bounds for the flow $x_{ij}$.
-
$n\times n$ matrices $C = (c_{ij})$ gives the cost per unit flow on the edge $(i,j)$.
$$ \begin{align*} \text{Minimise } & \sum_{(i,j)\in E} c_{ij} x_{ij} \\ \text{subject to } & b_i + \sum_{(j,i)\in E} x_{ji} = \sum_{(i,j)\in E} x_{ij} \quad \forall i\in V, \\ & \underline{m}_{ij} \leq x_{ij} \leq \overline{m}_{ij}. \end{align*} $$
For the problem to be feasible, we require $\sum_{i\in V} b_i = 0$.
We have $n$ suppliers labelled $i=1,2,\ldots,n$, each supplying $s_i$ units of products. There are also $m$ consumers labelled $j=1,2,\ldots,m$, each demanding $d_i$ units of products. Transporting one unit of product from $i$ to $j$ costs $c_{ij}$.
This is a special case of the minimum cost flow problem, with $G$ being a bipartite graph and $E$ only consists of edges from a supplier to a consumer.
$$ \begin{align*} \text{Minimise } &\sum_{(i,j)\in E} c_{ij} x_{ij} \\ \text{subject to } &\sum_{j=1}^{m} x_{ij} = s_i && \forall i=1,2,\ldots,n, \\ &\sum_{i=1}^{n} x_{ij} = d_j && \forall j=1,2,\ldots,m, \\ &x_{ij} \geq 0 &&\forall (i,j)\in E. \end{align*} $$
We can let $E = V\times V$ and set the cost of the non-existent edges to be infinity.
$$ \begin{align*} \text{Minimise } &\sum_{i=1}^{n} \sum_{j=1}^{m} c_{ij} x_{ij} \\ \text{subject to } &\sum_{j=1}^{m} x_{ij} = s_i && \forall i=1,2,\ldots,n, \\ &\sum_{i=1}^{n} x_{ij} = d_j && \forall j=1,2,\ldots,m, \\ &x_{ij} \geq 0 &&\forall (i,j)\in E. \end{align*} $$
Every minimum cost flow problem with finite capacities or non-negative capacities can be recast as an equivalent transport problem.
Consider the transport problem. If for some feasible $x$, we have dual variables $\v \lambda\in\R^n$ (for suppliers) and $\v\mu\in\R^m$ (for consumers) such that the following holds:
-
dual feasibility: $c_{ij}\geq \lambda_i + \mu_j$ for all $i,j$; and
-
complementary slackness: $(c_{ij} - \lambda_i - \mu_j)x_{ij} = 0$,
then $x$ is optimal.
Note that optimality only depends on $\lambda_i + \mu_j$, so WLOG we can assume $\lambda_1 = 0$ by subtracting all $\lambda$ and adding all $\mu$ by $\lambda_1$.
The transport tableau is as follow:
To construct an initial basic feasible solution, we use the northwest corner rule:
-
Start with any edge variable, and increase it until the supply or demand is satisfied.
-
If supply is satisfied, move to the next supplier and repeat step 1.
-
If demand is satisfied, move to the next consumer and repeat step 1.
In a non-degenerate problem, we assume we arrive at a spanning tree $T$, i.e. a connected graph with no cycles. So there are exactly $n+m-1$ edges with positive flow.
We keep updating the current solution:
-
If $c_{ij} \geq \lambda_i + \mu_j$ for all $i,j$, then the current solution is optimal and the algorithm is terminated.
-
Otherwise let $(i,j)$ be such that $c_{ij} < \lambda_i + \mu_j$. By complementary slackness, $x_{ij} = 0$, so $(i,j)\not\in T$. Then $(i,j)$ and those edges in $T$ form a cycle.
-
Along this cycle, increase the flow $x_{ij}$ until some flow in the cycle decreases to zero.
-
Update the dual variables.
Given a graph with a single source (vertex 1) and a single sink (vertex $n$), find the maximum possible flow $\delta$ between the source and the sink subject to capacity constraints.
$$ \begin{align*} \text{Maximise } &\delta \\ \text{subject to } & \sum_{j:\ (i,j)\in E} x_{ij} - \sum_{j:\ (j,i)\in E} x_{ji} = 0 &&\forall i\neq 1,n, \\ & \sum_{j:\ (1,j)\in E} x_{1j} - \sum_{j:\ (j,1)\in E} x_{j1} = \delta, \\ & \sum_{j:\ (n,j)\in E} x_{nj} - \sum_{j:\ (j,n)\in E} x_{jn} = -\delta, \\ & 0 \leq x_{ij} \leq c_{ij} &&\forall (i,j)\in E. \end{align*} $$
A cut of a graph $G = (V,E)$ is a partition of $V$ into $(S, V\setminus S)$.
Let $x$ be a feasible flow of the maximum flow problem with flow $\delta$.
Then for any cut $(S,V\setminus S)$ such that $1\in S$ and $n\in V\setminus S$, we have $\delta\leq c(S)$.
In a graph $G=(V,E)$, a path is defined as a sequence of vertices $(v_1,v_2, \ldots, v_k)$ where each pair of adjacent vertices is connected, i.e. $(v_i, v_{i+1})$ or $(v_{i+1}, v_i) \in E$ for all $i=1,2,\ldots,k-1$.
Let $c_{ij}$ be the capacity of edge $(i,j)\in E$. For a flow $x$, a path is called an augmenting path if a forward edge is not full yet and a backward edge is not zero, i.e. $x_{v_i v_{i+1}} < c_{v_iv_{i+1}}$ when $(v_i, v_{i+1})\in E$ and $x_{v_{i+1} v_i} > 0$ when $(v_{i+1}, v_i)\in E$.
In a maximum flow problem, let $\delta^\ast$ be the optimal value. Then $$ \begin{align*} \delta^\ast = \min\sb{c(S)}{S\subset V,\ 1\in S,\ n\in V\setminus S}. \end{align*} $$
-
Start with a feasible flow, say the zero flow $x=0$.
-
While there exists an augmenting path from $1$ to $n$:
-
Push as much as possible through the path.
-
-
$x$ is now optimal. We can find a cut with capacity equal to the amount of flow.
If the capacity is an integer, the algorithm is guaranteed to terminate. Otherwise it may have infinite steps.