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

As we saw in the simplex post, at each iteration it is considered a basis in a form of a matrix AB. This matrix is constructed with a subset of linear independent columns of the matrix A. The construction of this matrix arises two questions:
  1. How can we choose linearly independent columns of A to form the matrix AB?
  2. How can we assure that the vector xB=A1Bb has nonnegative coordinates?
The simplex method requires the linear program (LP) to be in the standard form: a minimization problem with all constraints as equations, nonnegative decision variables, and nonnegative right-hand-side. To transform the LP above into the standard form we add slack variables x3 and x4, to obtain the following: min2x1+x2+0x3+0x4s.t.x1x2+x3=1x1+2x2+x4=4x1,x2,x3,x40.
In this case, A=[11101201],b=[14]. Notice that the rank of A is two, in other words, A has full rank, which is a necessary condition to construct the matrix AB. Also, since A has four columns, we have six possible ways to choose the two columns that will compose the matrix AB.
While we could analyze each of the six combinations for such a small matrix A, this approach would easily become intractable for larger matrices. Also, some of those combinations might not even meet the requirements to compose a basis. For example, some combinations might yield a matrix AB with linearly dependent columns or an infeasible solution (with negative coordinates). To overcome this issue, and at the same time answer the two previous questions, we consider a new problem: Since the rank of A is two, we add two new variables: x5 and x6, and set the cost vector for this new problem as cT=(0,0,0,0,1,1). The result is the following LP: min0x1+0x2+0x3+0x4+x5+x6s.t.x1x2+x3+x5=1x1+2x2+x4+x6=4x1,x2,x3,x4,x5,x60. The objective is to minimize x5 and x6 because any feasible solution to this LP with x5=0 and x6=0 is a feasible solution to the original problem.
The coefficients and right-hand-side of the new LP in matrix form are as follows: A=[111010120101],b=[14]. This new problem is known as Phase I, and it has an obvious basis AB=[A5A6], which is the identity matrix. With this choice of basis, the corresponding solution will be x=(0,0,0,0,1,4). Notice that this solution will always be feasible by construction because the right-hand-side b is always nonnegative when the LP is in standard form.
At this point we have the following: xN=(0,0,0,0)xB=(4,2)cTN=(0,0,0,0)cTB=(1,1). If we evaluate the expression for the reduced cost we obtain: (cTNcTBA1BAN)=(2,1,1,1). All the entries of this vector are negative, which implies that if we increase any of the non-basic variables, then we will get a reduction in the value of the cost function. We can pick any of them. Let's pick the first entry, which corresponds to the non-basic variable x1. This will be the entering variable to the basis.
To choose the leaving variable, we consider the expression: xB=A1BbA1BA1x1=[14][11]x1. Notice that both entries of the vector A1BA1 are positive. Now, if we increase the value of x1 from zero, which entry will become zero first? The answer to this question will tell us the leaving variable. In this case, if we increase x1 up to 1, we obtain: xB=[03]. The first entry become zero first with the minimum value of x1, this entry corresponds to the variable x5, so this is the leaving variable. This step is actually done with the so-called ratio test, which is to take the minimum of the ratios: (A1Bb)i(A1BA1)i,with (A1BA1)i>0.
After this first iteration of the simplex algorithm, we have moved from the basic feasible solution (0,0,0,0,1,4) to the basic feasible solution (1,0,0,0,3).
After repeating this process two more iterations, we reach the solution of the Phase I, which is x=(2,1,0,0,0,0). This corresponds to the feasible point(2,1,0,0) in the original problem, indicating that a basis to start the Simplex Algorithm on the original problem, namely the Phase II, is AB=[A1A2].

Initialization of the Simplex Algorithm

Author: Andrea Rujano.

Let's address these questions with an example: min2x1+x2s.t.x1x21x1+2x24x1,x20.