Linear programs

Definition (linear program) open_in_new

A linear program is an optimisation problem where the objective function and constraints are all linear, i.e. one in the form

Problem

$$ \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*} $$

Definition (linear program in general form) open_in_new

The general form of a linear program is

Problem

$$ \begin{align*} \text{Minimise } & \v c^T \v x \\ \text{subject to } & A\v x \leq \v b. \end{align*} $$

Definition (linear program in standard form) open_in_new

The standard form of a linear program is

Problem

$$ \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)

Maxima of convex functions open_in_new

Definition (extreme point of a convex set) open_in_new

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*} $$

Theorem (maximum of a convex function) open_in_new

Let $f$ be a convex function on a bounded convex set $C$.

$f$ attains its maximum at an extreme point of $C$.

Proof

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.

Basic solutions and basic feasible solutions open_in_new

Consider a standard form linear program, with $A$ being an $m\times n$ matrix.

Notation (rows and columns of a matrix) open_in_new

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).

Definition (basic solution, basic feasible solution) open_in_new

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$.

Constructing basic solutions open_in_new

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$.

Theorem (basic feasible solution iff extreme point) open_in_new

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}$.

Proof

Duality in linear programming open_in_new

Theorem (linear programs satisfy strong duality) open_in_new

A linear program that is bounded and feasible satisfies strong duality.

Proof: linear functions are convex, and convex optimisation problems satsify strong duality.

Theorem (dual problem of a linear program) open_in_new

Let $A$ be a matrix. See here for notation.

For the primal problem

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

Problem

$$ \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*} $$

Proof

Theorem (optimality iff complementary slackness for a linear program) open_in_new

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*} $$

Proof

Definition (reduced cost) open_in_new

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)})$.

Theorem (optimality and reduced cost) open_in_new

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$.

Proof

Simplex algorithm open_in_new

Full tableau implementation open_in_new

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*} $$

  1. Choose a basic feasible solution $\v x$ and compute the full simplex tableau for $\v x$.

  2. Repeat until $\bar{\v c} \geq \v 0$ (then $\v x$ is optimal):

    1. Choose some $j$ such that $\bar c_j < 0$.

    2. 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.

    3. 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.

    4. 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.

Example

Explaining the simplex algorithm (non-examinable)