Linear programs
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.
-