Explaining the simplex algorithm

(non-examinable)

Interpretation of reduced costs open_in_new

Let $\v x$ be a basic feasible solution with basic variables $B(1), B(2), \ldots, B(m)$. The idea is that when $A\v y=\v b$, $m$ of the variables $\v y$ can be expressed in terms of the other $(n-m)$ variables, so there are multiple ways to write $\v c^T \v y$.

Let $\set{N(1), N(2), \ldots, N(n-m)} = \set{1,2,\ldots,n} \setminus \set{B(1), B(2), \ldots, B(m)}$. For a vector $\v u$, denote $\v u_B = (u_{B(1)}, u_{B(2)}, \ldots, u_{B(m)})$ and $\v u_N=(u_{N(1)}, u_{N(2)}, \ldots, u_{N(n-m)})$. Similarly for matrices, use this notation to extract the corresponding columns, e.g. $B = A_B$.

For any feasible $\v y$, we express $\v y_B$ in terms of $\v y_N$: $$ \begin{align*} \v b &= A\v y \\ &= A_{B} \v y_B + A_N \v y_N \\ \v y_B &= B\inv(\v b - A_N\v y_N). \end{align*} $$ Then the objective function is $$ \begin{align*} \v c^T \v y &= \v c_B^T \v y_B + \v c_N^T \v y_N \\ &= \v c_B^T B\inv (\v b - A_N \v y_N) + \v c_N^T \v y_N \\ &= \v c_B^T B\inv \v b + (\v c_N^T - \v c_B^T B\inv A_N) \v y_N \tag{*}\\ &= \v c_B^T B\inv \v b + (\v c^T - \v c_B^T B\inv A) \v y \tag{\dagger}\\ &= \v c_B^T B\inv \v b + \bar{\v c}^T \v y. \end{align*} $$ $(\dagger)$ follows from $(\v c^T - \v c_B^T B\inv A)_B = \v c_B^T - \v c_B^T B\inv A_B = \v c_B^T - \v c_B^T B\inv B = \v 0^T$.

Substituting $\v y = \v x$ into $(*)$, since $\v x_N = \v 0$, we get $\v c^T \v x = \v c_B^T B\inv \v b$, so $$ \begin{align*} \v c^T \v y = \v c^T \v x + \bar{\v c}^T \v y. \end{align*} $$ This gives an interpretation of the reduced costs: deviating from a basic feasible solution $\v x$ to some feasible solution $\v y$ takes an additional cost of $\bar{\v c}^T \v y$.

Entering and exiting the basis open_in_new

Definition (feasible direction) open_in_new

In a linear program, call the feasible set $P$.

At some point $\v x\in P$, a vector $\v d\in\R^n$ is called a feasible direction if there exists some $\theta>0$ such that $\v x+\theta \v d\in P$.

Let $\v x$ be a basic feasible solution with basic indices $B(1), B(2), \ldots, B(m)$. We want to move from $\v x$ to a feasible solution $\v x' =\v x + \theta\v d$ (where $\theta>0$) by making some non-basic variable $x'_j$ positive while keeping all other non-basic variables fixed at 0. We describe this by saying $x_j$ enters the basis.

We insist $d_j = 1$ and $d_i=0$ for all other non-basic indices $i\neq j$. In order for $A\v x' = A(\v x + \theta\v d) = \v b$ to hold, since $A\v x = \v b$, we need $$ \begin{align*} \v 0 = A\v d = \v A_jd_j + A_B \v d_B \implies \v d_B = -B\inv \v A_j. \end{align*} $$ This $\v d$ is called the $j$-th basic direction.

To ensure $\v x'\geq \v 0$, we need $-\theta d_i\leq x_i$ for all $i$. This is automatically satisfied when $d_i \geq 0$. So the range of $\theta$ for a feasible $\v x'$ is $$ \begin{align*} 0 < \theta \leq \min_{i:\ d_i<0}\left(\frac{x_i}{-d_i}\right) = \min_{i=1,2,\ldots,m:\ d_{B(i)}<0} \left(\frac{x_{B(i)}}{-d_{B(i)}}\right). \end{align*} $$

If we require $\v x'$ to be a basic feasible solution, then take $\theta$ to be its upper bound.

Simplex method open_in_new

We are given some basic feasible solution $\v x$.

  1. If the corresponding reduced costs $\bar{\v c}\geq \v 0$, then $\v x$ is optimal.

  2. Otherwise let $j$ be such that $\bar c_j < 0$. Moving in the $j$-th basic direction $\v d$ will reduce cost, since using reduced costs, $$ \begin{align*} \v c^T(\v x+\theta\v d) &= \v c^T\v x + \theta\bar{\v c}^T\v d &&\text{reduced costs} \\ &= \v c^T \v x + \theta \bar c_j d_j &&\bar{\v c}_B = \v 0\\ &< \v c^T \v x &&d_j = 1\text{ and } \bar c_j<0. \end{align*} $$

  3. Compute $\v u :=-\v d_B = B\inv \v A_j$. If $\v u\leq 0$, we can get get an optimal cost of $-\infty$ by moving along $\v d$ indefinitely, and so the algorithm terminates.

  4. Otherwise let $l = 1,2,\ldots,m$ such that $u_l > 0$ and $x_{B(l)}/u_l$ is minimum. Let the minimum value be $\theta^\ast$.

  5. Move to the new basic feasible solution $\v y = \v x + \theta^\ast \v d$ where $y_l = \theta^\ast$, $y_{B(i)} = x_{B(i)} - \theta^\ast u_i$ for $i\neq l$ and other entries are zero.