Unit 6
Unit 6
2. Simplex Method
• Setting up the simplex method
• The algebra of simplex method
• Simplex method in tabular form
(EE3006/3006A)
1. Introduction
Why use simplex method?
Most of real-life linear-programming (LP) problems depend
on many variables;
Graphical method can only solve LP problems with 2 variables;
1
(EE3006/3006A)
Simplex
-> Assumptions
methodofisLPs:
an algebraic procedure;
->
– The underlying
Linearity concepts
implies that of the function
the objective simplexand
method areconstraints
all of the geometric; are
in linear relationship.
-> Understanding these
(Proportionality and geometric
additivity concepts isofvery
are consequences helpful
the linear for
assumption. )
thorough comprehension of their algebraic equivalents.
– Nonnegativity simply means that all decision variables must take positive
or zero values.
– Divisibility means that the optimal values of decision variables may be
fractional depending upon the application.
– Certainty requires that the parameters of LP model are known or can be
accurately estimates.
(EE3006/3006A)
How many batches of each new product should be produced per week to maximize
the profit?
4
2
(EE3006/3006A)
$3K $5K
Mathematical Programming
(EE3006/3006A)
x2 • Constraint boundaries
(0,9)
x1 ≤ 4 • Feasible region
• Edges of the feasible region
3
(EE3006/3006A)
Initialization
(Start from an initial CPF solution)
Is the current
Yes
CPF solution Stop
optimal?
No
Move to a better
adjacent CPF solution
(EE3006/3006A)
4
(EE3006/3006A)
(EE3006/3006A)
10
5
(EE3006/3006A)
2. Simplex Method
2.1 Setting up the simplex method
Augmented standard form
=> Convert inequality constraints to equality constraints by adding slack (or
surplus) variables.
(EE3006/3006A)
x2
Augmented solutions:
(0,9,4,-6,0)
Basic infeasible solution
(2,3,2,6,6)
(4,3,0,6,0)
(0,2,4,8,14)
x1 12
6
(EE3006/3006A)
13
(EE3006/3006A)
subject to x1 +x3 =4
2x2 +x4 = 12
3x1+ 2x2 +x5 = 18
Algebraically, x1 and x4 are chosen as nonbasic variables, and then solve the system of
equations:
x3 = 4 x3 = 4
2x2 = 12 x2 = 6
2x2 + x5 = 18 x5 = 6
Here, (0, 6, 4, 0, 6) is also called as the augmented CPF solution, whose CPF
solution is (0, 6).
14
7
(EE3006/3006A)
Augmented Form
subject to x1 +x3 =4
2x2 +x4 = 12
3x1+ 2x2 +x5 = 18
1 2 1 4
Their nonbasic variables (x1, x2) and (x1, x4) are the same with just one
exception: x2 has been replaced by x4.
15
(EE3006/3006A)
16
8
(EE3006/3006A)
Wyndor Glass
(EE3006/3006A)
Wyndor Glass
• Corresponding Z: 3x1+5x2
18
9
(EE3006/3006A)
Wyndor Glass
19
(EE3006/3006A)
Wyndor Glass
• Keeping the nonbasic variable x1=0, and then one can derive equations:
(1) x1 +x3 =4
(2) 2x2 +x4 = 12 => x2 = (12-x4)/2 => x2 ≤ 6 (minimum)
(3) 3x1+2x2 +x5 = 18 => x2 = (18-x5)/2 => x2 ≤ 9
20
10
(EE3006/3006A)
Step 3 of iteration-1:
• Convert the system of equations to a more proper form
for the new BF solution
• Normalize the coefficient of the entering basic variable (x2) in its own
equation to 1.
• Eliminate the entering basic variable (x2) from all but its own equation
by elementary algebraic operations:
(0) Z- 3x1-5x2 =0 => Z - 3x1 +2.5x4 = 30
(1) x1 +x3 =4 => x1 + x3 =4
(2) 2x2 +x4 = 12 => x2 + 0.5x4 =6
(3) 3x1+2x2 +x5 = 18 => 3x1 - x4 + x 5 = 6
21
(EE3006/3006A)
Wyndor Glass1)
22
11
(EE3006/3006A)
Wyndor Glass1)
23
(EE3006/3006A)
Wyndor Glass1)
• Keeping the nonbasic variable x4=0, and then one can derive equations :
(1) x1 +x3 =4 => x1=4- x3 x1 ≤ 4
(2) x2 +0.5x4 =6
(3) 3x1 - x4 +x5 = 6 x1 = (6-x5 )/3 x1 ≤ 2 (minimum) √
24
12
(EE3006/3006A)
Step 3 of iteration-2:
• Convert the system of equations to a more proper form for the new BF
solution
• Normalize the coefficient of the entering basic variable (x1) in its own
equation to 1.
25
(EE3006/3006A)
Optimality test :
• Are any adjacent BF solutions
better than the current one?
( )
26
13
(EE3006/3006A)
* Example 1:
Use the simplex method in algebraic form to solve the following problem:
Maximize: Z = 5 x1 + 8 x2 + x3,
subject to: x1 + 2 x2 + 3 x3 ≤ 10,
2 x1 + 2 x2 + x3 ≤ 16,
and x1 ≥ 0, x2 ≥ 0, x3 ≥ 0.
Solution:
The augmented form of the problem can be written as:
Maximize: Z = 5 x1 + 8 x2 + x3,
subject to: x1 + 2 x2 + 3 x3 + x4 = 10,
2x1 + 2x2 + x3 + x5 = 16,
and x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, x4 ≥ 0, x5 ≥ 0.
Initialization:
Choose original variables to be nonbasic, i.e. x1=0, x2=0, x3=0.
Then, x4=10, x5=16.
27
(EE3006/3006A)
28
14
(EE3006/3006A)
Because the coefficients of x3, x4, and x5 are negative, current solution is optimal.
Correspondingly, the nonbasic variables x3 = x4 = x5 = 0, the basic variables: x1=6, x2=2,
and Z = 46.
Check: Z = 5×6 + 8×2 + 1×0 = 46.
29
(EE3006/3006A)
30
15
(EE3006/3006A)
Wyndor Glass
x 1 , x 2 , x 3, x 4 , x 5 ≥ 0
z 1 -3 -5 0 0 0 0
x3 0 1 0 1 0 0 4
x4 0 0 2 0 1 0 12
x5 0 3 2 0 0 1 18
31
(EE3006/3006A)
• Iteration 1:
1) Optimality test (every coefficient in row 0 is nonnegative?)
2) Entering basic variable (steepest ascent => most negative coefficient)
– pivot column
Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.
Z 1 -3 -5 0 0 0 0
x3 0 1 0 1 0 0 4
x4 0 0 2 0 1 0 12
x5 0 3 2 0 0 1 18
32
16
(EE3006/3006A)
Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.
Z 1 -3 -5 0 0 0 0
x3 0 1 0 1 0 0 4
x4 0 0 2 0 1 0 12
x5 0 3 2 0 0 1 18
33
(EE3006/3006A)
Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.
Z 1 -3 -5 0 0 0 0
x3 0 1 0 1 0 0 4
(0)
x4 0 0 2 0 1 0 12
x5 0 3 2 0 0 1 18
Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.
Z 1 -3 0 0 0 30
x3 0 1 0 1 0 4
(1)
x2 0 0 1 0 0 6
x5 0 3 0 0 1 6
34
17
(EE3006/3006A)
• Iteration 2:
1) Optimality test (Is every coefficient in the first row nonnegative?)
2) Entering basic variable (most negative coefficient) – pivot column
3) Leaving basic variable (minimum ratio test) – pivot row
Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.
Z 1 -3 0 0 0 30
x3 0 1 0 1 0 4
x2 0 0 1 0 0 6
x5 0 3 0 0 1 6
35
(EE3006/3006A)
Z 1 -3 0 0 0 30
x3 0 1 0 1 0 0 4
(1)
x2 0 0 1 0 0 6
x5 0 3 0 0 -1 1 6
Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.
Z 1 0 0 0 1 36
x3 0 0 0 1 -1/3 2
(2)
x2 0 0 1 0 0 6
x1 0 1 0 0 1/3 2
36 x =6.
Every coefficient in the first row is nonnegative => Optimal solution is Z= 36, when x1=2, 2
18
(EE3006/3006A)
Z 1 -3 -5 0 0 0 0
(0) x3 0 1 0 1 0 0 4
x4 0 0 2 0 1 0 12
x5 0 3 2 0 0 1 18
Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.
Z 1 -3 0 0 0 30
x3 0 1 0 1 0 0 4
(1)
x2 0 0 1 0 0 6
x5 0 3 0 0 -1 1 6
Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.
Z 1 0 0 0 1 36
x3 0 0 0 1 -1/3 2
(2)
x2 0 0 1 0 0 6
x1 0 1 0 0 1/3 2
37
The optimal solution is Z= 36, when x1=2, x2=6. Check: Z=3×2+5×6=36.
(EE3006/3006A)
Classwork 6:
Q1. Use the simplex method in tabular form to solve the following
problem:
Maximize: Z = 2x1+x2-3x3+5x4,
subject to: x1 + 2x2 + 2x3 + 4x4 ≤ 44,
2x1 - x2 + x3 + 2x4 ≤ 8,
4x1- 2x2 + x3 – x4 ≤ 10,
and all variables are nonnegative.
38
19
(EE3006/3006A)
Reference:
1. Frederick s. Hillier and Gerald J. Lieberman,
Introduction to Operations Research, Eighth Edition
McGraw Hill, 2000
Chapter 4. Solving Linear Programming Problems: The Simplex
Method, pp. 103 ~ 121.
39
20