OR1 3 Simplex Method
OR1 3 Simplex Method
OR1 3 Simplex Method
Outline
• Simplex Method
Simplex Method
→ An algorithm to solve LP
→ Developed by George B. Dantzig (1914-2005).
Standard form
Max/min
s.t.
Standard form in Matrix Form
Max/min
s.t.
Simplex Method:
Standard LP form
Properties:
1. Semua konstrain adalah persamaan dengan nilai bukan
negatif pada sisi kanan (nonnegative)
2. Semua variabel bernilai bukan negatif (nonnegative)
Steps:
1. Mengkonversi pertidaksamaan menjadi persamaan dengan
nilai bukan negatif (nonnegative) pada sisi kanan
2. Mengkonversi unrestricted variabel menjadi bukan negatif
(nonnegative) variabel
Simplex Method:
SLACK, SURPLUS, and Unrestricted variable
➢SLACK variable (𝒔𝟏 ):
- Variable yang menyatakan penggunaan jumlah kelebihan resources
(unused resources) untuk menjadikan konstrain bertanda kurang dari (≤)
menjadi persamaan (=).
- Contoh: 6𝑥1 + 4𝑥2 ≤ 24 → 6𝑥1 + 4𝑥2 + 𝑠1 = 24; 𝑠1 ≥ 0
➢SURPLUS / excess variable (𝑺𝟏 ):
- Variable yang menyatakan penyerapan persamaan sisi kiri untuk
memenuhi batasan minimum resources sehingga menjadikan konstrain
bertanda lebih dari (≥) menjadi persamaan (=).
- Contoh: 𝑥1 + 𝑥2 ≥ 800 → 𝑥1 + 𝑥2 - 𝑆1 = 800; 𝑆1 ≥ 0
Simplex Method:
SLACK, SURPLUS, and Unrestricted variable
➢Unrestricted variable:
- Variable yang tidak memiliki batasan, dapat bernilai berapapun [(+); 0;
atau (-)], dapat menggunakan slack dan surplus variable, secara
matematis tidak jelas.
- Maka unrestricted var. 𝑥𝑗 perlu diubah menjadi 𝑥𝑗+ dan 𝑥𝑗− ; 𝑥𝑗+ , 𝑥𝑗− ≥ 0
- Contoh: 𝑥3 𝑢𝑛𝑟𝑒𝑠𝑡𝑟𝑖𝑐𝑡𝑒𝑑 𝑣𝑎𝑟. → 𝑥3 = 𝑥3+ − 𝑥3− ; 𝑥3+ , 𝑥3− ≥ 0
Simplex Method:
Standard LP form
Simplex Method:
Beberapa definisi
• Basic Variable: Non zero-valued variable of basic solution
• Non Basic Variable: Zero-valued variable of basic solution
• Basic Solutions: Solution obtained from standard LP with at most m
non-zero
• Basic Feasible Solutions
- a basic solution that is feasible
𝑛 𝑛! 𝑛 = 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒
- at most 𝑚
= ;𝑛 >𝑚 𝑚 = 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑐𝑜𝑛𝑠𝑡𝑟𝑎𝑖𝑛𝑡
𝑚! 𝑛−𝑚 !
- One of such solutions yields optimum if it exists
• Adjacent basic feasible solution: differs from the present basic
feasible solution in exactly one basic variable
Simplex Method:
Transition from graphical to algebraic solution
Example
Consider the following LP with two variables:
Simplex tableau
𝑥1 , 𝑥2 = non
basic variables
𝑠1 , 𝑠2 , 𝑠3 , 𝑠4 =
basic variables
• To improve z value, increase the value of nonbasic
variable 𝑥1 or 𝑥2 .
• For maximization problem, select the nonbasic variable
with the most negative coefficient in the objective
function equation. → simplex optimality condition rule.
• Then, choose 𝑥1 . → called entering variable because it
enters the basic solution.
• One of the current basic variables must leave.
• To determine the leaving variable, compute the ratios of
the Solution column to the corresponding (strictly)
positive constraint coefficients under the entering
variable.
Simplex Method
Simplex Method
4 1 4 1 3 3
(0 0 - 6 1 0 0 2) ÷ = (0 0 1 - 8 0 0 2)
3 3 4
2 5 2 1 3 3 5 1 5 1 3 3
(1 0 - 3 0 0 0 20) – (- 3 ) x (0 0 1 - 8 0 0 2) (0 0 0 1 0 5) – (3) x (0 0 1 - 8 0 0 2)
6 4 3 6 4
1 3 3
2 1 (0 0 1 0 0 0 2) – (1) x (0 0 1 - 8 0 0 2)
(0 1 3 6
0 0 0 4) 4
2 1 3 3
(3) (0 0 1-8 4 0 0 2)
Simplex Method
→ None of the z-row coefficients are negative. Hence, the last tableau is optimal.
Simplex Method
Optimality condition
▪ Maximization problem
- The entering variable is the nonbasic variable with the most negative coefficient in the z-row.
- The optimum is reached at the iteration where all the z-row coefficients are nonnegative.
▪ Minimization problem
- The entering variable is the nonbasic variable with the most positive coefficient in the z-row.
- The optimum is reached at the iteration where all the z-row coefficients are nonpositive.
Feasibility condition
→ For both the maximization and the minimization problems, the leaving variable is the basic
variable associated with the smallest nonnegative ratio with strictly positive denominator.
Simplex Method
without tableau
→ The entering variable is the nonbasic variable with the least positive z-row coefficient.
Simplex Method
without tableau
Iteration 1
The least positive z-row coefficient is x1. → The entering variable is x1.
We have to increase x1. Feasibility of s1, s2, s3, s4:
s1 = 24 – 6x1 - 4x2 → 24 – 6x1 ≥ 0 → x1 ≤ 4 (most stringent)
s2 = 6 – x1 – 2x2 → 6 – x1 ≥ 0 → x1 ≤ 6
s3 = 1 + x1 – x2 → 1 + x1 ≥ 0 → x1 ≤ -1 (ignore)
Increase x1 up to 4.
s1 leaves the basis.
Simplex Method
without tableau
Basic variables:
➔ 6x1 = 24 – s1 - 4x2 ➔ s4 = 2 – x2
s2 = 2 − 4Τ3x2 + 1Τ6s1 x1 = 4, x2 = 0, s1 = 0, s2 = 2, s3 = 5, s4 = 2, z = 16
➔ s3 = 1 + 4 − 2Τ3x2 - 1Τ6s1 – x2
s3 = 5 − 5Τ3x2 - 1Τ6s1
Simplex Method
without tableau
Iteration 2
Choosing x2 as the entering variable. We have to increase x2.
Feasibility of x1, s2, s3, s4:
s4 = 2 – x2 → 2 – x2 ≥ 0 → x2 ≤ 2
Increase x2 up to 3Τ2.
s2 leaves the basis.
Simplex Method
without tableau
Basic variables:
➔ 4Τ3x2 = 2 + 1Τ6s1 – s2 ➔ s3 = 5 − 5Τ3 (3Τ2 + 1Τ8 𝑠1 – 3Τ4 𝑠2 ) - 1Τ6 𝑠1
▪ LPs in which all the constraints are (≤) with nonnegative right-hand sides offer a
convenient all-slack starting basic feasible solution.
▪ Models involving (≥) and/or (=) constraints do not.
▪ The procedure for starting LPs with (≥) and/or (=) constraints is to use artificial
variables that play the role of slacks at the first iteration.
▪ The artificial variables are then disposed of at a later iteration.
▪ Two closely related methods are introduced here: the M-method and the two-phase
method.
Simplex Method
M-Method
The third equation has its slack The starting basic solution is
variable, 𝑥4 , but the first and (𝑅1 , 𝑅2 , 𝑥4 ) = (3, 6, 4).
second equations do not.
Simplex Method
M-Method
Suppose that M = 100
→ With (𝑅1 , 𝑅2 , 𝑥4 ) = (3, 6, 4), then z should be (100*3) + (100*6) + (0*4) = 900
→ We need to change z-row.
Entering variable → for minimization problem, the most positive coefficient in z-row → 𝑥1
Leaving variable → the minimum ratio → 𝑅1
Simplex Method
M-Method
Entering variable → 𝑥2
Leaving variable → 𝑅2
Phase I: Put the problem in equation form, and add the necessary artificial variables to the
constraints (exactly as in the M-method) to secure a starting basic solution. Next, find a basic
solution of the resulting equations that always minimizes the sum of the artificial variables,
regardless of whether the LP is maximization or minimization. If the minimum value of the
sum is positive, the LP problem has no feasible solution. Otherwise, proceed to Phase II.
Phase II: Use the feasible solution from Phase I as a starting basic feasible solution for the original
problem.
Simplex Method
Two-Phase Method
Simplex Method
Two-Phase Method
3 6
Phase I produces the basic feasible solution 𝑥1 = 5 , 𝑥2 = 5 , 𝑥4 = 1.
Simplex Method
Two-Phase Method
Phase II
→ Delete the artificial columns
→ Letting 𝑥1 and 𝑥2 represent the daily number of units of products 1 and 2, respectively.
Sensitivity Analysis
Changes in the Right-Hand side
• Degeneracy
• Alternative Optima
• Unbounded Solutions
• Nonexisting (or infeasible) solutions
Simplex Method
Special Cases - Degeneracy
• In the application of the feasibility condition of the simplex method, a tie for the minimum
ratio may occur and can be broken arbitrarily.
• When this happens, at least one basic variable will be zero in the next iteration, and the new
solution is said to be degenerate.
• Degeneracy can cause the simplex iterations to cycle indefinitely, thus never terminating the
algorithm.
• At least one redundant constraint.
Simplex Method
Special Cases - Degeneracy
Simplex Method
Special Cases – Alternative Optima
• Fungsi tujuan paralel dengan salah satu konstrain yang paling menentukan solusi.
• Terdapat lebih dari satu solusi optimal.
Simplex Method
Special Cases – Alternative Optima
1. Consider the following LP problem. Solve the problem by the simplex method (without
tableau), where the entering variable is the nonbasic variable with the most positive z-
row coefficient.
Homework
(dikumpulkan minggu depan)
2 9 17
3. Continue to solve the M-method to reach the optimum: 𝑥1 = 5 , 𝑥2 = 5 , 𝑧 = .
5
4. Continue to solve the two-phase method.
Thank you
See you