Simplex Algorithm

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

The Simplex Algorithm

The Simplex Algorithm


Step 1 Initialize the simplex algorithm
a. Apply appropriate transformation on the mathematical model:
- All functional constraints are transformed into equalities subject to the
following table.1
Constraint type Add to the LHS
≤ + si
≥ - si and + Ai
= + Ai
max - The coefficients of artificial variables in the objective function are -M for
vs. maximization problems, +M for minimization problems. The coefficients
min of slack and surplus variables in the objective function are always equal to
zero.
- All added variables (slack, surplus, and artificial variables) are to be added
to the set of non-negativity constraints in the new transformed model.
b. Construct the initial simplex tableau.

Step 2 Read the current solution


a. The value of the variables in the current solution:
- Non-basic variables are all set to 0.
- Basic variables are assigned to the corresponding value in the right hand
side (RHS) column of the simplex tableau.
b. The value of the objective function of the current solution, Z, is given by the
value in the cell located at the intersection of the RHS column and the
objective function row.
c. Test for optimality:
max - For a maximization problem: a solution is optimal if there exist no
vs. negative values in the objective function row (Z-row).
min - For a minimization problem: a solution is optimal if there exist no positive
values in the objective function row.
d. Test for feasibility (only for problems not in the standard form):
- The current solution is feasible if all artificial variables are equal to 0.
- The current solution is infeasible if at least one artificial variable has a
value greater than 0.

1
Note that, +si refers to the ith slack variable, - si refers to the ith surplus variable, and +Ai refers to the ith
artificial variable.

Dr. M. Asaad Elnidani page 1 of 2


The Simplex Algorithm

Step 3 Determine the entering variable (pivot column)


- For a maximization problem: select the variable (column) with the most
max negative corresponding value in the objective function row.
vs.
min - For a minimization problem: select the variable (column) with the most
positive corresponding value in the objective function row.

Step 4 Determine the leaving variable (pivot row)


a. Apply the minimum ratio test by dividing values of the RHS column by
the corresponding strictly positive values1 of the pivot column.
b. The minimum ratio corresponds to the pivot row

Step 5 Calculate the next basic feasible solution


a. calculate values of the corresponding pivot row (CPR)2 using the
following formula:
Pivot Row
CPR 
Pivot Element
b. Calculate values of the remaining rows of the new simplex tableau (the
new solution) using the following formula:
 Correspond ing 
 
New Row  Old Row -  Value in CPR 
 Pivot Column 
 
Alternatively, instead of calculating the new solution one row at a time,
you may also calculate it one cell at a time. You may use this formula:
 Correspond ing  Correspond ing 
  
 Value in  Value in 
 Pivot Column  Pivot Row 
New Value  Old Value -   
Pivot Element

Step 6 Iterate

Go to Step 2.

1
If all entries of the pivot column are non-positive this means that the problem does not have a finite
optimal feasible solution (special case).
2
The corresponding pivot row in the new tableau (the new solution) is the row number of the pivot row of
the current solution.

Dr. M. Asaad Elnidani page 2 of 2

You might also like