Download as pdf or txt
Download as pdf or txt
You are on page 1of 65

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:

We have m = 2 equations and n = 4 variables


The (maximum) number of basic solutions is
𝑛 𝑛! 4 4!
𝑚
= → 2
= =6
𝑚! 𝑛−𝑚 ! 2! 4−2 !
Simplex Method
• Rather than enumerating all the basic
solutions (corner points) of the LP problem,
the simplex method investigates only a
“select few” of these solutions.
• The simplex method always starts at the
origin where all the decision variables, 𝑥𝑗 , j =
1, 2, …, n, are zero.
• Point A is the origin (𝑥1 = 𝑥2 = 0) and the
associated objective value, z, is zero.
Simplex Method
Consider the Reddy Miks model
Simplex Method

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

For Pivot row


a. Replace the leaving variable in the Basic column with the entering variable
b. New pivot row = Current pivot row ÷ Pivot element

For All other rows, including z


New row = (Current row) – (Pivot column coefficient) × (New pivot row)
Simplex Method
Simplex Method
Simplex Method
The new basic solution is (𝑥1 , 𝑠2 , 𝑠3 , 𝑠4 ), and the new tableau

• Choose 𝑥2 as the entering variable.


• Compute ratio as the following table.

𝑠2 as the leaving variable


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

Initial feasible solution:


x1 = 0, x2 = 0, s1 = 24, s2 = 6, s3 = 1, s4 = 2, z = 0

→ 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)

s4 = 2 – x2 → zero denominator, ignore

Increase x1 up to 4.
s1 leaves the basis.
Simplex Method
without tableau
Basic variables:
➔ 6x1 = 24 – s1 - 4x2 ➔ s4 = 2 – x2

24− 𝑠1 −4𝑥2 ➔ z = 4 (4 - 2Τ3x2 − 1Τ6s1) + 5x2


𝑥1 =
6
z = 16 − 8Τ3x2 - 4Τ6s1 + 5x2
x1 = 4 - 2Τ3x2 − 1Τ6s1
z = 16 + 7Τ3 x2 - 2Τ3s1
➔ s2 = 6 - (4 - 2Τ3x2 − 1Τ6s1) – 2x2

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:

x1 = 4 - 2Τ3x2 − 1Τ6s1 → 4 - 2Τ3x2 ≥ 0 → x2 ≤ 6

s2 = 2 − 4Τ3x2 + 1Τ6s1 → 2 − 4Τ3x2 ≥ 0 → x2 ≤ 3Τ2 (most stringent)

s3 = 5 − 5Τ3x2 - 1Τ6s1 → 5 − 5Τ3x2 ≥ 0 → x2 ≤ 3

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

x2 = 3Τ4 (2 + 1Τ6s1 – s2) s3 = 5 − 5Τ2 − 5Τ24 𝑠1 + 5Τ4 𝑠2 - 1Τ6 𝑠1

x2 = 3Τ2 + 1Τ8s1 – 3Τ4s2 s3 = 5Τ2 − 3Τ8 𝑠1 + 5Τ4 𝑠2

➔ x1 = 4 - 2Τ3 3Τ2 + 1Τ8 𝑠1 – 3Τ4 𝑠2 − 1Τ6s1 ➔ s4 = 2 – (3Τ2 + 1Τ8 𝑠1 – 3Τ4 𝑠2 )

x1 = 4 – 1 - 2Τ24 𝑠1 + 6Τ12 𝑠2 − 1Τ6 s1


s4 = 1Τ2 − 1Τ8 𝑠1 + 3Τ4 𝑠2 )
x1 = 3 - 1Τ4 𝑠1 + 1Τ2 𝑠2
Simplex Method
without tableau
➔ z = 16 + 7Τ3 (3Τ2 + 1Τ8 𝑠1 – 3Τ4 𝑠2 ) - 2Τ3 𝑠1

z = 16 + 7Τ2 + 7Τ24 𝑠1 – 7Τ4 𝑠2 - 2Τ3 𝑠1

z = 39Τ2 − 3Τ8 𝑠1 – 7Τ4 𝑠2

Stop ! (the coefficient of s1 and s2 are negative)

The Optimal Solution:

x1 = 3, x2 = 𝟑Τ𝟐, s1 = 0, s2 = 0, s3 = 𝟓Τ𝟐, s4 = 𝟏Τ𝟐, z = 𝟑𝟗Τ𝟐


Simplex Method
Artificial Starting Solution

▪ 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

▪ Assign artificial variable objective function coefficient:

▪ M is a sufficiently large positive value (mathematically, M → ∞).

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.

New z-row = −4𝑥1 − 𝑥2 − 100𝑅1 − 100𝑅2 + (100(3𝑥1 + 𝑥2 + 𝑅1 ) + 100(4𝑥1 + 3𝑥2 − 𝑥3 + 𝑅2 ))


New z-row = −4𝑥1 − 𝑥2 − 100𝑅1 − 100𝑅2 + (300𝑥1 + 100𝑥2 + 100𝑅1 + 400𝑥1 + 300𝑥2 − 100𝑥3 + 100𝑅2 )
New z-row = 696𝑥1 + 399𝑥2 − 100𝑥3
Simplex Method
M-Method

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

