0% found this document useful (0 votes)
17 views

Chpter 3-Simplex Algorithm

The document provides an overview of the simplex method and uses examples to demonstrate how to formulate a linear programming problem in standard form and solve it using the simplex method. It shows the steps to identify basic feasible solutions and find the optimal solution.

Uploaded by

abdulla
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Chpter 3-Simplex Algorithm

The document provides an overview of the simplex method and uses examples to demonstrate how to formulate a linear programming problem in standard form and solve it using the simplex method. It shows the steps to identify basic feasible solutions and find the optimal solution.

Uploaded by

abdulla
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

QM350 – Chapter 3 –

The Simplex Algorithm


Mrs. Sara Almeer
Overview of the Simplex Method

Steps leading to simplex method

Formulate Put in Put in Execute


Problem as Standard Tableau simplex
LP form form method
How to convert an LP model to standard
form model
An LP is in standard form when:
• All variables are non-negative
• All constraints are equalities
Example 1
 EX1 : Consider the following linear programming model:
◼ Max 5X1+9X2
S.t. 0.5X1+ X2 ≤ 8
X1+ X2 ≥ 10
0.25X1+ 1.5X2 ≥ 6
X1 , X2 ≥ 0
a) Write the problem in a standard form.
0.5x1 +x2 + S1 = 8
X1+x2 – S2=10
0.25X1+1.5x2 –S3 =6
X1,X2,S1, S2,S3 ≥ 0
Example 1
a) Write the problem in a standard form.
0.5x1 +x2 + S1 = 8
X1+x2 – S2=10
0.25X1+1.5x2 –S3 =6
X1,X2,S1, S2,S3 ≥ 0
b) How many variables will be set to zero in a basic solution to this
problem?
number of variables (=5=X1 ,X2 ,Sl ,S2 ,S3 )
number of constraints(3) = (5-3)=2
(The No. of variables must be set equal to zero in each basic
solution.)
Example 1
c) Find the basic solution that corresponds to S1 and S2 equal to
zero.
Substituting S1 ,S2=0 (Constrains 1 & 2)in the constraints and solve
equation 1&2,
0.5x1 +x2 + S1 = 8
0.5(x1) +0+0=8 X1 = 8/0.5 = 4
X1+x2 – S2=10
(4)+X2 –(0) =10 X2 = 10-4 = 6
you get X1=4, X2=6 then
substitute these values to solve third constraint,
0.25X1+1.5x2 –S3 =6
0.25(4)+1.5(6)-S3=6 1+9-S3 = 6 10-S3=6 S3= -6+10 =4
S3=4
Example 1
d) Find the basic solution that corresponds to Xl and S3 equal to zero.
Substituting X1 ,S3=0 in the constraints (3) ,
0.25X1+1.5x2 –S3 =6
0.25(0)+1.5x2 –(0)= 6 0+1.5X2=6 X2=6/1.5 X2 = 4
you get from equation 3 that X2=4 and

substitute X2 in equation 1&2


0.5x1 +x2 + S1 = 8
0.5(0) + 4 + S1 = 8 4+S1=8 S1 =8-4 S1 = 4
X1+x2 – S2=10
0+ 4-S2 = 10 - S2=10-4 -S2 = 6 S2 = -6
you get S1=4, S2= - 6
Example 1
e) Are your solutions for parts (c) and part (d) basic feasible solutions?
Extreme-point solutions? Explain Substituting X1 ,S3=0 in the constraints
(3) ,

The answer to part c is a basic feasible solution and an extreme point


solution.

The answer to part d is not a basic feasible solution because S2 is


negative.
Example 1
F) Use the graphical approach to identify the solutions found in parts (c)
and part (d). Do the graphical results agree with your answer to part
(e)? Explain.
The graph below shows that part c represent extreme point, whereas,
part d is not:
Example 2
Consider the following LP:
Max Z= Xl +2X2
s.t. Xl +5X2 ≤ 10
2X1+6X2 ≤ 16
X1 , X2 ≥ 0

a) Write the problem in standard form.


