The Simplex Method.1
The Simplex Method.1
The Simplex Method.1
Chapter 3
Understand the meaning of the word ‘simplex’ and logic of using the simplex method.
Convert an LP problem into its standard form by adding slack, surplus, and/or artificial variables.
Set up simplex tables and solve LP problems using the simplex algorithm.
Recognize special cases such as degeneracy, multiple optimal solutions, unbounded and infeasible solutions
1. Understand The Simplex method
In this method, the value of the objective function improves with each solution, and the optimum
solution is achieved in a finite number of steps.
As with the graphical method, the simplex method finds the most attractive corner of the feasible
region to solve the LP problem.
The path of the simplex algorithm always connects corner
points. In the present example, the path to the optimum is
A B C.
Simplex usually starts at the corner, which represents doing nothing. It moves to the neighboring corner that best improves
the solution. It does this repeatedly, making the greatest possible improvement each time. When no more improvements can be
made, the most attractive corner corresponding to the optimal solution has been found.
Problem 1
Consider the Reddy Mikks model (Problem 3, Chapter 2). Solve using Simplex mehod:
Maximize Z = 5 + 4
S.T
6 + 4 24
+2 6
- 1
2
, 0
Setting Up the Simplex Process
Step 1: Convert the LPP into standard form
The Initialization Process … transforms all the constraints to equality by introducing slack, surplus as follows:
Setting Up the Simplex Process
The Initialization Process … transform all the constraints to equality by introducing slack,
surplus as follows:
Constraint Type Variable to be added
+ Slack
- Surplus
= Do nothing
The slack variable represents the amount by which the left-hand side of the constraint falls short
of the right-hand side. The amount of surplus resources available for that constraint.
The surplus variable represents the amount by which the left-hand side of the constraint exceeds
the right-hand side.
For example, consider the constraint: 2x1 + 3x2 <= 5
We introduce a slack variable S1 and rewrite the constraint as: 2x 1 + 3x2 + S1 = 5
Similarly, for the constraint: 2X1 + 3X2 >= 5
We introduce a surplus variable S2 and rewrite the constraint as: 2X1 + 3X2 – S 2 = 5
Setting Up the Simplex Process
Example: Express the following LPP in the standard form:
Max Z = 2𝑥1+ 𝑥2 + 4𝑥3
Subject to the constraints:
-2𝑥1 + 4𝑥2 ≤ 4
𝑥1 + 2𝑥2 - 𝑥3 ≥ -15 First, Must be positive, so we multiply Constraint by -1, -𝑥1 - 2𝑥2 + 𝑥3 <= 15
2𝑥1 + 3𝑥3 ≤ 2
𝑥1 ≥ 0, 𝑥2 ≥ 0, 𝑥3 ≥ 0
Maximize Z = 5 + 4
=5+4+0+0+0+0
S.T S.T
6 + 4 24 6 + 4 24
+2 6 +2 = 6
1 - =1
2 2
, 0 , 0
Step 2: Re-write the objective function where all terms are on the Z side
For problem 1. Reddy Mikks”
=5+4+0+0+0+0 𝑍 −5 𝑋 1 −4 𝑋 2 − 0 𝑆 1 − 0 𝑆 2 − 0 𝑆 3 − 0 𝑆 4 =0
S.T
6 + 4 24
+2 = 6
- =1
2
, 0
Step 3: Construct the initial table (Table 1), For problem 1. Reddy Mikks The following
S.T
6 + 4 24
+2 = 6
- =1
2
, 0
R.H.S
Basic X1 X2 S1 S2 S3 S4
Solution
Z -5 -4 0 0 0 0 0
S1 6 4 1 0 0 0 24
S2 1 2 0 1 0 0 6
S3 -1 1 0 0 1 0 1
S4 0 1 0 0 0 1 2
Step 4: Deciding on Entering Variable (Pivot Column), leaving variable (Pivot Row), and the Pivot element
For the entering variable, in Maximization problem, The selection always will be the non-basic variable with the most
negative coefficient in the objective equation. In the terminology of the simplex algorithm is known as the Entering
Variable, and it will enter the basic solution as a new basic variable.
If is the entering variable, one of the current basic variables must becomes non-basic at the zero level. The mechanics for
determining the leaving variable calls for computing the ratios of the righthand side of the equations (Solution column) to the
corresponding (strictly) positive constraint coefficients under the entering variable (Solution/X1), as the following table
shows below the rule is that smallest non-negative value will be leaving variable.
The Pivot Element is the value where Pivot Column and Pivot Row intercept = 6
X1 R.H.S
Basic X2 S1 S2 S3 S4 Ratio
(Entering) Solution
Z -5 -4 0 0 0 0 0
S1 (Leaving) 6 4 1 0 0 0 24 24/6= 4
S2 1 2 0 1 0 0 6 6/1= 6
S3 -1 1 0 0 1 0 1 -
S4 0 1 0 0 0 1 2 -
Step 5: Construct the new iteration (table) by 1. Replacing the Leaving variable with the entering Variable,
and 2. Fill other rows using the following rules:
1. Replacing the Leaving variable with the entering Variable (New Pivot Row)
New pivot Row = old pivot Row divided by (/) the pivot element.
R.H.S
Basic X1 X2 S1 S2 S3 S4
Solution
Z
X1 1 0 0 0 4
S2
S3
S4
2. Fill in all other rows using the following rule:
Step 5:
New Row = – Coefficient in the Pivot column* (New pivot Row) + Old Row
New Z row = – (-5) New X1 Row + Current Z row
– (-5) (1 .67 .17 0 0 0 4) + (-5 -4 0 0 0 0 0) = (0 -.65
0.85 0 0 0 20)
New S2 row = – (1) * New X1 Row + Current S2 row
– (1) (1 .67 .17 0 0 0 4) + (1 2 0 1 0 0
6) = (0 1.33 -0.17 1 0 0 2)
New S3 row = – (-1) New X1 Row + Current S3 row
– (-1) (1 .67 .17 0 0 0 4) + (-1 1 0 0 1 0 1) = (0
1.67 0.17 0 1 0 5)
New S4 row = – (0) New X1 Row + Current S4 row
– (0) (1 .67 .17 0 0 0 4) + ( 0 1 0 0 0 1 2) = (0
1 0 0 0 1 2)
Basic X1 X2 S1 S2 S3 S4 R.H.S
Z 0 -0.67 0.85 0 0 0 20
X1 1 0 0 0 4
S2 0 1.33 -0.17 1 0 0 2
S3 0 1.67 0.17 0 1 0 5
S4 0 1 0 0 0 1 2
Step 6: Check for Optimality Condition (is this optimal solution?) If yes, STOP. If no, repeat from STEP 4).
The optimality condition test: IF none of the Z-row coefficients are negative, then this is an optimal solution; otherwise,
further iterations are needed so repeat from step 4.
As shown below the coefficient of X2 in Z Row = 0.67, Means it is not an optimal solution, we need o repeat from step 4.
We Decide on Entering Variable (Pivot Column), leaving variable (Pivot Row), and the Pivot element for the next iteration.
Z 0 -0.67 0.85 0 0 0 20
X1 1 0 0 0 4 6
S2 0 1.33 -0.17 1 0 0 2 1.5
(Leaving)
S3 0 1.67 0.17 0 1 0 5 3
S4 0 1 0 0 0 1 2 2
New X2 Row (New pivot Row ) = Current S2 Row / 1.34
This New Iteration 2, now we repeat Step 6 and Check for Optimality Condition
Since none of the Z-row coefficients are negative, then this is an optimal solution
X1=3
X2= 1.5
Z=21
Add slack variable to constraint 2. and change inequality sign to the equality sign
+ +
Step 2: Re-write the objective function where all terms are on the Z side.
Step 3: Construct the initial table (Table 1)
S.T
Basic X1 X2 X3 S1 S2 Solution
Z -8 -10 -7 0 0 0
S1 1 3 2 1 0 10
S2 1 5 1 0 1 8
Step 4: Deciding on Entering Variable (Pivot Column), leaving variable (Pivot Row), and the Pivot element
Entering variable: The non-basic variable with the most negative coefficient in the objective equation (X2).
Leaving Variable: Basic Variable with the smallest non-negative value in the Ratio column (S2)
Z -8 -10 -7 0 0 0
S1 1 3 2 1 0 10 3.33
S2 1 5 1 0 1 8 1.6
Step 5: Construct the new iteration (table) by 1. Replacing the Leaving variable with the entering Variable,
and 2. Fill other rows using the following rules:
1. New pivot Row = old pivot Row divided by (/) the pivot element.
New X2 Row (New pivot Row ) = Current S2 Row / 5
(1 5 1 0 1 8) / 5 = (0.2 1 0.2 0 0.2 1.6)
2. Fill in other rows using the following rule: New Row = – Coefficient in the Pivot column* (New pivot Row) + Old Row
Basic X1 X2 X3 S1 S2 Solution
Z
S1
X2
Step 6: Check for Optimality Condition (is this optimal solution?) If yes, STOP. If no, GO TO STEP 4).
The coefficient of X1= -6 and X3 =-5 in Z Row Means it is not an optimal solution, and we need to repeat from Step 4.
Step 4 (again): Deciding on Entering Variable (Pivot Column), leaving variable (Pivot Row), and the Pivot element
Entering variable: The non-basic variable with the most negative coefficient in the objective equation (X1).
Leaving Variable: Basic Variable with the smallest non-negative value in the Ratio column (X2)
2. Fill in other rows using the following rule: New Row = – Coefficient in the Pivot column* (New pivot Row) + Old Row
Step 1: Convert the problem into the standard form (Equalities) by Adding Slack variables
+ ++
Step 2: Re-write the objective function where all terms are on the Z side.
Step 3: Construct the initial table (Table 1)
Basic X1 X2 X3 S1 S2 S3 Solution
Z -3 -5 -4 0 0 0 0
S1 2 3 1 1 0 0 80
S2 0 2 6 0 1 0 100
S3 3 2 4 0 0 1 150
Step 4: Deciding on Entering Variable (Pivot Column), leaving variable (Pivot Row), and the Pivot element
Entering variable: The non-basic variable with the most negative coefficient in the objective equation (X2).
Leaving Variable: Basic Variable with the smallest non-negative value in the Ratio column (S1)
Basic X1 X2 X3 S1 S2 S3 Solution
Z -3 -5 -4 0 0 0 0 Ratio
S1 2 3 1 1 0 0 80 26.6
S2 0 2 6 0 1 0 100 50
S3 3 2 4 0 0 1 150 75
Step 5: Construct the new iteration (table) by 1. Replacing the Leaving variable with the entering Variable,
and 2. Fill other rows using the following rules:
1. New pivot Row = old pivot Row divided by (/) the pivot element.
New X2 Row (New pivot Row ) = Current S1 Row / 3
(2 3 1 1 0 0 80) / 3 = (0.67 1 0.33 0.33
0 0 26.67)
Basic X1 X2 X3 S1 S2 S3 Solution
Z
X2 0.67 1 0.33 0.33 0 0 26.67
S2
S3
2. Fill in all other rows using the following rule:
New Row = – Coefficient in the Pivot column* (New pivot Row) + Old Row
New Z row = – (-5) New X2 Row + Current Z row 5 New X2 Row + Current Z row
-(-5) (0.67 1 0.33 0.33 0 0 26.67) + (-3 -5 -
4 0 0 0 0) =
(0.33 0 -2.33 1.67 0 0 133.33)
New S2 row = -2 New X2 Row + Current S2 row
-2 (0.67 1 0.33 0.33 0 0 26.67) + (0 2 6
0 1 0 100)
= (-1.33 0 5.33 -0.67 1 0 46.67)
New S3 row = -2 New X2 Row + Current S3 row
-2 (0.67 1 0.33 0.33 0 0 26.67) + (3 2 4
0 0 1 150)
= (1.67 0 3.33 -0.67 0 1 96.67)
Basic X1 X2 X3 S1 S2 S3 Solution
Step 4: Deciding on Entering Variable (Pivot Column), leaving variable (Pivot Row), and the Pivot element
Entering variable: The non-basic variable with the most negative coefficient in the objective equation (X3).
Leaving Variable: Basic Variable with the smallest non-negative value in the Ratio column (X2)
Basic X1 X2 X3 S1 S2 S3 Solution
1. New pivot Row = old pivot Row divided by (/) the pivot element.
New X3 Row (New pivot Row ) = Current S2 Row / 5.33
(-1.33 0 5.33 -0.67 1 0 46.67) / 5.33 = (-0.25 0 1 -0.13 0.19
0 8.75)
Basic X1 X2 X3 S1 S2 S3 Solution
Z
X2
X3 -0.25 0 1 -0.13 0.19 0 8.75
S3
2. Fill in all other rows using the following rule:
New Row = Old Row – Coefficient in the Pivot column* (New pivot Row)
Or
New Row = – Coefficient in the Pivot column* (New pivot Row) + Old Row
New Z row = – (-2.33) New X3 Row + Current Z row 2.33 New X3 Row + Current Z row
- (-2.33) (-0.25 0 1 -0.13 0.19 0 8.75) + (0.33 0 -2.33 1.67
0 0 133.33)
= (-.25 0 0 1.36 0.44 0 153.7)
New X2 row = -0.33 New X3 Row + Current X2 row
-0.33 (-0.25 0 1 -0.13 0.19 0 8.75) + (0.67 1 0.33
0.33 0 0 26.67)
=(0.75 1 0 0.37 -0.06 0 23.75)
New S3 row = -3.33 New X3 Row + Current S3 row
-3.33 (-0.25 0 1 -0.13 0.19 0 8.75) + (1.67 0 3.33 -0.67
0 1 96.67)
= (2.50 0 0 -0.25 -0.63 1 67.5)
Basic X1 X2 X3 S1 S2 S3 Solution
Deciding on Entering Variable (Pivot Column), leaving variable (Pivot Row), and the Pivot element
Entering variable: The non-basic variable with the most negative coefficient in the objective equation (X1).
Leaving Variable: Basic Variable with the smallest non-negative value in the Ratio column (S3)
1. New pivot Row = old pivot Row divided by (/) the pivot element.
New X1 Row (New pivot Row ) = Current S3 Row / 2.50
(2.50 0 0 -0.25 -0.63 1 67.5) / 2.5 = (1 0 0 -0.10 -0.25 0.4
27)
Basic X1 X2 X3 S1 S2 S3 Solution
Z
X2
X3
X1 1 0 0 -0.10 -0.25 0.4 27
2. Fill in all other rows using the following rule:
New Row = Old Row – Coefficient in the Pivot column* (New pivot Row)
Or
New Row = – Coefficient in the Pivot column* (New pivot Row) + Old Row
New Z row = – (-0.25) New X1 Row + Current Z row 0.25 New X1 Row + Current Z row
0.25 (1 0 0 -0.10 -0.25 0.4 27) + (-0.25 0 0 1.36
0.44 0 153.7)
=(0 0 0 1.33 0.37 0.10 160.5)
New X2 row = -0.75 New X1 Row + Current X2 row
-0.75 (1 0 0 -0.10 -0.25 0.4 27) + (0.75 1 0 0.37 -0.06
0 23.75)
=(0 1 0 0.44 0.12 -0.3 3.5)
New X3 row = 0.25 New X1 Row + Current X3 row
0.25 (1 0 0 -0.10 -0.25 0.4 27) + (-0.25 0 1 -0.13 0.19
0 8.75)
= (0 0 1 -0.15 0.12 0.1 15.5)
Basic X1 X2 X3 S1 S2 S3 Solution
X1= 27
X2= 3.5
X3=15.5
Z= 160.5
Basic X1 X2 X3 S1 S2 S3 Solution
Maximize
Subject to
Summary
• Basic Variable: The variables of a basic feasible solution have n non-negative value.
• Non-Basic Variable: The variables of a feasible solution have a value equal to zero.
• Basic Feasible Solution: System of m-equation and n-variables i.e. m<n is a solution where m
variables are non-negative and n-m variables are zero.
• LPs in which all the constraints are (<=) with non-negative right-hand sides offer a convenient
all-slack starting basic feasible solution. Models involving (=) and/or (>=) constraints do not.
The procedure for starting “ill-behaved” 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.
• .
Solve the Given the following LP model using the Simplex Method :
Maximize Z = 5X1 + 8X2 + 6X3
Subject to:
3X1 + X2 + 2X3 ≤ 32
-3X1 + 3 X2 + 5X3 ≤ 28
X1 , X 2 , X 3 ≥ 0