The Simplex Algorithm

Author: Aster Santana, Andrea Rujano.

Consider the following linear program (LP) in standard form:

mincTxs.t.Ax=bx0. where A is a m×n matrix and b,c and x are vectors of appropriate length. Suppose that the rows of A are linearly independent (which implies that nm, i.e., the LP has more variables than constraints).
We rewrite the LP above by decomposing the decision variables between basic and non-basic variables. Let B and N be the set of indices of the basic and non-basic variables, respectively, where B has m elements and N has nm elements. Then we write x as follows: x=[xBxN].
Similarly, we decompose c and A as follows: c=[cBcN],A=[ABAN].
Now we rewrite the problem as follows: mincTBxB+cTNxNs.t.ABxB+ANxN=bxB,xN0.
Since we have assumed that the rows of A are linearly independent, we know that AB is an invertible matrix. Therefore, we can rewrite the constraints as follows: ABxB+ANxN=bABxB=bANxNxB=A1B(bANxN)xB=A1BbA1BANxN.
By using this expression for xB, the objective function can be re-written as: cTBxB+cTNxN=cTB(A1BbA1BANxN)+cTNxN=cTBA1BbcTBA1BANxN+cTNxN=cTBA1Bb(cTBA1BAN+cTN)xN=cTBA1Bb+(cTNcTBA1BAN)xN.
The problem now becomes: mincTBA1Bb+(cTNcTBA1BAN)xNs.t.xB=A1BbA1BANxNxB,xN0.
At any iteration of the simplex method, the non-basic variables are set to zero, i.e., xN=0. As a result, the values of the basic variables are given by xB=A1Bb. And the objective value is given by cTBA1Bb.

To perform a simplex iteration (which is called a pivoting), we attempt to increase one of the non-basic variables from zero. But which one should we choose?

To answer this question, we re-write the problem using summation notation:

mincTBA1Bb+jN(cjcTBA1BAj)xjs.t.xB=A1BbjNA1BAjxjxB0,xj0,jN.
From here, it’s easy to see that it only makes sense to increase from zero a non-basic variable xj if its coefficient cjcTBA1BAj is negative. This coefficient is called the reduced cost of xj. In fact, if the reduced cost of xj is negative, then increasing xj will decrease the objective value, which is desirable since this is a minimization problem. On the other hand, if the reduced cost of every non-basic variable is non-negative, we conclude that the current solution is optimal.
Now that we have a way to decide which non-basic variables can be made a basic variable (i.e., pick one with negative reduced cost), suppose x1 is non-basic and has a negative reduced cost. From an optimization perspective, we want to increase x1 as much as possible. What can stop us from increasing x1 indefinitely?
The answer comes from the expression xB=A1BbjNA1BAjxj. Which is the same as xB=A1BbA1BA1x1 since xj=0 for all jN such that j1.
Therefore, if the vector A1BA1 has any positive component, as we increase x1 the corresponding basic variables on the right-hand-side will decrease, and eventually, one of them will reach zero and become a non-basic variable! If we were to keep increasing x1, then some basic variables would become negative, which is not allowed as all variables must be non-negative. This completes one iteration of the simplex method.
 

If you have any questions, comments, or would like to chat more about this topic, just reach out to us.