MK 04-05 Linear Programming The Simplex Method
MK 04-05 Linear Programming The Simplex Method
Linear Programming:
The Simplex Method
To accompany
Quantitative Analysis for Management, Tenth Edition,
by Render, Stair, and Hanna
Power Point slides created by Jeff Heyl
Learning Objectives
After completing this chapter, students will be able to:
1. Convert LP constraints to equalities with slack,
2.
3.
4.
5.
6.
92
Chapter Outline
9.1 Introduction
9.2 How to Set Up the Initial Simplex
Solution
9.3 Simplex Solution Procedures
9.4 The Second Simplex Tableau
9.5 Developing the Third Tableau
9.6 Review of Procedures for Solving
LP Maximization Problems
9.7 Surplus and Artificial Variables
2009 Prentice-Hall, Inc.
93
Chapter Outline
9.8
9.9
9.10
9.11
9.12
9.13
94
Introduction
With only two decision variables it is possible to
95
Introduction
Why should we study the simplex method?
It is important to understand the ideas used to
produce solutions
It provides the optimal solution to the decision
variables and the maximum profit (or minimum
cost)
It also provides important economic information
To be able to use computers successfully and to
interpret LP computer printouts, we need to know
what the simplex method is doing and why
96
Chapter 7
This time well use the simplex method to solve
the problem
You may recall
T = number of tables produced
C = number of chairs produced
and
Maximize profit = $70T + $50C
subject to
2T +
1C 100
4T +
3C 240
T, C 0
(objective function)
(painting hours constraint)
(carpentry hours constraint)
(nonnegativity constraint)
2009 Prentice-Hall, Inc.
97
equations
Less-than-or-equal-to constraints () are
converted to equations by adding a slack variable
to each
Slack variables represent unused resources
For the Flair Furniture problem, the slacks are
S1 = slack variable representing unused hours
in the painting department
S2 = slack variable representing unused hours
in the carpentry department
2T + 1C + S1 = 100
4T + 3C + S2 = 240
98
painting capacity
99
constraint equation
Slack variables not actually needed for an
equation have a coefficient of 0
So
2T + 1C + 1S1 + 0S2 = 100
4T + 3C +0S1 + 1S2 = 240
T, C, S1, S2 0
The objective function becomes
9 10
variables
When there are more unknowns than
equations, you have to set some of the
variables equal to 0 and solve for the
others
In this example, two variables must be set
to 0 so we can solve for the other two
A solution found in this manner is called a
basic feasible solution
2009 Prentice-Hall, Inc.
9 11
9 12
100
Number of Chairs
80
B = (0, 80)
2T + 1C 100
60
C = (30, 40)
40
4T + 3C 240
20
(0, 0) A |
0
Figure 9.1
20
D = (50, 0)
|
40
60
80
Number of Tables
9 13
SOLUTION MIX
S1
S2
S1
100
S2
240
9 14
S
co lac
lu k v
m a
ns ria
C
co on
lu sta
m n
n t
bl
es
es
R
co ea
lu l va
m r
ns iab
l
m
ix
P
co rod
lu uc
m ti
n on
P
co rof
lu it p
m e
n r
un
it
Cj
SOLUTION
MIX
$70
T
$50
C
$0
S1
$0
S2
QUANTITY
$0
S1
100
$0
S2
240
Zj
$0
$0
$0
$0
$0
Gross
profit row
Cj - Zj
$70
$50
$0
$0
$0
Profit per
unit row
Constraint
equation rows
Table 9.1
2009 Prentice-Hall, Inc.
9 15
T
C
S1
S2
0
0
100
240
2009 Prentice-Hall, Inc.
9 16
30
40
0
0
2009 Prentice-Hall, Inc.
9 17
9 18
$70
$50
$0
$0
SOLUTION
MIX
S1
S2
QUANTITY
$0
S1
100
$0
S2
240
2009 Prentice-Hall, Inc.
9 19
9 20
9 21
9 22
Cj for column
$70
$50
Zj for column
$70
$50
Cj Zj for column
S1
S2
$0
$0
$0
$0
2009 Prentice-Hall, Inc.
9 23
not optimal
By examining the numbers in the Cj Zj row in
Table 9.1, we can see that the total profits can be
increased by $70 for each unit of T and $50 for
each unit of C
A negative number in the number in the Cj Zj row
would tell us that the profits would decrease if the
corresponding variable were added to the
solution mix
An optimal solution is reached when there are no
positive numbers in the Cj Zj row
2009 Prentice-Hall, Inc.
9 24
9 25
9 26
Number above
or below
pivot number
Corresponding number in
the new row, that is, the
row replaced in step 3
9 27
9 28
Furniture problem
Step 1.
1 Select the variable with the largest positive
Cj - Zj value to enter the solution next. In this case,
variable T with a contribution value of $70.
Cj
$70
SOLUTION
MIX
$50
$0
$0
S1
S2
QUANTITY
(RHS)
$0
S1
100
$0
S2
240
Zj
$0
$0
$0
$0
Cj - Zj
$70
$50
$0
Pivot column
$0
$0
total profit
Table 9.2
2009 Prentice-Hall, Inc.
9 29
9 30
$70
SOLUTION
MIX
$50
$0
$0
QUANTITY
(RHS)
S1
S2
100
240
Pivot row
$0
$0
$0
$50
$0
Pivot column
$0
$0
S1
$0
S2
Zj
$0
Cj - Zj
$70
3
0
Pivot number
$0
Table 9.3
2009 Prentice-Hall, Inc.
9 31
1
0.5
2
1*
0.5
2
0
0
2
100
50
2
Cj
SOLUTION MIX
S1
S2
QUANTITY
$70
0.5
0.5
50
9 32
Number in
= Old S Row
2
Number Below
Pivot Number
Corresponding Number
in the New T Row
(4)
(1)
(4)
(0.5)
(4)
(0.5)
(4)
(0)
40
240
(4)
(50)
Cj
SOLUTION MIX
S1
S2
QUANTITY
$70
0.5
0.5
50
$0
S2
40
2009 Prentice-Hall, Inc.
9 33
9 34
= ($70)(1) + ($0)(0)
= ($70)(0.5) + ($0)(1)
= ($70)(0.5) + ($0)(2)
= ($70)(0) + ($0)(1)
= $70
= $35
= $35
= $0
9 35
Cj for column
$70
$50
Zj for column
$70
$35
S1
S2
$0
$0
$35
$0
$35
$0
Cj Zj for second
column
$0
$15
Completed
simplex
tableau
Cj
$70
SOLUTION
MIX
$50
$0
$0
S1
S2
QUANTITY
(RHS)
$70
0.5
0.5
50
$0
S2
40
Zj
$70
$35
$35
$0
$3,500
Cj - Zj
$0
$15
$35
$0
Table 9.4
9 36
9 37
9 38
9 39
Step 1.
1 Variable C will enter the solution as its Cj - Zj
value of 15 is the largest positive value. The C
column is the new pivot column.
Step 2.
2 Identify the pivot row by dividing the number
in the quantity column by its corresponding
substitution rate in the C column.
50
For the T row :
100 chairs
0.5
40
For the S2 row :
40 chairs
1
2009 Prentice-Hall, Inc.
9 40
$70
$50
$0
$0
S1
S2
0.5
50
2
1
Pivot number
40
$70
0.5
$0
S2
Zj
Cj - Zj
$70
$0
Pivot column
$35
$35
$0
$15
$35
$0
QUANTITY
Pivot row
$3,500
Table 9.5
2009 Prentice-Hall, Inc.
9 41
1
1
1
2
2
1
1
1
1
40
40
1
SOLUTION MIX
S1
S2
QUANTITY
$15
40
9 42
Number in
old T row
Number above
pivot number
Corresponding number
in new C row
(0.5)
(0)
0.5
(0.5)
(1)
1.5
0.5
(0.5)
(2)
0.5
(0.5)
(1)
30
50
(0.5)
(40)
Cj
SOLUTION MIX
S1
S2
QUANTITY
$70
1.5
0.5
30
$50
40
2009 Prentice-Hall, Inc.
9 43
= $70
Cj for column
$70
$50
Zj for column
$70
$50
S1
S2
$0
$0
$5
$15
2009 Prentice-Hall, Inc.
9 44
9 45
Cj
SOLUTION
MIX
$70
$50
$0
$0
S1
S2
QUANTITY
$70
1.5
0.5
30
$50
40
Zj
$70
$50
$5
$15
$4,100
Cj - Zj
$0
$0
$5
$15
Table 9.6
9 46
9 47
3.
4.
5.
9 48
9 49
9 50
be
5 X 1 10 X 2 8 X 3 S1 210
5(20) 10(8) 8(5) S1 210
100 80 40 S1 210
S1 210 220
S1 10 surplus units
2009 Prentice-Hall, Inc.
9 51
9 52
an artificial variable
9 53
9 54
objective function
9 55
Minimize cost $5 X 1 $9 X 2 $7 X 3
And the constraint equations we saw before
would appear as follows:
Minimize cost = $5X1 + $9X2 + $7X3 + $0S1 + $MA1 + $MA2
subject to
5X1 + 10X2 +
8X3 1S1 +
1A1 +
0A2 = 210
25X1 + 30X2 +
0X3 + 0S1 +
0A1 +
1A2 = 900
9 56
9 57
9 58
Minimize cost =
subject to
$5X1 + $6X2
X1 + X2 = 1,000 lb
X1
300 lb
X2 150 lb
X1 , X2 0
where
X1 = number of pounds of phosphate
X2 = number of pounds of potassium
2009 Prentice-Hall, Inc.
9 59
9 60
X1 300
800
B
600
X1 + X2 = 1,000
400
200
100
0 |E
Figure 9.3
G
|
200
D|
400
H
|
600
800
X2 150
|C
1,000 X
1
2009 Prentice-Hall, Inc.
9 61
9 62
function
+ $0S1
+ 0S1
+ 1S1
+ 0S1
9 63
9 64
3.
4.
5.
9 65
SOLUTION MIX
X1
X2
S1
S2
A1
A2
QUANTITY
$M
A1
1,000
$0
S1
300
$M
A2
150
9 66
+ $0(1)
+ $0(0)
+ $M(0)
+ $M(1)
= $M(0)
+ $0(1) + $M(0)
= $M(0)
+ $0(0) + $M(1)
= $M(1)
+ $0(0) + $M(0)
= $M(0)
+ $0(0) + $M(1)
= $M(1,000) + $0(300) + $M(150)
= $M
= $2M
= $0
= $M
= $M
= $M
= $1,150M
9 67
X2
S1
S2
A1
A2
Cj for column
$5
$6
$0
$0
$M
$M
Zj for column
$M
$2M
$0
$M
$M
$M
$0
$M
$0
$0
Cj Zj for column
$M + $5
$2M + $6
9 68
0
0
300
0
1,000
150
2009 Prentice-Hall, Inc.
9 69
$5
$6
$0
$0
$M
$M
X1
X2
S1
S2
A1
A2
QUANTITY
$M
A1
1,000
$0
S1
300
$M
A2
150
Pivot number
Pivot row
Zj
$M
$2M
$0
$M
$M
$M
Cj Zj
$M + $5
2M + $6
$0
$M
$0
$0
$1,150M
Pivot column
Table 9.7
2009 Prentice-Hall, Inc.
9 70
values, X1 and X2
This means an optimal solution does not yet exist
The negative entry for X2 indicates it has the will
result in the largest improvement, which means it
will enter the solution next
To find the variable that will leave the solution, we
divide the elements in the quantity column by the
respective pivot column substitution rates
9 71
9 72
Number above or
below pivot
number
A1 Row
1
0
0
1
1
1
850
number
Corresponding
in newly replaced row
= 1 (1)(0)
1
= 1 (1)(1)
0
= 0 (1)(0)
1
= 0 (1)(1)
0
= 1 (1)(0)
0
= 0 (1)(1)
0
= 1,000 (1)(150) 300
S1 Row
= 1 (0)(0)
= 0 (0)(1)
= 1 (0)(0)
= 0 (0)(1)
= 0 (0)(0)
= 0 (0)(1)
= 300 (0)(150)
2009 Prentice-Hall, Inc.
9 73
= $M(1)
= $M(0)
= $M(0)
+ $0(1)
+ $0(0)
+ $0(1)
+ $6(0)
+ $6(1)
+ $6(0)
= $M
= $6
= $0
Zj (for S2)
Zj (for A1)
Zj (for A2)
Zj (for total cost)
X1
X2
S1
S2
A1
A2
Cj for column
$5
$6
$0
$0
$M
$M
Zj for column
$M
$6
$0
$M 6
$M
$M + 6
Cj Zj for column
$M + $5
$0
$0
$M + 6
$0
$2M 6
9 74
$5
$6
$0
$0
$M
$M
SOLUTION
MIX
X1
X2
S1
S2
A1
A2
QUANTITY
$M
A1
850
$0
S1
300
Pivot number
Pivot row
X2
150
Zj
$M
$6
$0
$M 6
$M
$M + 6
$850M +
$900
Cj Zj
$M + $5
$0
$0
$M + $6
$0
$2M 6
$6
Pivot column
Table 9.8
2009 Prentice-Hall, Inc.
9 75
9 76
= 1 (1)(1)
= 0 (1)(0)
= 0 (1)(1)
= 1 (1)(0)
= 1 (1)(0)
= 1 (1)(0)
= 850 (1)(300)
S1 Row
0
1
0
1
0
1
150
= 0 (0)(1)
= 1 (0)(0)
= 0 (0)(1)
= 1 (0)(0)
= 0 (0)(0)
= 1 (0)(0)
= 150 (0)(300)
9 77
= $M(0)
= $M(0)
= $M(1)
= $M(1)
+ $5(1)
+ $5(0)
+ $5(1)
+ $5(0)
+ $6(0)
+ $6(1)
+ $6(0)
+ $6(1)
= $5
= $6
= $M + 5
= $M 6
Zj (for A1)
= $M(1) + $5(0) + $6(0) = $M
Zj (for A2)
= $M(1) + $5(0) + $6(1) = $M + 6
Zj (for total cost) = $M(550) + $5(300) + $6(150) = $550M + 2,400
COLUMN
X1
X2
S1
S2
A1
A2
Cj for column
$5
$6
$0
$0
$M
$M
Zj for column
$5
$6
$M + 5
$M 6
$M
$M + 6
Cj Zj for column
$0
$0
$M - 5
$M + 6
$0
$2M 6
9 78
Chemical problem
Cj
$5
$6
$0
$0
$M
$M
SOLUTION
MIX
X1
X2
S1
S2
A1
A2
QUANTITY
A1
550
$M
Pivot number
Pivot row
$5
X1
300
$6
X2
150
Zj
$5
$6
$M + 5
$M 6
$M
$M + 6
$550M + 2,400
Cj Zj
$0
$0
$M 5
$M + 6
$0
$2M 6
Pivot column
Table 9.9
2009 Prentice-Hall, Inc.
9 79
550
For the A1 row
550
1
300
For the X 1 row
0
150
For the X 2 row
1
(row to be replaced)
(undefined)
(not considered
because it is
negative)
9 80
= 1 (0)(0)
= 0 (0)(0)
= 1 (0)(1)
= 0 (0)(1)
= 0 (0)(1)
= 0 (0)(1)
= 300 (0)(550)
X2 Row
0
1
1
0
1
0
700
= 0 (1)(0)
= 1 (1)(0)
= 0 (1)(1)
= 1 (1)(1)
= 0 (1)(1)
= 1 (1)(1)
= 150 (1)(550)
9 81
= $0(0)
= $(0)
= $0(1)
= $0(1)
+ $5(1)
+ $5(0)
+ $5(1)
+ $5(0)
+ $6(0)
+ $6(1)
+ $6(1)
+ $6(0)
= $5
= $6
= $1
= $0
Zj (for A1)
= $0(1)
+ $5(0) + $6(1) = $6
Zj (for A2)
= $0(1) + $5(0) + $6(0) = $0
Zj (for total cost) = $0(550) + $5(300) + $6(700) = $5,700
COLUMN
X1
X2
S1
S2
A1
A2
Cj for column
$5
$6
$0
$0
$M
$M
Zj for column
$5
$6
$1
$0
$6
$0
Cj Zj for column
$0
$0
$1
$0
$M 6
$M
9 82
Cj
SOLUTION
MIX
$5
$6
$0
$0
$M
$M
X1
X2
S1
S2
A1
A2
QUANTITY
$0
S2
550
$5
X1
300
$6
X2
700
Zj
$5
$6
$1
$0
$6
$0
$5,700
Cj Zj
$0
$0
$1
$0
$M 6
$M
Table 9.10
9 83
9 84
2.
3.
4.
5.
9 85
Special Cases
We have seen how special cases arise
9 86
Infeasibility
Infeasibility comes about when there is no
9 87
Infeasibility
Illustration of infeasibility
Cj
$5
$8
$0
$0
$M
$M
SOLUTION
MIX
X1
X2
S1
S2
A1
A2
QUANTITY
$5
X1
200
$8
X2
100
$M
A2
20
Zj
$5
$8
$2
$31 M
$21 M
$M
$1,800 + 20M
Cj Zj
$0
$0
$2
$M 31
$2M + 21
$0
Table 9.11
9 88
Unbounded Solutions
Unboundedness describes linear programs that
9 89
Unbounded Solutions
Problem with an unbounded solution
Cj
SOLUTION MIX
$6
$9
$0
$0
X1
X2
S1
S2
QUANTITY
$9
X2
30
$0
S2
10
Zj
$9
$9
$18
$0
$270
Cj - Zj
$15
$0
$18
Pivot column
$0
Table 9.12
9 90
Unbounded Solutions
The ratios from the pivot column
30
Ratio for the X 2 row :
1
10
Ratio for the S2 row :
2
Negative ratios
unacceptable
9 91
Degeneracy
Degeneracy develops when three constraints
9 92
Degeneracy
Degeneracy could lead to a situation known as
9 93
Degeneracy
Problem illustrating degeneracy
Cj
$5
$8
$2
$0
$0
$0
SOLUTION
MIX
X1
X2
X3
S1
S2
S3
$8
X2
0.25
10
$0
S2
0.33
20
$0
S3
0.4
10
Zj
$2
$8
$8
$16
$0
$0
$80
Cj - Zj
$3
$16
$0
$0
$0
$6
Pivot column
QUANTITY
Table 9.13
9 94
Degeneracy
The ratios are computed as follows
10
For the X 2 row :
40
0.25
20
For the S2 row :
5
4
10
For the S3 row :
5
2
9 95
9 96
Cj
SOLUTION MIX
$3
$2
$0
$0
X1
X2
S1
S2
QUANTITY
$2
X2
1.5
$0
S2
0.5
Zj
$3
$2
$2
$0
$12
Cj - Zj
$0
$0
$2
$0
Table 9.14
9 97
9 98
$50X1
+
$120X2
subject to
2X1 + 4X2
80
(hours of
electrician time)
And the optimal solution is
3X1 + 1X2
60
X2 = 20 receivers
Basic
(hours
of
S2 = 40 hours slack in technician time technician
variablestime)
Nonbasic
X1 = 0 CD players
variables
S1 = 0 hours slack in electrician time
2009 Prentice-Hall, Inc.
9 99
40
X1 = 0 CD Players
X2 = 20 Receivers
Profits = $2,400
a = (0, 20)
20
b = (16, 12)
10
Figure 9.4
10
20
30
40
50
c = (20, 0)
60
X1
(CD players)
2009 Prentice-Hall, Inc.
9 100
Changes in the
Objective Function Coefficient
Optimal solution by the simplex method
Cj
SOLUTION
MIX
$50
$120
$0
$0
X1
X2
S1
S2
QUANTITY
$120
X2
0.5
0.25
20
$0
S2
2.5
0.25
40
Zj
$60
$120
$30
$0
$2,400
Cj - Zj
$10
$0
$30
$0
Table 9.15
9 101
Changes in the
Objective Function Coefficient
Nonbasic objective function coefficient
The goal is to find out how sensitive the
problems optimal solution is to changes in the
contribution rates of variables not currently in
the basis
How much would the objective function
coefficients have to change before X1 or S1
would enter the solution mix and replace one
of the basic variables?
The answer lies in the Cj Zj row of the final
simplex tableau
9 102
Changes in the
Objective Function Coefficient
This is a maximization problem so the basis will
9 103
Changes in the
Objective Function Coefficient
Basic objective function coefficient
Sensitivity analysis on objective function
coefficients of variables in the basis or
solution mix is slightly more complex
A change in the profit or cost of a basic
variable can affect the Cj Zj values for all
nonbasic variables
Thats because the Cj value is in both the row
and column
This then impacts the Cj Zj row
9 104
Changes in the
Objective Function Coefficient
Consider a change in the profit contribution of
stereo receivers
The current coefficient is $120
The changed coefficient will be represented as
The revised final tableau will then be
$50
$120 +
$0
$0
SOLUTION
MIX
X1
X2
S1
S2
$120 +
X2
0.5
0.25
20
$0
S2
2.5
0.25
40
Zj
$60 + 0.5
$120 +
$30 + 0.25
$0
$2,400 + 20
Cj - Zj
$10
0.5
$0
$30 0.25
$0
Cj
Table 9.16
QUANTITY
9 105
Changes in the
Objective Function Coefficient
The new Cj Zj values in the table were
9 106
Changes in the
Objective Function Coefficient
Variable X1 will not enter the basis unless the
9 107
Changes in the
Objective Function Coefficient
In larger problems, we would use this procedure
9 108
Shadow prices
How much should a firm be willing to pay for
one additional unit of a resource?
This is called the shadow price
Shadow pricing provides an important piece of
economic information
This information is available in the final
tableau
2009 Prentice-Hall, Inc.
9 109
$50
$120
$0
$0
X1
X2
S1
S2
QUANTITY
$120
X2
0.5
0.25
20
$0
S2
2.5
0.25
40
Zj
$60
$120
$30
$0
$2,400
Cj - Zj
$10
$0
$30
$0
9 110
9 111
9 112
9 113
S1
20
0.25
20/0.25 = 80
40
0.25
40/0.25 = 160
RATIO
9 114
9 115
9 116
S1
20
0.25
20 + 0.25(12) = 23
40
0.25
40 + (0.25)(12) = 37
NEW QUANTITY
increase of $360
This of course, is also equal to the shadow price
of $30 times the 12 additional hours
2009 Prentice-Hall, Inc.
9 117
9 118
Program 9.1a
2009 Prentice-Hall, Inc.
9 119
Program 9.1b
9 120
The Dual
Every LP problem has another LP problem
9 121
The Dual
Generally, if the LP primal is a maximize profit
9 122
The Dual
Illustrating the primal-dual relationship with the
$50X1
+
$120X2
2X1 + 4X2
80
(hours of
available
electrician time)
3X1 + 1X2
60
2009 Prentice-Hall, Inc.
(hours of audio
9 123
The Dual
The dual of this problem has the objective of
9 124
The Dual
The RHS quantities of the primal constraints
2 U1 + 3 U2 50
4 U1 + 1 U2 120
9 125
The Dual
The first constraint says that the total imputed
9 126
9 127
1S2
+ 1A2 = 120
9 128
First
tableau
Second
tableau
80
60
SOLUTION
MIX
U1
U2
S1
S2
A1
A2
QUANTITY
$M
A1
50
$M
A2
120
Zj
$6M
$4M
$M
$M
$M
$M
$170M
Cj Zj
80 6M
60 4M
$80
U1
1.5
0.5
0.5
25
$M
A2
20
Xj
$80
$120
5M
$40 + 2M
$M
$40 2M
$M
Cj Xj
5M 60
2M + 40
3M 40
Table 9.18
$2,000 + 20M
9 129
$50
$120
$0
$0
Solution Mix
X1
X2
S1
S2
Quantity
$120
X2
0.5
0.25
20
$0
S2
2.5
0.25
40
Zj
60
120
30
$2,400
Cj Zj
10
30
80
60
Solution Mix
U1
U2
S1
S2
A1
A2
Quantity
80
U1
0.25
0.25
0.5
30
S1
2.5
0.5
0.25
10
Zj
80
20
20
20
$2,400
Cj Zj
40
20
M 20
Figure 9.5
9 130
9 131
Karmakars Algorithm
In 1984, Narendra Karmakar developed a new
9 132