X1+ 5X2 + S1 = 10
2X1+ 6 X2 + S2 = 16
X1 , X2 , S1 , S2 > 0
Example 2
b) How many variables will be set equal to zero in a basic solution for
this problem?
We have n (number of variables) = 4 ,
and m (number of constraints) = 2 in standard form.
So n - m = 4 - 2 = 2 variables must be set equal to zero in each basic
solution.
Example 2
C) Find all the basic solutions, and indicate which are also feasible.
There are 6 combinations ( 4C2 ) of the two variables that may be set
equal to zero and hence 6 possible basic solutions. (
Every time we select 2 vars. and make them equal to zero)
1. X1= 0, X2 = 0 (substitute them in the constraints, we get :)
X1+5x2 +S1 =10
0+0+S1= 10 S1 = 10
2x1+6x2+S2 = 16
0+0+S2 = 16 S2 =16
S1 = 10 S2 = 16
This is a basic feasible solution. (Because all values are positives)
Example 2
C) Find all the basic solutions, and indicate which are also feasible.

2. X1 = 0, S1 = 0

X1+5x2 +S1 =10


0+5x2+0= 10 x2 = 10/5 X2 =2
2x1+6x2+S2 = 16
0+6(2)+ S2 = 16 S2 =16 -12 S2 = 4
This is a basic feasible solution.
(Because all values are positives)
Example 2
C) Find all the basic solutions, and indicate which are also feasible.

3- Xl = 0, S2 = 0
2x1+6X2+S2= 16
0+6X2+0= 16 6x2=16 X2= 16/6 =8/3
X1+5X2+S1 = 10
X1 + 5(8/3)+ S1= 10
0+40/3+S1= 10 S1= 10-40/3 = -10/3
Substituting for X2 in (1) yields
This is not a basic feasible solution. (Because S1 value is negative)
Example 2
C) Find all the basic solutions, and indicate which are also feasible.

5- X2= 0, S2 = 0
Xl + S1 = 10 …….(1)
2Xl = 16 …….(2)
From (2) we find Xl = 8.
And substituting for Xl in (l) yields
8 + S1 + = 10 S1 =2
This is a basic feasible solution
Example 2
C) Find all the basic solutions, and indicate which are also feasible.
6- S1 = 0, S2= 0
Xl + 5X2 = 10 …… (1)
2X1 +6X2= 16 ………(2)
From (1) we have X1 = 10 - 5X2 .
Substituting for Xl in (2) yields
2(X1)+6(X2) +S2 = 16
2(10 - 5X2 ) + 6 X2 + 0 = 16 20 -10X2 + 6 X2 = 16
-10x2 +6x2 = 16 -20 -4x2 = -4 X2 = 4/4 = 1 X2 = 1
X1 = 10-5x2 X1 = 10 - 5(1) = 5 X1 = 5
This is a basic feasible solution
Example 2
d- The optimal solution is the basic feasible solution with the largest
value of the objective function.
There are 4 basic feasible solutions from
part (c) to evaluate in the objective
function.
Max Z= X1 + 2X2
X1 = 0, X2 = 0, S1= 10, S2 = 16, Z-Value = 1(0) + 2(0) = 0
X1 = 0, X2 = 2, S1 = 0, S2 = 4, Z-Value = 1(0) + 2(2) = 4
X1 = 8, X2 = 0, S1= 2, S2 = 0, Z-Value = 1(8) + 2(0) = 8
X1 = 5, X2 = 1, S1= 0, S2 = 0, Z-Value = 1(5) + 2(1) = 7
The optimal solution (Maximum Z) is X1 = 8, X2= 0 with value = 8.
Example 3
Simplex Method Solve the following problem by the simplex method:
Max z = 60X1 + 30X2 + 20X3
S.t. 8X1 + 6X2 + X3 ≤ 48 (Lumber Constraint)
4X1 + 2X2 +1.5X3 ≤ 20 (Finishing Constraint)
2X1 + 1.5X2 +0.5X3 ≤ 8 (Carpentry Constraint)
X2 ≤ 5 (Table Demand Constraint)
X1 , X2 , X3 ≥0
Example 3
Simplex Method Solve the following problem by the simplex method:
Max z = 60X1 + 30X2 + 20X3

