Topic 03 - Simplex Method
Topic 03 - Simplex Method
1
ISE 303
OPERATIONS RESEARCH I
3
Quality & Accreditation Terminologies
5
Simplex Method
6
General Form of a Linear Programming Problem
..
‘n’ decision variables and ‘m’ constraints LPP
am1x1 + am2x2 +……..+ amnxn ≤ bm
xi ≥ 0 and bi ≥ 0
7
A Standard Linear Programming Problem
8
Standard Form of Linear Programming Problem
9
Example
10
Example
11
Example
12
Example
13
Example
14
Example
15
Setting Up the Initial Simplex Tableau
..
18
Surplus Variable
19
Basic and Nonbasic Variables
• Basic variables are selected arbitrarily with the restriction that there be as
many basic variables as there are equations. The remaining variables are
non-basic variables
x1 2 x2 s1 32
3 x1 4 x2 s2 84
• This system has two equations, we can select any two of the four
variables as basic variables. The remaining two variables are then non-
basic variables. A solution found by setting the two non-basic variables
equal to 0 and solving for the two basic variables is a basic solution. If a
basic solution has no negative values, it is a basic feasible solution
• However, generally we select slack variables as initial basic variables
20
Concept of Basic Solution and Basic Feasible Solution
Number of variables = 4
Number of equation = 2
So, to get the solution we need to put How Many variables at the zero level?
Number of variables – Number of equations = 2
How many Solutions? 4C2 = 6
21
Concept of Basic Solution and Basic Feasible Solution
25
Simplex Algorithm for Standard Maximization Problems
1. Convert each inequality in the set of constraints to an equation by adding slack variables
2. Create the initial simplex tableau
3. Select the pivot column (Column with the “most +ve value” element in the Cj – Zj row)
4. Select the pivot row (Row with the smallest non-negative result in Ratio when the last
element in the row is divided by the corresponding in the pivot column)
5. Use elementary row operations calculate new values for the pivot row so that the pivot is
1 (Divide every number in the row by the pivot number)
6. Use elementary row operations to make all numbers in the pivot column equal to 0
except for the pivot number. If all entries in the bottom row are zero or negative, this the
final tableau. If not, go back to step 3
7. If you obtain a final tableau, then the linear programming problem has a maximum
solution, which is given by the entry in the lower-right corner of the tableau.
26
Pivot
27
Example 1
28
Practice
29
Practice
30
Optimal & Feasible Solution
Optimality Feasibility
Condition Condition
Problem Type
Cj – Z j Solution Value
Maximization ≤0 ≥0
Minimization ≥0 ≥0
31
Example 1
32
P = 7X1 + 5X1 + 0S1 + 0S1
Example 1 2X1 + 1X2 + S1 + 0S2 = 100
4X1 + 3X2 + 0 S1 + S2 = 240
33
P = 7X1 + 5X1 + 0S1 + 0S1
Example 1 2X1 + 1X2 + S1 + 0S2 = 100
4X1 + 3X2 + 0 S1 + S2 = 240
34
P = 7X1 + 5X1 + 0S1 + 0S1
Example 1 2X1 + 1X2 + S1 + 0S2 = 100
4X1 + 3X2 + 0 S1 + S2 = 240
35
P = 7X1 + 5X1 + 0S1 + 0S1
Example 1 2X1 + 1X2 + S1 + 0S2 = 100
4X1 + 3X2 + 0 S1 + S2 = 240
36
P = 7X1 + 5X1 + 0S1 + 0S1
Example 1 2X1 + 1X2 + S1 + 0S2 = 100
4X1 + 3X2 + 0 S1 + S2 = 240
37
Example 1
CB × aij
0×2+0×2
38
Example 1
Cj - Zj
39
Example 1
If not find the maximum Cj − Zj value. This column will be the Entering Variable
40
Example 1
Entering
Variable
41
Example 1
Find
the Ratio for each Cell in the last Column
42
Example 1
Find
the Ratio for each Cell in the last Column
43
Example 1
Cj 7 5 0 0
CB Basic X1 X2 S1 S2 b Ratio
7 X1 1 1/2 1/2 0 50
0 S2 4 3 0 1 240
Zj
Cj − Zj
46
Example 1
Cj 7 5 0 0
CB Basic X1 X2 S1 S2 b Ratio
7 X1 1 1/2 1/2 0 50
0 S2 4 3 0 1 240
Zj
Cj − Zj
Now we have to make all other elements in the Pivot Column equal to
ZERO. We will calculate new values for S2
New Value = Old Value – (New value in Pivot Row) Corresponding Value in Pivot Col
47
Example 1
Cj 7 5 0 0
CB Basic X1 X2 S1 S2 b Ratio
7 X1 1 1/2 1/2 0 50
0 S2 0 1 -2 1 40
Zj 7 7/2 7/2 0 350
Cj − Zj
48
Example 1
Cj 7 5 0 0
CB Basic X1 X2 S1 S2 b Ratio
7 X1 1 1/2 1/2 0 50
0 S2 0 1 -2 1 40
Zj 7 7/2 7/2 0 350
Cj − Zj 0 3/2 -7/2 0
49
Example 1
Cj 7 5 0 0
CB Basic X1 X2 S1 S2 b Ratio
7 X1 1 1/2 1/2 0 50
0 S2 0 1 -2 1 40
Zj 7 7/2 7/2 0 350
Cj − Zj 0 3/2 -7/2 0
Entering
Variable
Find largest values for Cj − Zj, this will be the Entering variable
50
Example 1
Cj 7 5 0 0
CB Basic X1 X2 S1 S2 b Ratio
7 X1 1 1/2 1/2 0 50
0 S2 0 1 -2 1 40
Zj 7 7/2 7/2 0 350
Cj − Zj 0 3/2 -7/2 0
Cj 7 5 0 0
CB Basic X1 X2 S1 S2 b Ratio
= 50/(1/2)
7 X1 1 1/2 1/2 0 50 = 100
= 40/1
0 S2 0 1 -2 1 40 = 40
Zj
Cj − Zj
Cj 7 5 0 0
CB Basic X1 X2 S1 S2 b Ratio
7 X1 1 1/2 1/2 0 50 100
0 S2 0 1 -2 1 40 40
Zj
Cj − Zj
Cj 7 5 0 0
CB Basic X1 X2 S1 S2 b Ratio
7 X1 1 1/2 1/2 0 50 100
5 X2 0 1 -2 1 40 40
Zj
Cj − Zj
Cj 7 5 0 0
CB Basic X1 X2 S1 S2 b Ratio
7 X1 1 1/2 1/2 0 50 100
5 X2 0 1 -2 1 40 40
Zj
Cj − Zj
Now we have to make all other elements in the Pivot Column equal to
ZERO. We will calculate new values for X1
New Value = Old Value – (New value in Pivot Row) Corresponding Value in Pivot Col
55
Example 1
Cj 7 5 0 0
CB Basic X1 X2 S1 S2 b Ratio
7 X1 1 0 3/2 -1/2 30
5 X2 0 1 -2 1 40
Zj
Cj − Zj
56
Example 1
Cj 7 5 0 0
CB Basic X1 X2 S1 S2 b Ratio
7 X1 1 0 3/2 -1/2 30
5 X2 0 1 -2 1 40
Zj 7 5 1/2 3/2 410
Cj − Zj
57
Example 1
Cj 7 5 0 0
CB Basic X1 X2 S1 S2 b Ratio
7 X1 1 0 3/2 -1/2 30
5 X2 0 1 -2 1 40
Zj 7 5 1/2 3/2 410
Cj − Zj 0 0 -1/2 -3/2
58
Example 1
Cj 7 5 0 0
CB Basic X1 X2 S1 S2 b Ratio
7 X1 1 0 3/2 -1/2 30
5 X2 0 1 -2 1 40
Zj 7 5 1/2 3/2 410
Cj − Zj 0 0 -1/2 -3/2
59
Example 1
Cj 7 5 0 0
CB Basic X1 X2 S1 S2 b Ratio
7 X1 1 0 3/2 -1/2 30
5 X2 0 1 -2 1 40
Zj 7 5 1/2 3/2 410
Cj − Zj 0 0 -1/2 -3/2
1. Convert each inequality in the set of constraints to an equation by adding slack variables
2. Create the initial simplex tableau
3. Select the pivot column (Column with the “most -ve value” element in the Cj – Zj row)
4. Select the pivot row (Row with the smallest non-negative result in Ratio when the last
element in the row is divided by the corresponding in the pivot column)
5. Use elementary row operations calculate new values for the pivot row so that the pivot is
1 (Divide every number in the row by the pivot number)
6. Use elementary row operations to make all numbers in the pivot column equal to 0
except for the pivot number. If all entries in the bottom row are zero or positive, this the
final tableau. If not, go back to step 3
7. If you obtain a final tableau, then the linear programming problem has a maximum
solution, which is given by the entry in the lower-right corner of the tableau.
61
Minimisation Example 1
Minimize Z = –2x – 3y
subject to 5x + 4y ≤ 32
x + 2y ≤ 10
x; y ≥ 0
Standard Form
5x + 4y + S1 = 32
x + 2y + S2 = 10
Z = –2x – 3y + 0S1 + 0S2
62
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj
CB Basic X Y S1 S2 b Ratio
S1
S2
Zj
Cj − Zj
63
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 5 4 1 0 32
0 S2 1 2 0 1 10
Zj
Cj − Zj
64
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 5 4 1 0 32
0 S2 1 2 0 1 10
Zj 0 0 0 0 0
Cj − Zj -2 -3 0 0
65
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 5 4 1 0 32
0 S2 1 2 0 1 10
Zj 0 0 0 0 0
Cj − Zj -2 -3 0 0
66
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 5 4 1 0 32 8
0 S2 1 2 0 1 10 5
Zj 0 0 0 0 0
Cj − Zj -2 -3 0 0
67
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 5 4 1 0 32 8
0 S2 1 2 0 1 10 5
Zj 0 0 0 0 0
Cj − Zj -2 -3 0 0
68
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1
-3 Y
Zj
Cj − Zj
69
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1
-3 Y ½ 1 0 ½ 5
Zj
Cj − Zj
70
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 3 0 1 -2 12
-3 Y ½ 1 0 ½ 5
Zj
Cj − Zj
71
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 3 0 1 -2 12
-3 Y ½ 1 0 ½ 5
Zj -3/2 3 0 -3/2 -15
Cj − Zj
72
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 3 0 1 -2 12
-3 Y ½ 1 0 ½ 5
Zj -3/2 3 0 -3/2 -15
Cj − Zj -1/2 0 0 3/2
73
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 3 0 1 -2 12
-3 Y ½ 1 0 ½ 5
Zj -3/2 3 0 -3/2 -15
Cj − Zj -1/2 0 0 3/2
74
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 3 0 1 -2 12 4
-3 Y ½ 1 0 ½ 5 10
Zj -3/2 3 0 -3/2 -15
Cj − Zj -1/2 0 0 3/2
75
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 3 0 1 -2 12 4
-3 Y ½ 1 0 ½ 5 10
Zj -3/2 3 0 -3/2 -15
Cj − Zj -1/2 0 0 3/2
76
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
-2 X
-3 Y
Zj
Cj − Zj
77
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
-2 X 1 0 1/3 -2/3 4
-3 Y
Zj
Cj − Zj
78
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
-2 X 1 0 1/3 -2/3 4
-3 Y 0 1 -1/6 5/6 3
Zj
Cj − Zj
79
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
-2 X 1 0 1/3 -2/3 4
-3 Y 0 1 -1/6 5/6 3
Zj -2 -3 -1/6 -7/6 -17
Cj − Zj
80
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
-2 X 1 0 1/3 -2/3 4
-3 Y 0 1 -1/6 5/6 3
Zj -2 -3 -1/6 -7/6 -17
Cj − Zj 0 0 1/6 7/6
81
Z = –2x – 3y + 0S1 + 0S2
5x + 4y + S1 = 32
Minimisation Example 1 x + 2y + S2 =
10
Cj -2 -3 0 0
CB Basic X Y S1 S2 b Ratio
-2 X 1 0 1/3 -2/3 4
-3 Y 0 1 -1/6 5/6 3
Zj -2 -3 -1/6 -7/6 -17
Cj − Zj 0 0 1/6 7/6
82
The Dual Problem: Minimization with problem
constraints of the form ≥
83
Minimisation Example 2
Standard Form
3x + 4y + S1 = 24
7x – 4y + S2 = 16
C = 2x - 3y + 0S1 + 0S2
84
C = 2x - 3y + 0S1 + 0S2
3x + 4y + S1 = 24
Minimisation Example 2 7x – 4y + S2 = 16
Cj
CB Basic X Y S1 S2 b Ratio
S1
S2
Zj
Cj − Zj
85
C = 2x - 3y + 0S1 + 0S2
3x + 4y + S1 = 24
Minimisation Example 2 7x – 4y + S2 = 16
Cj 2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 3 4 1 0 24
0 S2 7 -4 0 1 16
Zj
Cj − Zj
86
C = 2x - 3y + 0S1 + 0S2
3x + 4y + S1 = 24
Minimisation Example 2 7x – 4y + S2 = 16
Cj 2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 3 4 1 0 24
0 S2 7 -4 0 1 16
Zj 0 0 0 0 0
Cj − Zj 2 -3 0 0
87
C = 2x - 3y + 0S1 + 0S2
3x + 4y + S1 = 24
Minimisation Example 2 7x – 4y + S2 = 16
Cj 2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 3 4 1 0 24
0 S2 7 -4 0 1 16
Zj 0 0 0 0 0
Cj − Zj 2 -3 0 0
88
C = 2x - 3y + 0S1 + 0S2
3x + 4y + S1 = 24
Minimisation Example 2 7x – 4y + S2 = 16
Cj 2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 3 4 1 0 24 8
0 S2 7 -4 0 1 16 16/7
Zj 0 0 0 0 0
Cj − Zj 2 -3 0 0
89
C = 2x - 3y + 0S1 + 0S2
3x + 4y + S1 = 24
Minimisation Example 2 7x – 4y + S2 = 16
Cj 2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 3 4 1 0 24 8
0 S2 7 -4 0 1 16 16/7
Zj 0 0 0 0 0
Cj − Zj 2 -3 0 0
90
C = 2x - 3y + 0S1 + 0S2
3x + 4y + S1 = 24
Minimisation Example 2 7x – 4y + S2 = 16
Cj 2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1
2 X
Zj
Cj − Zj
91
C = 2x - 3y + 0S1 + 0S2
3x + 4y + S1 = 24
Minimisation Example 2 7x – 4y + S2 = 16
Cj 2 3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1
2 X 1 -4/7 0 1/7 16/7
Zj
Cj − Zj
92
C = 2x - 3y + 0S1 + 0S2
3x + 4y + S1 = 24
Minimisation Example 2 7x – 4y + S2 = 16
Cj 2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 0 40/7 1 -3/7 120/7
2 X 1 -4/7 0 1/7 16/7
Zj
Cj − Zj
93
C = 2x - 3y + 0S1 + 0S2
3x + 4y + S1 = 24
Minimisation Example 2 7x – 4y + S2 = 16
Cj 2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 0 40/7 1 -3/7 120/7
2 X 1 -4/7 0 1/7 16/7
Zj 2 -8/7 0 2/7 32/7
Cj − Zj
94
C = 2x - 3y + 0S1 + 0S2
3x + 4y + S1 = 24
Minimisation Example 2 7x – 4y + S2 = 16
Cj 2 -3 0 0
CB Basic X Y S1 S2 b Ratio
0 S1 0 40/7 1 -3/7 120/7
2 X 1 -4/7 0 1/7 16/7
Zj 2 -8/7 0 2/7 32/7
Cj − Zj 0 -13/7 0 -2/7
• Constraint Types
– ≤ → Less than or equal to
– ≥ → Greater than or equal to
– = → Equal to
• ≤ → Add Slack variable in equation (+S)
• ≥ → Subtract Surplus variable (-S)
&
Add Artificial Variable (+A)
• = → Add Artificial Variable (+A)
96
Artificial and Surplus Variables
97
Artificial and Surplus Variables
98
Mixed Constraints
99
Example
100
Example – Maximisation
• Objective Function
Maximise Profit = 5X1 + 6X2
• 1st constraint: 1X1 + 1X2 = 1,000
• 2nd constraint: 1X1 ≤ 300
• 3rd constraint: 1X2 ≥ 150
Simplex Form
• 1st constraint: 1X1 + 1X2 + 1A1 = 1,000
• 2nd constraint: 1X1 + 1S1 ≤ 300
• 3rd constraint: 1X2 – 1 S2 + 1A2 = 150
• Simplex form of Objective Function
Minimise Cost = 5X1 + 6X2 + 0S1 + 0S2 – MA1 – MA2
101
Example – Minimisation
• Objective Function
Minimise Cost = 5X1 + 6X2
• 1st constraint: 1X1 + 1X2 = 1,000
• 2nd constraint: 1X1 ≤ 300
• 3rd constraint: 1X2 ≥ 150
Simplex Form
• 1st constraint: 1X1 + 1X2 + 1A1 = 1,000
• 2nd constraint: 1X1 + 1S1 ≤ 300
• 3rd constraint: 1X2 – 1 S2 + 1A2 = 150
• Simplex form of Objective Function
Minimise Cost = 5X1 + 6X2 + 0S1 + 0S2 + MA1 + MA2
102
Problem
Standard Form
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
103
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
A1
A2
ZJ
CJ – ZJ
104
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
A1
A2
ZJ
CJ – ZJ
105
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
M A1 2 4 6 -1 0 1 0 24
M A2 3 9 6 0 -1 0 1 30
ZJ
CJ – ZJ
106
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
M A1 2 4 6 -1 0 1 0 24
M A2 3 9 6 0 -1 0 1 30
CJ – ZJ
107
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
M A1 2 4 6 -1 0 1 0 24
M A2 3 9 6 0 -1 0 1 30
108
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
M A1 2 4 6 -1 0 1 0 24
M A2 3 9 6 0 -1 0 1 30
109
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
M A1 2 4 6 -1 0 1 0 24 6
M A2 3 9 6 0 -1 0 1 30 10/3
110
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
M A1 2 4 6 -1 0 1 0 24 6
M A2 3 9 6 0 -1 0 1 30 10/3
111
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
M A1
15 X2
ZJ
CJ – ZJ
112
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
M A1
ZJ
CJ – ZJ
113
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
M A1 2/3 0 10/3 -1 4/9 1 -4/9 32/3
ZJ
CJ – ZJ
114
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
M A1 2/3 0 10/3 -1 4/9 1 -4/9 32/3
115
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
M A1 2/3 0 10/3 -1 4/9 1 -4/9 32/3
116
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
M A1 2/3 0 10/3 -1 4/9 1 -4/9 32/3 16/5
117
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
M A1 2/3 0 10/3 -1 4/9 1 -4/9 32/3 16/5
118
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
20 X3
15 X2
ZJ
CJ – ZJ
119
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
20 X3 1/5 0 1 -3/10 2/15 3/10 -2/15 16/5
15 X2
ZJ
CJ – ZJ
120
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
20 X3 1/5 0 1 -3/10 2/15 3/10 -2/15 16/5
ZJ
CJ – ZJ
121
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
20 X3 1/5 0 1 -3/10 2/15 3/10 -2/15 16/5
ZJ 7 15 20 -3 -1/3 3 1/3 82
CJ – ZJ
122
Z = 7X1 + 15X2 + 20X3 + 0S1 + 0S2 + MA1 + MA2
2X1 + 4X2 + 6X3 – S1 + A1 ≥ 24
Solution 3X1 + 9X2 + 6X3 – S2 + A2 ≥ 30
CJ 7 15 20 0 0 M M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
20 X3 1/5 0 1 -3/10 2/15 3/10 -2/15 16/5
ZJ 7 15 20 -3 -1/3 3 1/3 82
X1 = 0; X2 = 6/5; X3 = 16/5; S1 = 0; S2 = 0; S3 = 0
Z = 82
123
Problem
Maximise P = X1 - X2 + 3X3
Subject to:-
X1 + X2 + ≤ 20
X1 + X3 = 5
X2 + X3 ≥ 10
X1, X2, X3 ≥ 0
Standard Form
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 + S2 + 0A1 + A2 = 10
CJ
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
S1
A1
A2
ZJ
CJ – ZJ
125
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1
-M A1
-M A2
ZJ
CJ – ZJ
126
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1 1 1 0 1 0 0 0 20
-M A1 1 0 1 0 0 1 0 5
-M A2 0 1 1 0 -1 0 1 10
ZJ
CJ – ZJ
127
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1 1 1 0 1 0 0 0 20
-M A1 1 0 1 0 0 1 0 5
-M A2 0 1 1 0 -1 0 1 10
ZJ -M -M -2M 0 M -M -M -15M
CJ – ZJ
128
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1 1 1 0 1 0 0 0 20
-M A1 1 0 1 0 0 1 0 5
-M A2 0 1 1 0 -1 0 1 10
ZJ -M -M -2M 0 M -M -M -15M
129
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1 1 1 0 1 0 0 0 20
-M A1 1 0 1 0 0 1 0 5
-M A2 0 1 1 0 -1 0 1 10
ZJ -M -M -2M 0 M -M -M -15M
130
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1 1 1 0 1 0 0 0 20 0
-M A1 1 0 1 0 0 1 0 5 5
-M A2 0 1 1 0 -1 0 1 10 10
ZJ -M -M -2M 0 M -M -M -15M
131
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1 1 1 0 1 0 0 0 20 0
-M A1 1 0 1 0 0 1 0 5 5
-M A2 0 1 1 0 -1 0 1 10 10
ZJ -M -M -2M 0 M -M -M -15M
132
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1
3 X3
-M A2
ZJ
CJ – ZJ
133
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1
3 X3 1 0 1 0 0 1 0 5
-M A2
ZJ
CJ – ZJ
134
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1 1 1 0 1 0 0 0 20
3 X3 1 0 1 0 0 1 0 5
-M A2 -1 1 0 0 -1 -1 1 5
ZJ
CJ – ZJ
135
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1 1 1 0 1 0 0 0 20
3 X3 1 0 1 0 0 1 0 5
-M A2 -1 1 0 0 -1 -1 1 5
CJ – ZJ
136
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1 1 1 0 1 0 0 0 20
3 X3 1 0 1 0 0 1 0 5
-M A2 -1 1 0 0 -1 -1 1 5
137
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1 1 1 0 1 0 0 0 20
3 X3 1 0 1 0 0 1 0 5
-M A2 -1 1 0 0 -1 -1 1 5
138
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1 1 1 0 1 0 0 0 20 20
3 X3 1 0 1 0 0 1 0 5 -----
-M A2 -1 1 0 0 -1 -1 1 5 5
139
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1 1 1 0 1 0 0 0 20 20
3 X3 1 0 1 0 0 1 0 5 ----
-M A2 -1 1 0 0 -1 -1 1 5 5
140
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1
3 X3
-1 X2
ZJ
CJ – ZJ
141
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1
3 X3
-1 X2 -1 1 0 0 -1 -1 1 5
ZJ
CJ – ZJ
142
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1 2 0 0 1 1 1 -1 15
3 X3 1 0 1 0 0 1 0 5
-1 X2 -1 1 0 0 -1 -1 1 5
ZJ
CJ – ZJ
143
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1 2 0 0 1 1 1 -1 15
3 X3 1 0 1 0 0 1 0 5
-1 X2 -1 1 0 0 -1 -1 1 5
ZJ 4 -1 3 0 1 4 -1 10
CJ – ZJ -3 0 0 0 -1 -4-M 1-M
144
P = X1 – X2 + 3X3 + 0S1 + 0S2 – MA1 – MA2
X1 + X2 + 0X3 + S1 + 0S2 + 0A1 + 0A2 = 20
Solution X1 + 0X2 + X3 + 0S1 + 0S2 + A1 + 0A2 = 5
0X1 + X2 + X3 + 0S1 - S2 + 0A1 + A2 = 10
CJ 1 -1 3 0 0 -M -M
CB Basic X1 X2 X3 S1 S2 A1 A2 b Ratio
0 S1 2 0 0 1 1 1 -1 15
3 X3 1 0 1 0 0 1 0 5
-1 X2 -1 1 0 0 -1 -1 1 5
ZJ 4 -1 3 0 1 4 -1 10
CJ – ZJ -3 0 0 0 -1 -4-M 1-M
X1 = 0; X2 = 5; X3 = 5; S1 = 15; S2 = 0; S3 = 0
P = 10
145
Special Cases in Simplex Method
146
Tie for Pivot Column
• Sometimes when selecting the pivot column, you may notice that the
greatest positive Cj – Zj row values are the same; thus, there is a tie for
the pivot column
• When this happens, one of the two tied columns should be selected
arbitrarily
• Even though one choice may require fewer subsequent iterations than the
other, there is no way of knowing this beforehand
147
Degeneracy
148
Degeneracy
149
Degeneracy
150
Multiple Optimal Solutions
152
Unbounded Solutions
• In some problems the feasible solution area formed by the model constraints is
not closed. In these cases it is possible for the objective function to increase
indefinitely without ever reaching a maximum value because it never reaches the
boundary of the feasible solution area
• For maximization problems
– It occurs when the value of non-basic variable in z row is –ve (this means that non-
basic variable has to enter the solution). AND the values of constraints
under this variable are either –ve or 0 (this means no basic variable can
leave the solution)
• For minimization problems
– It occurs when the value of non-basic variable in z row is +ve (this means that non-
basic variable has to enter the solution). AND the values of constraints
under this variable are either –ve or 0 (this means no basic variable can
leave the solution)
153
Unbounded Solutions
154
No Feasible Solution
• When a simplex tableau has a negative entry in the last column and no
other entries in that row are negative, then there is no feasible solution to
the problem
• This occurs when in the optimal and feasible table, there exist Artificial
variable as a basic variable.
• This situation can never occur if all the constraints are of the type “≤” with
nonnegative RHS
155
No Feasible Solution
• Table has all zero or negative values in the Cj – Zj row, indicating that it is optimal.
• However, the solution is X2=4, A1=4 and A2=2. Because the existence of artificial
variables in the final solution makes the solution meaningless, this is not a real
solution
• Generally occur due to error in defining the problem or formulating the model
156
Using Computer to Solve Problems
• Microsoft Excel
• Lingo – can be downloaded from
https://www.lindo.com/index.php/products/lingo-and-optimization-modeling
• Excel QM
157
Microsoft Excel
158
Microsoft Excel
159
Microsoft Excel
160
Microsoft Excel
161
Microsoft Excel
162
Microsoft Excel
163
Microsoft Excel
164
Microsoft Excel
165
Solver Add-in
Type of Problem
Min / Max
Define Constraints
here
Type of Algorithm
Simplex or GRG
Nonlinear
167
Solver Example
168
Solver Example
X1, X2, X3 ≥ 0
169
Excel Model
Variables
Objective
Function
Constraint
Values
170
Solver Setup
171
Solver Setup
172
Solver Setup
173
Solver Setup
174
Solver Setup
175
Solver Solution
176
Solver Solution
177
Solver Solution
178
Lingo
179
Lingo Modelling Window
180
Lingo Model
181
Lingo Solution
182