The Simplex Algorithm
Consider the linear programming problem
Here, A is m x n and has rank n. The vectors
c, b, and x are dimensioned appropriately.
Let ak denote the kth column of A.
Assume we have a subset B of m linearly independent columns of A
such that
.
(P) can be written
The Algorithm (Phase II):
- 1.
- Initialize: Set xB=B-1b, xN=0.
Basics
{indices of variables in xB },
Nonbasics
{indices of variables in xN }.
- 2.
- Calculate reduced costs:
cNT-cBTB-1N.
- 3.
- Check for optimality: If
,
STOP with optimality.
- 4.
- Choose entering variable:
Pick a nonbasic variable xk with
ck-cBTB-1ak<0.
Calculate d:=B-1ak, the column of B-1N corresponding to xk.
- 5.
- Check for unboundedness:
If
STOP with unbounded optimal value.
Ray: xB=-d, xk=1, xj=0 otherwise.
- 6.
- Calculate minimum ratio:
Find
.
- 7.
- Update basic variables and entering variable:
,
.
(Note: for this notation to be correct, it is necessary that the
variables have been ordered so that the basic variables are
the first m variables.
This reordering needs to be done every iteration.)
- 8.
- Choose leaving variable:
Pick a basic variable xj that is equal to zero
and has dj>0 to leave the basis.
- 9.
- Update the set of basic variables:
Basics
Basics
Nonbasics
Nonbasics
Update B and N appropriately.
- 10.
- Loop:
Return to Step 2.
Note: In a practical implementation, only quantities
that are actually needed are calculated, and the quantities
are calculated more efficiently.
For example, the inverse matrix B-1 is never
calculated explicitly.
John E. Mitchell
2006-01-27