simplex algorithm


The simplex algorithm is used as part of the simplex method (due to George B. Dantzig) to solve linear programming problems. The algorithmMathworldPlanetmath is applied to a linear programming problem that is in canonical form.

A canonical system of equations has an ordered subset of variables (called the basis) such that for each i, the it⁢h basic variable has a unit coefficient in the it⁢h equation and zero coefficient in the other equations.

As an example x1,…,xr are basic variables in the following system of r equations:

x1 + a1,r+1⁢xr+1+⋯+a1,n⁢xn=b1
x2 + a2,r+1⁢xr+1+⋯+a2,n⁢xn=b2
…
xr + ar,r+1⁢xr+1+⋯+ar,n⁢xn=br

The simplex algorithm is used as one phase of the simplex method.

Suppose that we have a canonical system with basic variables x1,…,xm,-z and we seek to find nonnegative xi i=1,…,n such that z is minimal. That is, we have

xi+∑j=m+1nai⁢j⁢xj = bi i=1,…,m
-z+∑j=m+1ncj⁢xj = -zo

where ai⁢j,bj,cj,zo are constants, and bj≥0,j=1,…,m.

Notice that if we set xm+1=0,…,xn=0 we will have a feasible solution with z=zo.. Hence, any optimal solution will have z≤zo. The algorithm can now be described as follows:

Step 1. Set N={m+1,…,n} and B={1,…,m}. Put cj=0 for j∈B.

Step 2. If there an index j∈N such that cj<0 then choose s∈N such that

cs=minj∈N⁡cj

else stop. The solution is given by xi=0 for i∈N and xi=bi for i∈B, z=zo.

Step 3. If ai⁢s≤0 for all i then stop. The value of z has no lower bound. Else, let brar⁢s=minai⁢s>0⁡biai⁢s. If there is more than one choice for r it does not matter which one is chosen unless bi=0. This is the so-called degenerate case. In this case, one can choose uniformly at random from among those i for which bi=0.

Step 4. (Pivot on ar⁢s). Multiply the rt⁢h equation by 1ar⁢s and for each i=1,…,m, i≠r replace equation i by the sum of equation i and the (replaced) equation r multiplied by -ai⁢s. Replace the equation for z by the sum of the equation for z and the (replaced) equation r multiplied by -cs. Note: The replacement operations of course change the coefficients ai⁢j and cj. As the algorithm proceeds it is of course necessary to use the changed coefficients.

Step 5. (Update B and N) Put s into B and r into N and remove s from N and r from B. Go to step 2.

There are examples where the algorithm does not terminate in a finite number of steps; but if there is non-degeneracy at each iteration, the algorithm will terminate in a finite number of steps.

Title simplex algorithm
Canonical name SimplexAlgorithm
Date of creation 2013-03-22 13:35:21
Last modified on 2013-03-22 13:35:21
Owner Mathprof (13753)
Last modified by Mathprof (13753)
Numerical id 22
Author Mathprof (13753)
Entry type Algorithm
Classification msc 90C05
Synonym simplex method