The Simplex Method
The Simplex Method
For each component 𝑤 > 0, compute the ra o 𝑥 ⁄𝑤 . Choose 𝑖 that corresponds to the
smallest such ra o.
Objec ve func on
2𝑥 + 𝑥 ≤ 70 (2)
𝑥 + 𝑥 ≥ 40 (3)
𝑥 + 3𝑥 = 90 (4)
Note
𝑥 + 𝑥 ≥ 40
Can be converted to
−𝑥 − 𝑥 ≤ −40
1
Numerical Recipes 3rd Edi on: The Art of Scien fic Compu ng, Press, William H.; Teukolsky, Saul A.;
Ve erling, William T.; Flannery, Brian P.
Now
2𝑥 + 𝑥 ≤ 70 (5)
−𝑥 − 𝑥 ≤ −40 (6)
𝑥 + 3𝑥 = 90 7
Or, adding the slack variables
2𝑥 + 𝑥 + 𝑥 = 70 8
−𝑥 − 𝑥 + 𝑥 = −40 (9)
𝑥 + 3𝑥 + 𝑥 = 90 (10)
𝑨𝒙 = 𝒃
Par on A
𝑨 = [𝑨 |𝑨 ]
where
1 0 0 2 1
𝑨 = 0 1 0 , 𝑨 −1 −1
0 0 1 1 3
First, replace 𝑥 coefficients with 𝑥 coefficients (𝑥 coefficients would work just as well)
1 0 1
𝑨 = 0 1 −1
0 0 3
The inverse is
1 0 −1⁄3
𝑨 = 0 1 1⁄3
0 0 1⁄3
And
𝑥 1 0 −1⁄3 70 40
𝒙 = 𝑥 =𝑨 ∙ 𝒃 = 0 1 1⁄3 −40 = −10
𝑥 0 0 1⁄3 90 30
This solu on is not feasible because 𝑥 ≱ 0.
Now we replace the objec ve func on with a so-called auxiliary objec ve func on
𝑧 = 𝒄 . 𝒙 = −𝑥
i.e,
𝒄 = {0 −1 0}
We now compute the reduced costs using
𝑢 =𝑐 −𝒂 ∙𝒚
where
𝒚 ≡ (𝑨 )𝑻 . 𝒄
Here, 𝑘 = 1,
𝑢 =𝑐 −𝒂 ∙𝒚
and
1 0 0 0 0
𝒚= 0 1 0 . −1 = −1
−1⁄3 1⁄3 1⁄3 0 −1⁄3
0
𝑢 = 0 − 𝒂 ∙ 𝒚 = 0 − {2 1 1}. −1 = − 2⁄3
−1⁄3
Because 𝑢 < 0, 𝑥 should enter the computa on and another 𝑥 should leave. To determine which
variable should leave we perform a minimum ra o test using
1 0 −1⁄3 2 5 ⁄3
𝑨 ∙ 𝒂𝟏 = 0 1 1⁄3 −1 = −2⁄3
0 0 1⁄3 1 1 ⁄3
Ra os
40 −10 30
= 24, = 15, = 90
5 ⁄3 − 2⁄3 1 ⁄3
The middle number is associated with 𝑥 and is the minimum ra o so 𝑥 goes out.
1 2 1 1 5⁄2 1 ⁄2
𝑨 = 0 −1 −1 , 𝑨 = 0 −3⁄2 −1⁄2
0 1 3 0 1⁄2 1 ⁄2
𝑥 1 5⁄4 1 ⁄2 70 15
𝒙 = 𝑥 =𝑨 ∙𝒃= 0 −1⁄4 −1⁄2 −40 = 15
𝑥 0 1⁄2 1 ⁄2 90 25
All variables are posi ve, so the solu on is feasible, and we enter phase II
Now
𝑐 0
𝒄 = 𝑐 = −40
𝑐 −60
1 0 0 0 0
𝒚 = (𝑨 )𝑻 .𝒄 = 5 ⁄ 2 −3⁄2 1⁄2 . −40 = 30
1⁄2 −1⁄2 1⁄2 −60 −10
0
𝑢 = 𝑐 − 𝒂 ∙ 𝒚 = 0 − {0 1 0} ∙ 30 = −30
−10
This result says that 𝑥 should reenter.
𝑐 0
𝒄 = 𝑐 = −40
𝑐 −60
0.4 0.6 −0.2 0 −12
𝒚 = (𝑨 )𝑻 . 𝒄 = 1 0 0 . −40 = 0
0.2 −0.2 0.4 −60 −16
−12
𝑢 = 𝑐 − 𝒂 ∙ 𝒚 = 0 − {1 0 0} ∙ 0 = 12
−16
As 𝑢 > 0, we have found the op mum solu on: 𝑥 = 24, 𝑥 = 22, and 𝑥 = 6
2𝑥 + 𝑥 = 70 ≤ 70
𝑥 + 𝑥 = 46 ≥ 40
𝑥 + 3𝑥 = 90 = 90
𝑥 >0
𝑥 >0