Continuing with the simplex computations to reach the optimum:


2 9 17
𝑥1 = , 𝑥2 = , 𝑧 =
5 5 5
Simplex Method
Two-Phase Method

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

As in M-method, we need to change r-row.

The new r-row is used to solve Phase I of the problem.


Simplex Method
Two-Phase Method

The optimum tableau:

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

The original problem:


Simplex Method
Two-Phase Method

Change the z-row

The entering variable → 𝑥3


Sensitivity Analysis
• In LP, the parameters (input data) of the model can change within certain
limits without causing changes in the optimum.
• This is referred to as sensitivity analysis
Sensitivity Analysis
Two cases will be considered:
1. Sensitivity of the optimum solution to changes in the availability of the
resources (right-hand side of the constraints).
2. Sensitivity of the optimum solution to changes in unit profit or unit cost
(coefficients of the objective function).
Sensitivity Analysis
Changes in the Right-Hand side
JOBCO manufactures two products on two machines. A unit of product 1 requires 2 hrs on
machine 1 and 1 hr on machine 2. For product 2, one unit requires 1 hr on machine 1 and 3 hrs
on machine 2. The revenues per unit of products 1 and 2 are $30 and $20, respectively. The total
daily processing time available for each machine is 8 hrs.

→ Letting 𝑥1 and 𝑥2 represent the daily number of units of products 1 and 2, respectively.
Sensitivity Analysis
Changes in the Right-Hand side

This figure illustrates the change in the


optimum solution when changes are made in
the capacity of machine 1.
Sensitivity Analysis
Changes in the Right-Hand side
• If the daily capacity is increased from 8 to 9 hrs,
the new optimum will move to point G.
• The rate of change in optimum z resulting from
changing machine 1 capacity from 8 to 9 hrs can
be computed as:

• The computed rate provides a direct link between the model


input (resources) and its output (total revenue).
• It says that a unit increase (decrease) in machine 1 capacity
will increase (decrease) revenue by $14.
Sensitivity Analysis
Changes in the Right-Hand side
• $14/hr remains valid for changes (increases or decreases) in machine 1 capacity
that move its constraint parallel to itself to any point on the line segment BF.
• Can be called dual (or shadow) price
• Dual price → the rate of change of the objective function per unit change of a
resource.
• We compute machine 1 capacities at points B and F as follows:
Sensitivity Analysis
Changes in the Right-Hand side
• Using similar computations, we can verify that the dual price for machine 2
capacity is $2/hr
• We compute machine 2 capacities at points B and F as follows:

→ The limits for machine 1 and 2 are referred to as the


feasibility ranges.
Sensitivity Analysis
Changes in the Right-Hand side
→ The dual prices allow making economic decisions about the LP problem, as the following
questions demonstrate:
Sensitivity Analysis
Changes in the Right-Hand side
→ The dual prices allow making economic decisions about the LP problem, as the following
questions demonstrate:
Sensitivity Analysis
Changes in the Objective coefficients
• The optimum occurs at point C (𝑥1 = 3.2, 𝑥2 = 1.6, z = 128).
• Changes in revenue units (i.e., objective-function coefficients) will change
the slope of z.
• Consider the standard form of the objective function:

• 𝑧 = 𝑐1 𝑥1 + 𝑐2 𝑥2 lies between the two lines 𝑥1 + 3𝑥2 = 8 and 2𝑥1 + 𝑥2 = 8.


𝑐 1 2
• This means that the ratio 𝑐1 can vary between 3 and 1 , which yields the
2
following optimality range
Sensitivity Analysis
Changes in the Objective coefficients
→ This information can provide immediate answers regarding the optimum solution as the following
questions demonstrate:
Question 1. Suppose that the unit revenues for products 1 and 2 are changed to $35 and $25,
respectively. Will the current optimum remain the same?
The new objective function is maximize 𝑧 = 35𝑥1 + 25𝑥2 .
𝑐 35
The solution at C will remain optimal because 𝑐1 = 25 = 1.4 remains within the optimality range
2
(.333, 2).
When the ratio falls outside this range, additional calculations are needed to find the new optimum
(discussed in the next lecturer).
Notice that although the values of the variables at the optimum point C remain unchanged, the
optimum value of z changes to 35*(3.2) + 25*(1.6) = $152.
Sensitivity Analysis
Changes in the Objective coefficients
→ This information can provide immediate answers regarding the optimum solution as the following
questions demonstrate:
Simplex Method
Special Cases

• 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

Any point on the line segment BC


represents an alternative optimum with the
same objective value z = 10.
Simplex Method
Special Cases – Unbounded Solution

• Tidak ada variabel pembatas.


• Hasil fungsi tujuan bertambah (maksimasi) atau berkurang (minimasi) tanpa batas.
Simplex Method
Special Cases – Infeasible Solution

• LP models with inconsistent constraints have no feasible solution


• This situation does not occur if all the constraints are of the type ≤ with nonnegative right-
hand sides
Simplex Method
Special Cases – Infeasible Solution
Homework
(dikumpulkan minggu depan)

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. Solve the problem by simplex method (with tableau)

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

You might also like