Attendance5 1
Attendance5 1
Chapter 5
71
72 Chapter 5. Linear Programming: The Simplex Method (LECTURE NOTES 5)
Maximize 2x - 3y
subject to 3x + 5y ≤ 20
-3x - y ≥ -16
-2x + y ≤ 1
x ≥ 0
y ≥ 0
is / is not a standard maximization problem because
i. it obeys three conditions.
ii. objective function minimized (rather than maximized).
iii. constraints not all written with less than or equal to signs,“≤”.
iv. right–hand–sides not all nonnegative.
If both sides of constraint −3𝑥 − 𝑦 ≥ −16 multiplied by −1, LP problem
becomes / does not become standard maximization problem.
Maximize 6x + 4y
subject to x + 2y ≤ 8
2x + y ≤ 10
x ≥ 0
y ≥ 0
y y
10
(0,10) s1 = -12, s2 = 0 (0,10)
(0,10)
y
8 2x + y = 10 (s2 zero) 2x + y = 10 (s2 zero)
8
8
6 6
6 s2 negative
(0,4) s1 = 0, s 2 = 6 (0,4)
(0,4)
4 s1 negative
(4,2) (4,2) s1 = 0, s 2 = 0
(4,2) 2 2 feasible
2
s1 positive s2 positive region x + 2y = 8 (s1 zero)
x + 2y = 8 (s1 zero)
x x
x (0,0) 2 4 6 8 10 2 4 6 10
(0,0) 2 4 6 8 10 s1 = 8, s 2 = 10 (0,0) (8,0)
(5,0) (8,0) (5,0) (8,0) (5,0)
s1 = 3, s 2 = 0 s1 = 0, s 2 = -6
y
s1 = -12, s2 = 0 (0,10)
x + 2y _ 8,
<
2x + y = 10 (s2 zero) 2x + y <
_ 10,
8
x _> 0,
y _> 0
6
s1 = 0, s 2 = 6 (0,4) C
D 2
(4,2) s1 = 0, s 2 = 0
feasible
region x + 2y = 8 (s1 zero)
x
s1 = 8, s 2 = 10 (0,0) 2 4 6 10
(5,0) (8,0)
s1 = 3, s 2 = 0 s1 = 0, s 2 = -6
A
B E
Section 1. Slack Variables and Pivoting (LECTURE NOTES 5) 75
(a) Algebraically, corner point A where (𝑥, 𝑦) = (0, 0) and (𝑠1 , 𝑠2 ) = (8, 10) is
𝑥 𝑦 𝑠1 𝑠2
1 2 1 0 8
2 1 0 1 10
Type this 2 by 5 table into MATRIX [A]; use 2nd MATRIX EDIT.
where first row of this (augmented) matrix is
𝒙 + 2𝒚 + 𝒔1 = 8 / 2𝒙 + 𝒚 + 𝒔2 = 10
and second row of this (augmented) matrix is
𝒙 + 2𝒚 + 𝒔1 = 8 / 2𝒙 + 𝒚 + 𝒔2 = 10
(𝑥, 𝑦) are nonbasic variables (where columns not 0s and 1s)
and (𝑠1 , 𝑠2 ) are basic (where columns are 0s and 1s) variables
(b) Corner point A to B. Pivot on element1 2,
𝑥 𝑦 𝑠1 𝑠2
1 2 1 0 8
2 1 0 1 10
with resulting matrix,
1
𝑥 𝑦 𝑠1 𝑠2
𝑅 →𝑅2 ,
2 2
𝑅1 −𝑅2 →𝑅1
−→ 0 1.5 1 -0.5 3
1 0.5 0 0.5 5
2nd MATRIX MATH *row(1/2,[A],2) STO 2nd MATRIX [B];
2nd MATRIX MATH *row+(−1,[B], 2 , 1 ) STO 2nd MATRIX [C]
|{z} |{z}
pivot row zeroed
which corresponds to
i. corner point A where (𝑥, 𝑦) = (0, 0) and (𝑠1 , 𝑠2 ) = (8, 10)
ii. corner point B where (𝑥, 𝑦) = (5, 0) and (𝑠1 , 𝑠2 ) = (3, 0)
iii. corner point C where (𝑥, 𝑦) = (4, 2) and (𝑠1 , 𝑠2 ) = (0, 0)
iv. corner point D where (𝑥, 𝑦) = (0, 4) and (𝑠1 , 𝑠2 ) = (0, 6)
where nonbasic variables (𝑦, 𝑠2 ) = (0, 0) / (5, 3)/ (3, 5)
and basic (𝑥, 𝑠1 ) = (0, 0) / (5, 3) / (3, 5)
(c) Corner point B to C. Pivot on element2 1.5,
𝑥 𝑦 𝑠1 𝑠2
0 1.5 1 -0.5 3
1 0.5 0 0.5 5
1
Force element 2 equal to 1 by dividing row 2 by 2, then zero element above 2 to zero by
subtracting row 2 from row 1. We will find out later why element 2 is pivot.
2
Force element 1.5 equal to 1 by dividing row 1 by 1.5, then zero element below 1.5 to zero by
subtracting row 1 from row 2. We will find out later why element 1.5 is pivot.
76 Chapter 5. Linear Programming: The Simplex Method (LECTURE NOTES 5)
3
𝑥 𝑦 𝑠1 𝑠2
𝑅 →𝑅2 ,
2 2
𝑅1 + 31 𝑅2 →𝑅1 1 1
−→ 2
1 2
0 4
3
2
0 − 21 1 6
2nd MATRIX MATH *row(3/2,[E],2) STO 2nd MATRIX [F];
2nd MATRIX MATH *row+(1/3,[F],2,1) STO 2nd MATRIX [G]
which corresponds to
i. corner point A where (𝑥, 𝑦) = (0, 0) and (𝑠1 , 𝑠2 ) = (8, 10)
ii. corner point B where (𝑥, 𝑦) = (5, 0) and (𝑠1 , 𝑠2 ) = (3, 0)
iii. corner point C where (𝑥, 𝑦) = (4, 2) and (𝑠1 , 𝑠2 ) = (0, 0)
iv. corner point D where (𝑥, 𝑦) = (0, 4) and (𝑠1 , 𝑠2 ) = (0, 6)
where nonbasic variables (𝑥, 𝑠1 ) = (0, 0) / (2, 4)/ (4, 2)
and basic (𝑦, 𝑠2) = (0, 0) / (4, 6) / (6, 4)
(e) Corner A to unfeasible E.
𝑥 𝑦 𝑠1 𝑠2
1 2 1 0 8
2 1 0 1 10
with resulting matrix,
Section 1. Slack Variables and Pivoting (LECTURE NOTES 5) 77
𝑥 𝑦 𝑠1 𝑠2
𝑅2 −2𝑅1 →𝑅2
−→ 1 2 1 0 8
0 -3 -2 1 -6
2nd MATRIX MATH *row+(−2,[A],1,2) STO 2nd MATRIX [H]
which corresponds to
i. corner point A where (𝑥, 𝑦) = (0, 0) and (𝑠1 , 𝑠2 ) = (8, 10)
ii. corner point B where (𝑥, 𝑦) = (5, 0) and (𝑠1 , 𝑠2 ) = (3, 0)
iii. corner point C where (𝑥, 𝑦) = (4, 2) and (𝑠1 , 𝑠2 ) = (0, 0)
iv. corner point D where (𝑥, 𝑦) = (0, 4) and (𝑠1 , 𝑠2 ) = (0, 6)
v. infeasible point (𝑥, 𝑦) = (8, 0) and (𝑠1 , 𝑠2 ) = (0, −6)
where nonbasic variables (𝑦, 𝑠1 ) = (0, 0) / (8, −6)/ (−6, 8)
and basic (𝑥, 𝑠2 ) = (0, 0) / (8, −6) / (−6, 8)
y
20
20x + 10y = 175
(0, 50/3) constraints or feasible set
16 20x + 10y < _ 175,
B (5/2, 25/2) 25x + 15y <_ 250,
12 x >
_ 0,
y >_ 0
8
0 x
0 2 4 6 8 10
(0,0)
(35/4, 0)
A
(a) Initial corner point A. Start at (𝑥, 𝑦) = (0, 0) and (𝑠1 , 𝑠2 ) = (8, 10) where
𝑥 𝑦 𝑠1 𝑠2
20 10 1 0 175
25 15 0 1 250
Type this 2 by 5 table into MATRIX [A]; use 2nd MATRIX EDIT.
where first row of this (augmented) matrix is
20𝒙 + 10𝒚 + 𝒔1 = 175 / 25𝒙 + 15𝒚 + 𝒔2 = 250
and second row of this (augmented) matrix is
20𝒙 + 10𝒚 + 𝒔1 = 175 / 25𝒙 + 15𝒚 + 𝒔2 = 250
(b) Corner point A to B
Pivot in column3 𝑦 (not 𝑥!),
3
We shortly learn why column 𝑦, not 𝑥.
78 Chapter 5. Linear Programming: The Simplex Method (LECTURE NOTES 5)
𝑥 𝑦 𝑠1 𝑠2
20 10 1 0 175
25 15 0 1 250
and pivot on element 10 / 15 in 𝑦,
1
𝑥 𝑦 𝑠1 𝑠2
𝑅 →𝑅2 ,
15 2
𝑅1 −10𝑅2 →𝑅1 10
−→ 3
0 1 − 23 25
3
5 1 50
3
1 0 15 3
2nd MATRIX MATH *row(1/15,[A],2) STO 2nd MATRIX [B];
2nd MATRIX MATH *row+(−10,[B],2,1) STO 2nd MATRIX [C],
then MATH ENTER for fractional form
which corresponds to corner point B where
( ) ( )
50
i. (𝑥, 𝑦) = 3
,0 and (𝑠1 , 𝑠2 ) = 0, 50
3
( ) ( )
ii. (𝑥, 𝑦) = 0, 50
3
and (𝑠1 , 𝑠2 ) = 25
3
,0
1. A first look.
Maximize 6x + 4y
subject to x + 2y ≤ 8
2x + y ≤ 10
x ≥ 0
y ≥ 0
Section 2. The Simplex Algorithm (LECTURE NOTES 5) 79
y
(0,10)
x + 2y _ 8,
<
2x + y = 10 (s2 zero) 2x + y <
_ 10,
8
x _> 0,
y _> 0
6
(0,4)
C
(4,2)
2 feasible
region x + 2y = 8
x
2 4 6 10
(0,0) (8,0)
(5,0)
A D
B
𝑥 𝑦 𝑠1 𝑠2 𝑓
1
𝑅 →𝑅2 ,
2 2
𝑅1 −𝑅2 →𝑅1 , 𝑅3 +6𝑅2 →𝑅3 0 1.5 1 -0.5 0 3
−→
1 0.5 0 0.5 0 5
0 -1 0 3 1 30
2nd MATRIX MATH *row(1/2,[A],2) STO 2nd MATRIX [B]
2nd MATRIX MATH *row+(−1,[B],2,1) STO 2nd MATRIX [C]
2nd MATRIX MATH *row+(6,[C],2,3) STO 2nd MATRIX [D].
which corresponds to corner point B where
i. (𝑥, 𝑦) = (0, 0), (𝑠1 , 𝑠2 ) = (3, 0) and 𝑓 = 30
ii. (𝑥, 𝑦) = (5, 0), (𝑠1 , 𝑠2 ) = (3, 0) and 𝑓 = 30
objective function 𝑓 has decreased / increased from 𝑓 = 0 to 𝑓 = 30
(d) Corner point B to C.
3
Pivot with smallest quotient 1.5
= 2 and most negative indicator −1,
𝑥 𝑦 𝑠1 𝑠2 𝑓
3
0 1.5 1 -0.5 0 3 Quotient: 1.5
≈2
5
1 0.5 0 0.5 0 5 Quotient: 0.5
= 10
0 -1 0 3 1 30
𝑥 𝑦 𝑠1 𝑠2 𝑓
2
1
𝑅 →𝑅1 ,
1.5 1
𝑅2 −0.5𝑅1 →𝑅2 , 𝑅3 +𝑅1 →𝑅3 0 1 3
− 13 0 2
−→
1 0 − 13 2
3
0 4
2 8
0 0 3 3
1 32
2nd MATRIX MATH *row(1/1.5,[D],1) STO 2nd MATRIX [E];
2nd MATRIX MATH *row+(−0.5,[E],1,2) STO 2nd MATRIX [F];
2nd MATRIX MATH *row+(1,[F],1,3) STO 2nd MATRIX [G].
which corresponds to corner point C where
i. (𝑥, 𝑦) = (4, 0), (𝑠1 , 𝑠2 ) = (0, 2) and 𝑓 = 32
ii. (𝑥, 𝑦) = (4, 2), (𝑠1 , 𝑠2 ) = (0, 0) and 𝑓 = 32
objective function 𝑓 has decreased / increased from 𝑓 = 30 to 𝑓 = 32.
This is optimal solutions because all indicators are nonnegative.
(e) Smallest quotient rule: Corner A to corner B or infeasible D.
10
True / False. Pivoting on element 2, with minimum quotient 2
= 5,
𝑥 𝑦 𝑠1 𝑠2 𝑓
8
1 2 1 0 0 8 Quotient: 1
=8
10
2 1 0 1 0 10 Quotient: 2
= 5, minimum
-6 -4 0 0 1 0
results in matrix with corresponding feasible corner point B,
Section 2. The Simplex Algorithm (LECTURE NOTES 5) 81
𝑥 𝑦 𝑠1 𝑠2 𝑓
1
𝑅 →𝑅2 ,
2 2
𝑅1 −𝑅2 →𝑅1 , 𝑅3 +6𝑅2 →𝑅3 0 1.5 1 -0.5 0 3
−→
1 0.5 0 0.5 0 5
0 -1 0 3 1 30
whereas pivoting on element 1,
𝑥 𝑦 𝑠1 𝑠2 𝑓
8
1 2 1 0 0 8 Quotient: 1
=8
10
2 1 0 1 0 10 Quotient: 2
= 5, minimum
-6 -4 0 0 1 0
results in matrix with corresponding infeasible point D,
𝑥 𝑦 𝑠1 𝑠2 𝑓
𝑅2 −2𝑅1 →𝑅2 , 𝑅3 +6𝑅1 →𝑅3 1 2 1 0 0 8
−→
0 -3 -2 1 0 -6
0 8 6 0 1 48
In other words, pivot using smallest quotient rule to ensure feasibility.
2. Another problem.
Maximize 4x + 2y + 3z
subject to 0.1x + 0.25y ≤ 40
0.22x + 0.3y + 0.4z ≤ 100
x ≥ 0
y ≥ 0
z ≥ 0
𝑥 𝑦 𝑧 𝑠1 𝑠2 𝑓
0.1 0.25 0 1 0 0 40 Quotient:
0.22 0.3 0.4 0 1 0 100 Quotient:
-4 −2 −3 0 0 1 0
Type this 3 by 7 table into MATRIX [A]; use 2nd MATRIX EDIT.
Pivot column, most negative indicator, is column 𝒙 / 𝒚 / 𝒛 / 𝒔1 / 𝒔2
Pivot row, smallest quotient, is row 𝑹1 / 𝑹2
So pivot element: 0.1 / 0.22 / 0.25
(b) Next corner point.
82 Chapter 5. Linear Programming: The Simplex Method (LECTURE NOTES 5)
1
𝑅 →𝑅1 ,
0.1 1
𝑅2 −0.22𝑅1 →𝑅2 , 𝑅3 +4𝑅1 →𝑅3
−→
𝑥 𝑦 𝑧 𝑠1 𝑠2 𝑓
1 2.5 0 10 0 0 400 Quotient:
0 -0.25 0.4 -2.2 1 0 12 Quotient:
0 8 -3 40 0 1 1600
2nd MATRIX MATH *row(1/0.1,[A],1) STO 2nd MATRIX [B]
2nd MATRIX MATH *row+(−0.22,[B],1,2) STO 2nd MATRIX [C]
2nd MATRIX MATH *row+(4,[C],1,3) STO 2nd MATRIX [D].
Pivot column, most negative indicator, is column 𝒙 / 𝒚 / 𝒛 / 𝒔1 / 𝒔2
Pivot row, smallest quotient4 , is row 𝑹1 / 𝑹2
So pivot element: −0.25 / 0 / 0.4
(c) Final corner point.
1
𝑅 →𝑅2 ,
0.4 2
𝑅3 +3𝑅2 →𝑅3
−→
𝑥 𝑦 𝑧 𝑠1 𝑠2 𝑓
1 2.5 0 10 0 0 400
0 -0.6 1 -5.5 2.5 0 30
0 6.1 0 23.5 7.5 1 1690
2nd MATRIX MATH *row(1/0.4,[D],2) STO 2nd MATRIX [E]
2nd MATRIX MATH *row+(3,[E],2,3) STO 2nd MATRIX [F].
Point (𝑥, 𝑦, 𝑧) = (400, 30, 0) / (0, 30, 400) / (400, 0, 30),
with optimal (maximum) 𝑓 = 400 / 1600 / 1690
because all indicators nonpositive / zero / nonnegative
(d) Since this problem involves three variables, (𝑥, 𝑦, 𝑧), rather than two (𝑥, 𝑦),
easy / difficult to solve using geometric method.
3. Acme party problem.
Maximize x + y
subject to 25x + 15y ≤ 250
20x + 10y ≤ 175
x ≥ 0
y ≥ 0
y y
20 20
20x + 10y = 175 20x + 10y = 175
(0, 50/3) constraints or feasible set (0, 50/3) constraints or feasible set
16 20x + 10y ≤ 175, 16 20x + 10y ≤ 175,
2 (5/2, 25/2) 25x + 15y ≤ 250, 4 (5/2, 25/2) 25x + 15y ≤ 250,
12 x ≥ 0, 12 x ≥ 0,
y ≥ 0 3 y ≥ 0
8 8
0 x 0 x
0 2 4 6 8 10 0 2 4 6 8 10
(0,0) (0,0)
(35/4, 0) (35/4, 0)
1 1 2
4
Ignore undefined quotient, so 𝑅1 has smallest quotient by default.
Section 2. The Simplex Algorithm (LECTURE NOTES 5) 83
-3x + 2y = 5
y 10
6 4x - 3y = 9
-3x + 2y <_ 5,
4 4x - 3y <_ 9,
x _> 0,
(0, 5/2) y _> 0
2
(9/4, 0)
(0,0) 2 4 6 8 10
x
Maximize 6x + 3y
subject to x + 2y ≤ 8
2x + y ≤ 10
x ≥ 0
y ≥ 0
10
y
2x + y = 10
8 constraints or feasible set
x + 2y ≤ 8,
6 2x + y ≤ 10,
x ≥ 0,
y ≥ 0
(0,4) 4
(4,2) 3
2
x + 2y = 8
x
(0,0) 2 4 6 8 10
(5,0)
1 2 4
Type this 3 by 6 table into MATRIX [A]; use 2nd MATRIX EDIT.
Pivot column, most negative indicator, is column 𝒙 / 𝒚
Pivot row, smallest nonnegative quotient, is row 𝑹1 / 𝑹2
So pivot element: 1 / 2 / 4
(c) Next corner.
1
𝑅 →𝑅2 ,
2 2
𝑅1 −𝑅2 →𝑅1 , 𝑅3 +6𝑅2 →𝑅3
−→
𝑥 𝑦 𝑠1 𝑠2 𝑓
0 1.5 1 -0.5 0 3 Quotient
1 0.5 0 0.5 0 5 Quotient
0 0 0 3 1 30
2nd MATRIX MATH *row(1/2,[A],2) STO 2nd MATRIX [B]
2nd MATRIX MATH *row+(−1,[B],2,1) STO 2nd MATRIX [C].
2nd MATRIX MATH *row+(6,[C],2,3) STO 2nd MATRIX [D]
Point (𝑥, 𝑦) = (5, 0) / (0, 5)
with optimal (maximum) 𝑓 = 0 / 30
because all indicators nonpositive / zero / nonnegative
However nonbasic 𝑦 column has zero indicator,
indicating another corner just “as optimal”.
Pivot column, zero indicator, is column 𝒙 / 𝒚
Pivot row, smallest nonnegative quotient, is row 𝑹1 / 𝑹2
So pivot element: 0.5 / 1.5 / 4
(d) Next corner along edge.
1
𝑅 →𝑅1 ,
1.5 1
𝑅2 −0.5𝑅1 →𝑅2 , 𝑅3 +0𝑅1 →𝑅3
−→
𝑥 𝑦 𝑠1 𝑠2 𝑓
0 1 2/3 -1/3 0 2 Quotient
1 0 -1/3 2/3 0 4 Quotient
0 0 0 3 1 30
2nd MATRIX MATH *row(1/1.5,[D],2) STO 2nd MATRIX [E]
2nd MATRIX MATH *row+(−0.5,[E],2,1) STO 2nd MATRIX [F].
2nd MATRIX MATH *row+(0,[F],2,3) STO 2nd MATRIX [G]
Point (𝑥, 𝑦) = (2, 4) / (4, 2)
with optimal (maximum) 𝑓 = 0 / 30
because all indicators nonpositive / zero / nonnegative
Pivot column, zero indicator, is column 𝒚 / 𝒔1
Pivot row, smallest nonnegative quotient, is row 𝑹1 / 𝑹2
So pivot element: 13 / 32 / 1
Pivoting returns to corner (5,0), so edge between (5,0) and (4,2) optimal.
6. Using EXCEL.
Section 2. The Simplex Algorithm (LECTURE NOTES 5) 87
Maximize 6x + 4y
subject to x + 2y ≤ 8
2x + y ≤ 10
x ≥ 0
y ≥ 0
=6*D2 + 4*D3
2
=D2 + 2*D3
=2*D2 + D3
5
4
(d) Step 4. Click on Add, then type in information in Add Constraints pop up
box as given in figure. Click Add after each constraint, then Cancel when
done.
(e) Step 5. Click on Options and check both Assume Linear Model and Assume
Non-Negative.
(f) Step 6. Click on Solve.
(g) Step 7. Observe solution, which should be (𝑥, 𝑦) = (4, 2), where objective
function 𝑓 maximum at value 32.