Full tableau implementation

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