Algebraic and Simplex Method
Algebraic and Simplex Method
(, ) (, ) (4, 5 )
(, ) (, ) (4,-3)
( , ) (, ) (2.5 , 1.5 )
(, ) (, ) (2, 3)
(, ) (, (5, -6)
(, ) (, ) (1,2)
Example for Solving LPP By
Algebraic Method
Consider the following LPP:
Maximize Z=+ 3+0+0
Subject to
++=4
+2 +=5 and ,,,≥0
The following Table provides all the Basic feasible solutions:
3.
DEFINITIONS
+M for Minimization
-M for Maximization, M>0
STANDARD FORM OF LPP
The standard form of the LP Problem should have the following characteristics:
1) All the constraints are equations with nonnegative
right hand side value
≤ + slack (s)
= + Artificial (A)
Simplex method in tabular form
b. Construct the initial simplex tableau
A bm
Z Objective function coefficient Z
In different signs value
Simplex method in tabular form
2. Test for optimality:
Case 1: Maximization problem
The current BF Solution is optimal if every
coefficient in the objective function row is non
negative
Case 2: Minimization problem
The current BF Solution is optimal if every
coefficient in the objective function row is non
positive
Simplex method in tabular form
3. Iteration
Step 1: Determine the entering variable by
selecting the variable (automatically a non basic
variable) with the most negative value (in case
of maximization) or with the most positive (in
case of minimization) in the last row (Z-row).
Put a box around the column below this
variable, and call it the “pivot column”
Simplex method in tabular form
• Step 2: Determine the leaving basic variable by
applying the minimum ratio test as following:
1. Pick out each coefficient in the pivot column that is
strictly positive (>0)
2. Divide each of these coefficients into the right hand
side entry for the same row
3. Identify the row that has the smallest of these ratios
4. The basic variable for that row is the leaving variable,
so replace that variable by the entering variable in the
basic variable column of the next simplex tableau. Put
a box around this row and call it the “pivot row”
Step 3: Update the Simplex table
24
Example 1 to solve LP using SIMPLEX METHOD
LP Model 1
𝑴𝒂𝒙𝒊𝒎𝒊𝒛𝒆 𝒁=𝟔 𝒙 𝟏 +𝟏𝟎 𝒙 𝟐
Subject to
𝟐𝟓 𝒙 𝟏+𝟓𝟎 𝒙𝟐 ≤𝟓𝟎𝟎
𝒙 𝟏+ 𝒙 𝟐 ≤𝟏𝟐
𝒙 𝟏 ≥ 𝟎 , 𝒙𝟐 ≥ 𝟎
25
SOLUTION TO LP MODEL 1
Standard Form: In this case all constraints are type
constraints. and are slack variables
𝑴𝒂𝒙𝒊𝒎𝒊𝒛𝒆 𝒁=𝟔 𝒙 𝟏 +𝟏𝟎 𝒙 𝟐+ 𝟎 𝑺𝟏+ 𝟎 𝑺𝟐
Subject to
𝟐𝟓 𝒙 𝟏+𝟓𝟎 𝒙𝟐 + 𝑺𝟏=𝟓𝟎𝟎
𝒙 𝟏+ 𝒙 𝟐 + 𝑺 𝟐=𝟏𝟐
𝒙 𝟏 ≥ 𝟎 , 𝒙𝟐 ≥ 𝟎
26
ITERATION 1
𝑴𝒂𝒙𝒊𝒎𝒊𝒛𝒆 𝒁=𝟔 𝒙 𝟏 +𝟏𝟎 𝒙 𝟐+ 𝟎 𝑺𝟏+ 𝟎 𝑺𝟐
Subject to
𝟐𝟓 𝒙 𝟏+𝟓𝟎 𝒙𝟐 + 𝑺𝟏=𝟓𝟎𝟎
𝒙 𝟏+ 𝒙 𝟐 + 𝑺 𝟐=𝟏𝟐
𝒙 𝟏 ≥ 𝟎 , 𝒙𝟐 ≥ 𝟎
Basic Variables:
Non-Basic variables:
Solution:
Z 27
ITERATION 1
Entering
variable
S2 1 1 0 1 12 12
Z -6 -10 0 0 0
Leaving
variable
Pivot
Pivot column
Pivot row
Element
Optimality test
• By investigating the last row of the initial
tableau, we find that there are some negative
numbers. Therefore, the current solution is
not optimal
Finding the new Basic Feasible solution by using the eliminatory row
operations (Gauss-Jordan ) as following.
1. New pivot row = old pivot row Pivot Element
= Old Pivot Row 50
2. New row = old row – [the coefficient of this row in the pivot column
*(new pivot row)]
Basic X1 X2 S1 S2 RHS
variable
x2 0.50 1 0.02 0 10
S2
Z
Basic X1 X2 S1 S2 RHS
variable Ratio
x2 0.50 1 0.02 0 10 20
Least Positive
S2 0.50 0 -0.02 1 2 4 Ratio
Z -1 0 0.20 0 100
Leaving
variable
Pivot
Pivot column
Pivot row
Element
Optimality test
• By investigating the last row of the tableau,
we find that there are some negative
numbers. Therefore, the current solution is
not optimal
ITERATION 2
Basic Variables:
Non-Basic variables:
Solution:
33
ITERATION 3
Basic X1 X2 S1 S2 RHS
variable
x2 0 1 0.04 -1 8
x1 1 0 -0.04 2 4
Z 0 0 0.16 2 104
35
Simplex method
• Example 2
• Solve the following problem using the simplex method
• Maximize Z = 3X1+ 5X2
Subject to
X1 4
2 X2 12
3X1 +2X2 18
X1 , X2 0
Simplex method
• Solution
• Initialization
1. Standard form
Maximize Z,
Subject to Sometimes it is called the
Z - 3X1- 5X2 = 0 augmented form of the
problem because the
X1 + S 1 = 4 original form has been
2 X2+ S2 =12 augmented by some
supplementary variables
3X1 +2X2+ S3=18 needed to apply the
X1 , X2, S1, S2, S3 0 simplex method
Initial tableau
Entering
2. Initial tableau variable
Basic X1 X2 S1 S2 S3 RHS
variable
S1 1 0 1 0 0 4
S2 0 2 0 1 0 12
S3 3 2 0 0 1 18
Z -3 -5 0 0 0 0
1 0 1 0 0 4
-
0 (0 1 0 1/2 0 6)
1 0 1 0 0 4
For S3
3 2 0 0 1 18
-
2 (0 1 0 1/2 0 6)
Substitute this
3 0 0 -1 1 6
for Z values in the table
-3 -5 0 0 0 0
-
-5(0 1 0 1/2 0 6)
-3 0 0 5/2 0 30
Iteration
This solution is not optimal, since there is a negative
numbers in the last row
Basic X1 X2 S1 S2 S3 RHS
variable
S1 1 0 1 0 0 4
X2 0 1 0 1/2 0 6
S3 3 0 0 -1 1 6
Z -3 0 0 5/2 0 30
Basic X1 X2 S1 S2 S3 RHS
variable
S1 0 0 1 2
X2 0 1 0 1/2 0 6
1 0 0 2
Z 0 0 0 3/2 1 36
1. Maximize
subject to
and
2. Minimize
subject to