Simplex Method (Lec3)
Simplex Method (Lec3)
Chapter 3 ·
equations.
We use simplex method to get extreme (or corner) point
solution.
· Before the simplex algorithm can be used to solve an LP
The Simplex Method problem, it must be converted into standard LP form.
· Two requirements on the standard form LP model
̶ All the constraints are expressed as equations with nonnegative
right-hand side.
̶ All the decision variables are nonnegative.
1 2
5 6
7 8
Simplex Graphical Explanation Simplex Graphical Explanation
· Example: Consider the following LP with two variables. · Algebraically, the solution space of the LP is represented
by the following ݉ = 2 equations and ݊ = 4 variables:
· Maximize
· Subject to
· The basic solutions are determined by setting ݊ - ݉ = 4 -
2 = 2 variables equal to zero and solving for the
remaining ݉ = 2 variables.
9 10
11 12
Simplex Graphical Explanation Simplex Graphical Explanation
· Solution: Consider all combinations in which ݊ - ݉ variables · Blind search can be time consuming (inefficient)
equal zero and solve the resulting equations · Say ݉ = 4 and ݊ = 8, then there are 70 solutions
· The optimum solution is the feasible basic solution (corner · Rather than enumerating all the basic solutions of the LP
point) with the best objective value. problem, the simplex method performs a “smarter” search by
· In the present example, the (maximum) number of corner points investigating only a “select few” of these solutions.
is 4!
2
4
= =6 · The solution space of the LP example is shown in the Figure.
2!(4 - 2)!
· The simplex method always starts at the origin where all the
decision variables ݔj are zero.
· In Figure, point A is the origin (ݔ1 = ݔ2 = 0) and the
associated objective value, ݖ, is zero.
13 14
General description of the simplex algorithm solving an LP in a The Simplex Algorithm Procedure for maximization LPs
maximization problem. Step 1 Convert the LP to standard form.
Step 1 Find a BFS to the LP. We call this BFS the initial BFS. Step 2 Obtain a BFS (if possible) from the standard form.
In general, the most recent BFS will be called current Step 3 Determine whether the current BFS is optimal.
BFS, so at the beginning of the problem, the initial BFS Step 4 If the current BFS is not optimal, determine which
is the current BFS. nonbasic variable should become a basic variable and
Step 2 Determine if the current BFS is an optimal solution. If is which basic variable should become a nonbasic
not, find an adjacent BFS that has a larger z-value. variable to find a BFS with a better objective function
value.
Step 3 Return to step 2, using the new BFS as the current BSF.
Step 5 Use elementary row operations to find a new BFS with
a better objective function value.
17 18
19 20
Simplex Concepts Simplex Concepts
· Concept 4: given a CPF solution, it is much quicker · Instead it simply identifies the rate of improvement in Z that
computationally to gather information about its adjacent CPF would be obtained by moving along the edge. And then
solutions than about other CPF solutions. Therefore, each time chooses to move along the one with largest positive rate of
the simplex method performs an iteration to move from the improvement.
current CPF solution to a better one, it always chooses a CPF · Concept 6: A positive rate of improvement in Z implies that the
solution that is adjacent to the current one. adjacent CPF solution is better than the current one, whereas a
· Concept 5: After the current CPF solution is identified, the negative rate of improvement in Z implies that the adjacent
simplex method examines each of the edges of the feasible CPF solution is worse.
region emanate from this CPF solution. · Therefore, the optimality test consists simply of checking
· Each of these edges leads to an adjacent CPF solution at the whether any of the edges give a positive rate of improvement
other end, but the simplex method doesn’t even take the time to in Z. If none do, then the current CPF solution is optimal.
solve for the adjacent CPF solution.
21 22
23 24
Simplex method in tabular form Simplex method in tabular form
b. Construct the initial simplex tableau 2. Test for optimality:
Case 1: Maximization problem
Basic the current BF solution is optimal if every
X1 … Xn S1 …... Sn A1 …. An RHS
variable
coefficient in the objective function row is
Objective function coefficient nonnegative
Z Z value
in different signs
Case 2: Minimization problem
S b1
the current BF solution is optimal if every
Coefficient of the constraints coefficient in the objective function row is
A bm nonpositive
25 26
27 28
Simplex Method Simplex Method
Example: Reddy Mikks model (All constraints are £) Standard form
Solve the following problem using the simplex method · Maximize z = 5ݔ1+ 4ݔ2 + 0s1 + 0s2 + 0s3 + 0s4
Maximize · Subject to
z = 5ݔ1+ 4ݔ2 6ݔ1 + 4ݔ2 + s1 = 24 Sometimes it is called
the augmented form of
Subject to ݔ1 + 2ݔ2 + s2 =6 the problem because
6ݔ1 + 4ݔ2 £ 24 - ݔ1 + ݔ2 + s3 =1 the original form has
ݔ1 + 2ݔ2 £ 6 ݔ2 + s4 = 2 been augmented by
some supplementary
- ݔ1 + ݔ2 £ 1 ݔ1 , ݔ2, s1, s2, s3 , s4 ³ 0 variables needed to
ݔ2 £ 2 · Write the objective equation as apply the simplex
method
ݔ1 , ݔ2 ³ 0 z - 5ݔ1- 4ݔ2 = 0
29 30
31 32
Optimality Test
By investigating the top row of the initial tableau, we find that there
are some negative numbers. Therefore, the current solution is not
optimal
Basic
ݔ1 ݔ2 s1 s2 s3 s4 RHS Ratio
variables
z -5 -4 0 0 0 0 0
s1 6 4 1 0 0 0 24
s2 1 2 0 1 0 0 6
s3 -1 1 0 0 1 0 1
Graphical interpretation of the simplex method ratios in the Reddy Mikks model
s4 0 1 1 0 0 1 2
33 34
Iteration 1 Iteration 1
Entering
variable
· Step 1: Determine the entering variable by selecting the
Basic
variable with the most negative in the last row. variable
ݔ1 ݔ2 s1 s2 s3 s4 RHS Ratio
Pivot column
35 36
Iteration 1 Iteration 1
Entering
· Step 2: Determining the leaving variable by using the minimum variable
ratio test as following:
Basic
ݔ1 ݔ2 s1 s2 s3 s4 RHS Ratio
Entering variable ݔ1 RHS Ratio variable
Basic variable
(1) (2) (2)¸(1)
z -5 -4 0 0 0 0 0
s1 4
6 24 s1 6 4 1 0 0 0 24 4
Leaving Smallest ratio
s2 1 2 0 1 0 0 6 6
s2 1 6 6
s3 -1 1 Negative, Ignore s3 -1 -1 0 0 1 0 1 -
s4 0 2 Infinity, Ignore s4 0 0 1 0 0 1 2 -
Iteration 1 Iteration 1
· Replace the leaving variable in the Basic column with
the entering variable.
· New pivot row = old pivot row ¸ pivot number
Basic
ݔ1 ݔ2 s1 s2 s3 s4 RHS
variable
z
ݔ1 1 2/3 1/6 0 0 0 4
ݏ2
ݏ3
ݏ4
Note that x1 becomes in the basic
variables list instead of s1 39 40
Iteration 1 Iteration 2
The new basic solution is (ݔ1, ݏ2, ݏ3, ݏ4), and the new tableau becomes Apply the same rules we will obtain this solution:
Solution Solution
The optimum solution can be read from the simplex tableau in the Basic
X1 X2 S1 S2 S3 S4 RHS Ratio
following manner. The optimal values of the variables in the Basic variables
Z -5 -4 0 0 0 0 0
column are given in the right-hand-side column as:
S1 6 4 1 0 0 0 24 4
S2 1 2 0 1 0 0 6 6
S3 -1 1 0 0 1 0 1 -1
S4 0 1 0 0 0 1 2
Z 0 - 2/3 5/6 0 0 0 20
X1 1 2/3 1/6 0 0 0 4 6
S2 0 1 1/3 - 1/6 1 0 0 2 1 1/2
S3 0 1 2/3 1/6 0 1 0 5 3
S4 0 1 0 0 0 1 2 2
Z 0 0 3/4 1/2 0 0 21
X1 1 0 1/4 - 1/2 0 0 3
X2 0 1 - 1/8 3/4 0 0 1 1/2
S3 0 0 3/8 -1 1/4 1 0 2 1/2
S4 0 0 1/8 - 3/4 0 1 1/2
43 44
Summary of the Simplex Method Simplex Method Steps
· In minimization problems, the optimality condition calls for · Determine a starting basic feasible solution.
selecting the entering variable as the nonbasic variable with the · Select an entering variable using the optimality condition. Stop if
most positive there is no entering variable.
· Optimality condition: The entering variable in a maximization · Select a leaving variable using the feasibility condition.
(minimization) problem is the nonbasic variable with the most
· Determine the new basic solution by using the appropriate Gauss
negative (positive) coefficient in the z-row. Ties are broken
Jordan operations:
arbitrarily.
· The optimum is reached at the iteration where all the z-row
coefficients are nonnegative (nonpositive).
· Feasibility Condition: for both the maximum and minimum
problems the leaving variables is the basic variables associated
with the smallest non-negative ratio. Ties are broken arbitrarily · Go to step 1.
45 46