In this part we will cover the Simplex method, which is a very efficient method for solving Linear Programs (LPs) in practice.
Firstly, let’s recap the setting we are working with.
Recall (Linear Program on Standard Form)
An LP on standard form is,
minsubject tocTxAx=bx≥0
where A∈Rm×n, b∈Rm, c∈Rn and x∈Rn.
Note
We will also assume that rank(A)=m,m≤n and b≥0.
Recall (Basic Feasible Solution)
Recall the standard form polyhedron P={x∈Rn∣Ax=b,x≥0}.
A point xˉ is called a basic feasible solution (BFS), if,
xˉ is a basic solution, i.e., Axˉ=b and the columns of A corresponding to the non-zero components of xˉ are linearly independent,
xˉ≥0
Note
A BFS is a point in the feasible region (polyhedron) P.
The Simplex Method
We will now introduce the Simplex method, which consists of four steps.
Algorithm (The Simplex Method)
Determine if the current BFS is optimal. If it is, stop.
If it is not optimal, find a search direction d to an adjacent BFS that decreases the objective function (adjacent and descent).
Determine the step length θ to the adjacent BFS in the direction d.
Update to the new BFS x+θd and go to step 1.
We will now go through each step in detail, however, we will go in the order (2), (1), (3), (4), you will see why soon.
Step 2: Finding an Adjacent Descent Direction
Given our assumption from (1), we know that we are currently at a BFS xˉ=[xˉBxˉN] and A=[BN].
Thus, we can anagogously partition our wanted search direction d=[dBdN].
As we discussed last time, two BFSs are adjacent if all but one column in their corresponding basis matrices are the same.
Thus, we can partition dN such that,
dN=ej=0⋮1⋮0
where the 1 is in the j-th position, j∈{1,…,n−m}, i.e., we are only changing one non-basic variable.
However, dB is unknown, but we can find it by using the equality constraint,
Recall that we want x≥0, thus we need to ensure that both xˉB−θB−1Nej≥0 and xˉN+θej≥0.
We know by definition of a BFS that xˉB≥0 and xˉN=0, thus the second condition is satisfied for any θ≥0.
The first condition however can cause problems, if −B−1Nej≤0, then we can increase θ indefinitely and still satisfy the condition, i.e., the LP is unbounded!
If −B−1Nej≤0, then we can find at least one component i such that (−B−1Nej)i>0, and thus we can increase θ until the i-th component of xˉB−θB−1Nej is zero.
Definition 3 (Minimum Ratio Test)θ⋆=k:(B−1Nej)k>0min(B−1Nej)k(B−1b)kNote
We note that the index k that attains the minimum is interesting.
This index k tells us which basic variable will become non-basic in the next iteration, i.e., which column of B will be replaced by the j-th column of N.
Step 4: Update to the New BFS
We now have everything we need to perform the update to the new BFS.
Definition 4 (Simplex Update)
Assume that we have a search direction d from (2) and a step length θ⋆ from (3), then the new BFS is,
xˉnew=xˉ+θ⋆d
Similarly, we can update the basis matrix B by,
B~−1b,
where B~ is the basis matrix obtained by replacing the k-th column of B with the j-th column of N, where k is the index that attains the minimum in the minimum ratio test.
Let’s now formally write out the Simplex method.
Algorithm (The Simplex Method)
Let xˉ be a initial BFS, corresponding to the partitioning A=[BN].
Compute the reduced costs cN~T=cNT−cBTB−1N.
If cN~T≥0, stop, xˉ is optimal.
Else, choose j∈k:(cN~)k<0argmin(cN~)k.
Compute the search direction d=[−B−1Nejej].
If −B−1Nej≤0, stop, the LP is unbounded.
Compute the step length θ⋆=k:(B−1Nej)k>0min(B−1Nej)k(B−1b)k.
Update to the new BFS xˉnew=xˉ+θ⋆d and update the basis matrix B by replacing the k-th column of B with the j-th column of N, where k is the index that attains the minimum in the minimum ratio test.
Repeat from step 2.
We will now state a theorem regarding the convergence of the Simplex method and prove it.
Theorem 2 (Finite Termination of the Simplex Method)
If P is nonempty and there is no degeneracy, then the Simplex method terminates in a finite number of iterations with an optimal solution or with the conclusion that the problem is unbounded.
Proof
If a BFS is non-degenerate, then it has exactly m positive components, and hence a unique basis matrix.
We know that if the search direction is unbounded, then the LP is unbounded and terminates.
Otherwise, the basis is either optimal or θ⋆>0.
Therefore, in each iteration, the objective function is strictly decreased.
Hence, no BFS can be revisited, and since there is a finite number of BFSs, the method must terminate in a finite number of iterations.
Note
Remember that there are (mn) possible basis matrices, thus at most (mn) iterations, i.e., the worst-case complexity is exponential in n and m.
Initial BFS and Phase-I problem
We have now covered the Simplex method, however, we have not discussed how to find an initial BFS.
If we are lucky and have an LP of the form,
minsubject tocxTx+cyTyAx+Iy=bx,y≥0
We can let (x=0,y=b)T be our initial BFS, with basis matrix B=I.
However, in general, we will not be this lucky, but we can construct an auxiliary LP, called the Phase-I problem, to find an initial BFS.
Definition 5 (Phase-I Problem)
Given an LP on standard form, we can construct the Phase-I problem,
minsubject to1TyAx+Iy=bx,y≥0
where 1=[11…1]T∈Rm and y∈Rm are artificial variables.
Note
The Phase-I problem always has an initial BFS, namely (x=0,y=b)T, with basis matrix B=I.
Further, the Phase-I problem is always feasible.
If the optimal value of the Phase-I problem is zero, then the original LP is feasible,
If the optimal value of the Phase-I problem is positive, then the original LP is infeasible.
Since cN~T≥0, we are not optimal, and we can choose j=1, i.e., the first nonbasic variable, (xN)1=x2 is the incoming variable.
Outgoing variable,
B−1Ne1=[2123]≤0
Thus, it is not unbounded, and we can use the minimum ratio test,