Solution:
Max z = 60X1 + 30X2 + 20X3 +0S1+0S2+0S3+0S4
S.t. 8X1 + 6X2 + X3 +S1 = 48 (Lumber Constraint)
4X1 + 2X2 +1.5X3 +S2 = 20 (Finishing Constraint)
2X1 + 1.5X2 +0.5X3 +S3 = 8 (Carpentry Constraint)
X2 +S4 = 5 (Table Demand Constraint)
X1 , X2 , X3 ,S1,S2,S3,S4 ≥ 0.
Example 3

Basic Cb 60x1 30x2 20x3 S1 S2 S3 S4 RHS Ratio


S1
S2
S3
S4
Z
Cb-Z
Example 3

Basic Cb 60x1 30x2 20x3 S1 S2 S3 S4 RHS Ratio


S1 0 8 6 1 1 0 0 0 48 48/8=6

S2 0 4 2 1.5 0 1 0 0 20 20/4=5

S3 0 2 1.5 0.5 0 0 1 0 8 8/2=4


S4 0 0 1 0 0 0 0 1 5 5/0=
NA
Z 0 0 0 0 0 0 0 0
Cb-Z 60 30 20 0 0 0 0
Example 3

Basic Cb 60x1 30x2 20x3 S1 S2 S3 S4 RHS Ratio


S1 0 8 6 1 1 0 0 0 48 48/8=6

S2 0 4 2 1.5 0 1 0 0 20 20/4=5

S3 0 2/2=1 1.5/2= 0.5/2 0/2= 0/2= ½= 0/2=0 8/2=4 8/2=4


S4 0 0 1 0 0 0 0 1 5 5/0=
NA
Z 0 0 0 0 0 0 0 0
Cb-Z 60 30 20 0 0 0 0
Example 3

Basic Cb 60x1 30x2 20x3 S1 S2 S3 S4 RHS Ratio


S1 0 8 6 1 1 0 0 0 48 48/8=6

S2 0 4 2 1.5 0 1 0 0 20 20/4=5

S3 0 1 3/4 1/4 0 0 1/2 0 4 8/2=4


S4 0 0 1 0 0 0 0 1 5 5/0=
NA
Z 0 0 0 0 0 0 0 0
Cb-Z 60 30 20 0 0 0 0
Example 3

Basic Cb 60x1 30x2 20x3 S1 S2 S3 S4 RHS Ratio


S1 0 48 48/8=6

S2 0 20 20/4=5

X1 60 1 3/4 1/4 0 0 1/2 0 4 8/2=4


S4 0 5 5/0=
NA
Z 0
Cb-Z
Example 3
Example 3
Example 4

Min Z = 2X1 + 3X2


◼ S.t 0.5X1 + 0.25X2 ≤ 4 (sugar constraint)
X1 + 3X2 ≥ 20 (Vitamin C constraint)
X1 + X2 = 10 (10 oz in 1 bottle of Orange)
X1 , X2 ≥ 0
◼ The LP in standard form has Z and S1 which could
be used for BVs but row 2 would violate (break) sign
restrictions and row 3 no readily apparent basic
variable.
Example 4
Row 1: Z =2X1 + 3X2
Row 2: 0.5X1 + 0.25X2 + S1 = 4
Row 3: X1 + 3X2 - S2 = 20
Row 4: X1 + X2 = 10

The above form is called standard form. It gives a basic


solution but it is infeasible as the value of X1 = 0, X2=0, S1=4
and S2= -20, Z=0
In order to use the simplex method, a bfs is needed. To
remedy the predicament, artificial variables are created.
The variables will be labeled according to the row in which
they are used.
Example 4

Row 1: Min Z= 2Xl + 3X2 + 0S1 + 0S2


Row 2: 0.5Xl + 0.25X2 + S1 = 4 Note :
Row 3: X1 + 3X2 - S2 + a2 = 20 For each ≥ or =
Row 4: X1 + X2 +a3 = 10 constraint, add
artificial variables.
Add sign restriction ai
X1 , X2 ,S1 ,S2 , a2 , a3 ≥ 0. ≥0
Example 4

Basic Cb RHS Ratio

Z
Cb-Z
Example 4
Example 4
Example 4
Example 4

You might also like