SlideShare a Scribd company logo
_____________________Dr. Atif Shahzad
BE, MECHANICAL ENGINEERING
UNIVERSITY OF ENGINEERING & TECHNOLOGY, TAXILA, PAKISTAN, 2000
MCS, SOFTWARE ENGINEERING
SZABIST,, ISLAMABAD, PAKISTAN, 2003
MS, AUTOMATION & PRODUCTION SYSTEMS
ECOLE CENTRALE DE NANTES, NANTES, FRANCE, 2007
PhD, AUTOMATION & APPLIED INFORMATICS
UNIVERSITE DE NANTES, NANTES, FRANCE, 2011
EMAIL: atifshahzad@Gmail.com
TEL: +92-333-5219846, +92-51-5179755
LINKEDIN: pk.linkedin.com/in/dratifshahzad
1 Dr. Atif Shahzad 15-Oct-15
OPTIMIZATION
MODELS
COURSE OBJECTIVES
2Dr. Atif Shahzad
15-Oct-15
OPTIMIZATION
MODELS
TODAY’S LECTURE
Simplex method
3Dr. Atif Shahzad
15-Oct-15
4 Dr. Atif Shahzad 15-Oct-15
LP Problem
1–5
15-Oct-15Dr. Atif Shahzad
Converting LP to standard form
1
All Inequalities
to be
EQUATIONS
2
.
All variables
To be
NON-NEGATIVE
1–6
15-Oct-15Dr. Atif Shahzad
LP Standard Form
Inequalities to Equations
 Slack Variable: Variable added to a  constraint to convert it to an
equation (=).
 A slack variable represents unused resources
 A slack variable contributes nothing to the objective function value.
 Surplus Variable: Variable subtracted from a  constraint to convert
it to an equation (=).
 A surplus variable represents an excess above a constraint
requirement level.
 Surplus variables contribute nothing to the calculated value of the
objective function.
1–7
15-Oct-15Dr. Atif Shahzad
LP Standard Form
Dealing with unrestricted variables
 Unrestricted Variable:A variable that is unbounded and can take
any value.
 BUT, standards form requires that the variables be nonnegative
 So, What to do??
 Write an unrestricted variable 𝑥 as:
 𝑥 = 𝑥+- 𝑥−, where 𝑥+, 𝑥−≥ 0
 If 𝑥+> 0 and 𝑥−= 0 then 𝑥+ represents a slack
 If 𝑥−
> 0 and 𝑥+
= 0 then 𝑥−
represents a surplus
1–8
15-Oct-15Dr. Atif Shahzad
Basic & Non-Basic Variables
 Consider a System A𝑥 = 𝑏 of 𝑚 linear equations in 𝑛
variables
 Assume 𝑛 ≥ 𝑚
 Set 𝑛 − 𝑚 variables equal to ZERO
(Non-Basic Variables)
 Solve for remaining 𝑚 variables
(Basic Variables)
1–9
15-Oct-15Dr. Atif Shahzad
Basic & Non-Basic Variables
Example
𝑥1 + 𝑥2 = 3
−𝑥2 + 𝑥3 = −1
 𝑛 = 3, 𝑚 = 2, 𝑛 − 𝑚 =1
 If NBV={𝑥3} then BV={𝑥1, 𝑥2}
 Setting 𝑥3 =0, we get {𝑥1, 𝑥2} ={2,1}
 {𝑥1, 𝑥2, 𝑥3}={2,1,0} is a basic solution.
 If NBV={𝑥2} then BV={𝑥1, 𝑥3} THEN ??
 If NBV={𝑥1} then BV={𝑥2, 𝑥3} THEN ??
1–10
15-Oct-15Dr. Atif Shahzad
Basic Feasible Solution
 Basic Solution(BS) : This solution is obtained by setting any
n variables (among m+n variables) equal to zero and
solving for remaining m variables, provided the determinant
of the coefficients of these variables is non-zero.
 Such m variables are called basic variables and remaining
n zero valued variables are called non basic variables.
 Basic Feasible Solution(BFS) : It is a basic solution which
also satisfies the non negativity restrictions, i.e., all variables
are nonnegative.
1–11
15-Oct-15Dr. Atif Shahzad
Basic Feasible Solution
 BFS are of two types:
Degenerate BFS: If one or more basic variables
are zero.
Non-Degenerate BFS: All basic variables are non-
zero.
 Optimal BFS: BFS which optimizes the objective function.
1–12
15-Oct-15Dr. Atif Shahzad
Optimality & Feasibility Conditions
Conditions
FEASIBILITY
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).
OPTIMALITY
The entering variable in a
maximization (minimization)
problem is the nonbasic
variable having the most
negative (positive) coefficient
in the z-row.
Tiesarebrokenarbitrarily.
Tiesarebrokenarbitrarily.
The optimum is reached at the
iteration where all the z-row
coefficients of the non basic
variables are nonnegative
(non-positive ).
1–14
15-Oct-15Dr. Atif Shahzad
Simplex Method
Algorithm
 Step 1. Determine a starting basic feasible solution.
 Step 2. Select an entering variable using the optimality
condition. Stop if there is no entering variable; the last
solution is optimal. Else, go to step 3.
 Step 3. Select a leaving variable using the feasibility
condition.
 Step 4. Determine the new basic solution by using the
appropriate Gauss-Jordan computations. Go to step 2.
1–15
15-Oct-15Dr. Atif Shahzad
Example
max z = 13𝑥1 + 11𝑥2
4𝑥1 + 5𝑥2 ≤ 1500
5𝑥1 + 3𝑥2 ≤ 1575
𝑥1 + 2𝑥2 ≤ 420
𝑥1, 𝑥2 ≥ 0
16
Dr. Atif Shahzad 15-Oct-15
Step 0:
Standard Form
Convert all the inequality constraints into equalities by the use of slack
variables.
Let S1, S2 , S3 be three slack variables.
Model can rewritten as:
Z - 13x1 -11x2 = 0
Subject to constraints:
4x1+5x2 + S1 = 1500
5x1+3x2 + S2 = 1575
x1+2x2 +S3 = 420
x1, x2, S1, S2, S3 > 0
17
Dr. Atif Shahzad 15-Oct-15
Step 1
Initial BFS
 Find the Initial BFS.
 Choose Basic variables
 S1, S2, S3
 One Feasible solution that satisfies all the
constraints is:
x1= 0, x2= 0, S1= 1500,
S2= 1575, S3= 420 and Z=0.
So, NBV={𝑥1, 𝑥2} & BV={𝑆1, 𝑆2, 𝑆3}
And BFS is {𝑥1, 𝑥2, 𝑆1, 𝑆2, 𝑆3}={0,0,1500,1575,420}
1–18
15-Oct-15Dr. Atif Shahzad
Step 1:
Tableaux
Row No. Basic
Variable
Coefficients of: Sol. Ratio
Z x1 x2 S1 S2 S3
0 Z 1 -13 -11 0 0 0 0
1 S1 0 4 5 1 0 0 1500
2 S2 0 5 3 0 1 0 1575
3 S3 0 1 2 0 0 1 420
Set up an initial table.
19
Dr. Atif Shahzad 15-Oct-15
Step 2:
Entering Variable
Row
NO.
Basic
Variable
Coefficients of: Sol. Ratio
Z x1 x2 S1 S2 S3
0 Z 1 -13 -11 0 0 0 0
1 S1 0 4 5 1 0 0 1500
2 S2 0 5 3 0 1 0 1575
3 S3 0 1 2 0 0 1 420
Choose the most negative number from row 0 (i.e Z row).
Therefore, x1 is an entering variable.
Iteration 1
20
Dr. Atif Shahzad 15-Oct-15
Step 3:
Leaving variable
Row
NO.
Basic
Variable
Coefficients of: Sol. Ratio
Z x1 x2 S1 S2 S3
0 Z 1 -13 -11 0 0 0 0
1 S1 0 4 5 1 0 0 1500 375
2 S2 0 5 3 0 1 0 1575 315
3 S3 0 1 2 0 0 1 420 420
Calculate Ratio = Sol col. / 𝑥1 col. (𝑥1 > 0)
Choose minimum Ratio. That variable(i.e., S2) is
a leaving variable.
Iteration 1
21
Dr. Atif Shahzad 15-Oct-15
Step 4:
Find New BFS (Pivoting)
Row
NO.
Basic
Variable
Coefficients of: Sol. Ratio
Z x1 x2 S1 S2 S3
0 Z 1 -13 -11 0 0 0 0
1 S1 0 4 5 1 0 0 1500 375
2 S2 0 5 3 0 1 0 1575 315
3 S3 0 1 2 0 0 1 420 420
• x1 becomes basic variable
• S2 becomes non basic variable.
Iteration 1
22
Dr. Atif Shahzad 15-Oct-15
Step 4:
Find New BFS (New Pivot Row)
Row
NO.
Basic
Variable
Coefficients of: Sol. Ratio
Z x1 x2 S1 S2 S3
0 Z 1 -13 -11 0 0 0 0
1 S1 0 4 5 1 0 0 1500 375
2 S2 0 5 3 0 1 0 1575 315
3 S3 0 1 2 0 0 1 420 420
0 5 3 0 1 0 15750 1 3/5 0 1/5 0 375
5
New Pivot row =
Current Pivot row
Pivot Element
=
Iteration 1
23
Dr. Atif Shahzad 15-Oct-15
Step 4:
Find New BFS (New Other Rows)
Row
NO.
Basic
Variable
Coefficients of: Sol. Ratio
Z x1 x2 S1 S2 S3
0 Z 1 -13 -11 0 0 0 0
1 S1 0 4 5 1 0 0 1500
2 S2 0 1 3/5 0 1/5 0 375
3 S3 0 1 2 0 0 1 420
1 0 -16/5 0 13/5 0 4095
-13 0 1 3/5 0 1/5 0 375
Iteration 1
New Other row Current row its Pivot col Coeff.x New pivot row
= 1 -13 -11 0 0 0 0
−
−
24
Dr. Atif Shahzad 15-Oct-15
Step 4:
New Tableaux
Row
No.
Basic
Varia
ble
Coefficients of: Sol. Ratio
Z x1 x2 S1 S2 S3
0 Z 1 0 -16/5 0 13/5 0 4095
1 S1 0 0 13/5 1 -4/5 0 240
2 x1 0 1 3/5 0 1/5 0 315
3 S3 0 0 7/5 0 -1/5 1 105
Iteration 1
• x1 enters and becomes basic variable.
• S2 leaves and becomes non basic variable.
• We have a new table.
25
Dr. Atif Shahzad 15-Oct-15
Step 2:
Entering Variable
Row
NO.
Basic
Varia
ble
Coefficients of: Sol. Ratio
Z x1 x2 S1 S2 S3
0 Z 1 0 -16/5 0 13/5 0 4095
1 S1 0 0 13/5 1 -4/5 0 240
2 x1 0 1 3/5 0 1/5 0 315
3 S3 0 0 7/5 0 -1/5 1 105
Iteration 2
26
Dr. Atif Shahzad 15-Oct-15
Step 3:
Leaving variable
Row
NO.
Basic
Variab
le
Coefficients of: Sol. Ratio
Z x1 x2 S1 S2 S3
0 Z 1 0 -16/5 0 13/5 0 4095
1 S1 0 0 13/5 1 -4/5 0 240 277/3
2 x1 0 1 3/5 0 1/5 0 315 525
3 S3 0 0 7/5 0 -1/5 1 105 75
Iteration 2
Calculate Ratio = Sol col. / 𝑥2 col. (𝑜𝑛𝑙𝑦 𝑤ℎ𝑒𝑟𝑒 𝑥2 > 0)
Choose minimum Ratio. That variable(i.e., S3) is
a leaving variable.
27
Dr. Atif Shahzad 15-Oct-15
Step 3:
Leaving variable
Row
No.
Basic
Variab
le
Coefficients of: Sol. Ratio
Z x1 x2 S1 S2 S3
0 Z 1 0 -16/5 0 13/5 0 4095
1 S1 0 0 13/5 1 -4/5 0 240 277/3
2 x1 0 1 3/5 0 1/5 0 315 525
3 S3 0 0 7/5 0 -1/5 1 105 75
Iteration 2
• x2 becomes basic variable
• S3 becomes non basic variable.
28
Dr. Atif Shahzad 15-Oct-15
Row
No.
Basic
Variab
le
Coefficients of: Sol. Ratio
Z x1 x2 S1 S2 S3
0 Z 1 0 -16/5 0 13/5 0 4095
1 S1 0 0 13/5 1 -4/5 0 240 277/3
2 x1 0 1 3/5 0 1/5 0 315 525
3 S3 0 0 7/5 0 -1/5 1 105 75
Iteration 2Step 4:
Find New BFS (New Pivot Row)
0 0 7/5 0 -1/5 1 750 0 1 0 -1/7 5/7 375/7
7/5
New Pivot row =
Current Pivot row
Pivot Element
=
29
Dr. Atif Shahzad 15-Oct-15
Row
No.
Basic
Variab
le
Coefficients of: Sol. Ratio
Z x1 x2 S1 S2 S3
0 Z 1 0 -16/5 0 13/5 0 4095
1 S1 0 0 13/5 1 -4/5 0 240 277/3
2 x1 0 1 3/5 0 1/5 0 315 525
3 S3 0 0 7/5 0 -1/5 1 105 75
Iteration 2Step 4:
Find New BFS (New Other Row)
-16/5 0 0 1 0 -1/7 5/7 375/7
New Other row Current row its Pivot col Coeff. New pivot row
= 1 0 -16/5 0 13/5 0 4095
−
−
x
30
Dr. Atif Shahzad 15-Oct-15
Row
No.
Basic
Variab
le
Coefficients of: Sol. Ratio
Z x1 x2 S1 S2 S3
0 Z 1 0 0 0 15/7 16/7 4335
1 S1 0 0 0 1 -3/7 -13/7 45
2 x1 0 1 0 0 2/7 -3/7 270
3 S3 0 0 1 0 -1/7 5/7 75
Iteration 2Step 4:
New Tableaux
• x2 enters and becomes basic variable.
• S3 leaves and becomes non basic variable.
• We have a new table.
31
Dr. Atif Shahzad 15-Oct-15
Step 4:
RESULT
Next Table is :
Row
NO.
Basic
Variab
le
Coefficients of: Sol.
Z x1 x2 S1 S2 S3
0 Z 1 0 0 0 15/7 16/7 4335
1 S1 0 0 0 1 -3/7 -13/7 45
2 x1 0 1 0 0 2/7 -3/7 270
3 x2 0 0 1 0 -1/7 5/7 75
Optimal Solution is : x1= 270, x2= 75, Z= 4335
32
Dr. Atif Shahzad 15-Oct-15
Iterations Done
x1 x2 S1 S2 S3
Sol.
Z -13 -11 0 0 0
S1 4 5 1 0 0 1500
S2 5 3 0 1 0 1575
S3 1 2 0 0 1 420
Z 0 -3 1/5 0 2 3/5 0 4095
S1 0 2 3/5 1 - 4/5 0 240
x1 1 3/5 0 1/5 0 315
S3 0 1 2/5 0 - 1/5 1 105
Z 0 0 0 2 1/7 2 2/7 4335
S1 0 0 1 - 3/7 -1 6/7 45
x1 1 0 0 2/7 - 3/7 270
x2 0 1 0 - 1/7 5/7 75
Optimal Solution is :
x1= 270, x2= 75, Z= 4335
33
Dr. Atif Shahzad 15-Oct-15
Example 2
Max. Z = 3x1+5x2+4x3
Subject to constraints:
2x1+3x2 < 8
2x2+5x3 < 10
3x1+2x2+4x3 < 15
x1, x2, x3 > 0
34
Dr. Atif Shahzad 15-Oct-15
Cont…
Let S1, S2, S3 be the three slack variables.
Modified form is:
Z - 3x1-5x2-4x3 =0
2x1+3x2 +S1= 8
2x2+5x3 +S2= 10
3x1+2x2+4x3+S3= 15
x1, x2, x3, S1, S2, S3 > 0
Initial BFS is : x1= 0, x2= 0, x3=0, S1= 8,
S2= 10, S3= 15 and Z=0.
35
Dr. Atif Shahzad 15-Oct-15
Cont…
Basic
Variable
Coefficients of: Sol. Ratio
Z x1 x2 x3 S1 S2 S3
Z 1 -3 -5 -4 0 0 0 0
S1 0 2 3 0 1 0 0 8 8/3
S2 0 0 2 5 0 1 0 10 5
S3 0 3 2 4 0 0 1 15 15/2
Therefore, x2 is the entering variable and S1 is the
departing variable.
36
Dr. Atif Shahzad 15-Oct-15
Cont…
Basic
Variable
Coefficients of: Sol. Ratio
Z x1 x2 x3 S1 S2 S3
Z 1 1/3 0 -4 5/3 0 0 40/3
x2 0 2/3 1 0 1/3 0 0 8/3 -
S2 0 -4/3 0 5 -2/3 1 0 14/3 14/15
S3 0 5/3 0 4 -2/3 0 1 29/3 29/12
Therefore, x3 is the entering variable and S2 is the
departing variable.
37
Dr. Atif Shahzad 15-Oct-15
Cont…
Basic
Variable
Coefficients of: Sol. Ratio
Z x1 x2 x3 S1 S2 S3
Z 1 -11/15 0 0 17/15 4/5 0 256/15
x2 0 2/3 1 0 1/3 0 0 8/3 4
x3 0 -4/15 0 1 -2/15 1/5 0 14/15 -
S3 0 41/15 0 0 2/15 -4/5 1 89/15 89/41
Therefore, x1 is the entering variable and S3 is the
departing variable.
38
Dr. Atif Shahzad 15-Oct-15
Cont…
Basic
Variable
Coefficients of: Sol.
Z x1 x2 x3 S1 S2 S3
Z 1 0 0 0 45/41 24/41 11/41 765/41
x2 0 0 1 0 15/41 8/41 -10/41 50/41
x3 0 0 0 1 -6/41 5/41 4/41 62/41
x1 0 1 0 0 -2/41 -12/41 15/41 89/41
Optimal Solution is : x1= 89/41, x2= 50/41, x3=62/41, Z= 765/41
39
Dr. Atif Shahzad 15-Oct-15
Example 3:
Minimization
Min.. Z = x1 - 3x2 + 2x3
Subject to constraints:
3x1 - x2 + 3x3 < 7
-2x1 + 4x2 < 12
-4x1 + 3x2 + 8x3 < 10
x1, x2, x3 > 0
40
Dr. Atif Shahzad 15-Oct-15
Cont…
Convert the problem into maximization problem
Max.. Z’ = -x1 + 3x2 - 2x3 where Z’= -
Z
Subject to constraints:
3x1 - x2 + 3x3 < 7
-2x1 + 4x2 < 12
-4x1 + 3x2 + 8x3 < 10
x1, x2, x3 > 0
41
Dr. Atif Shahzad 15-Oct-15
Cont…
Let S1, S2 and S3 be three slack variables.
Modified form is:
Z’ + x1 - 3x2 + 2x3 = 0
3x1 - x2 + 3x3 +S1 = 7
-2x1 + 4x2 + S2 = 12
-4x1 + 3x2 + 8x3 +S3 = 10
x1, x2, x3 > 0
Initial BFS is : x1= 0, x2= 0, x3=0, S1= 7, S2= 12, S3 =
10
42
Dr. Atif Shahzad 15-Oct-15
Cont…
Basic
Variable
Coefficients of: Sol. Ratio
Z’ x1 x2 x3 S1 S2 S3
Z’ 1 1 -3 2 0 0 0 0
S1 0 3 -1 3 1 0 0 7 -
S2 0 -2 4 0 0 1 0 12 3
S3 0 -4 3 8 0 0 1 10 10/3
Therefore, x2 is the entering variable and S2 is the
departing variable.
43
Dr. Atif Shahzad 15-Oct-15
Cont…
Basic
Variable
Coefficients of: Sol. Ratio
Z’ x1 x2 x3 S1 S2 S3
Z’ 1 -1/2 0 2 0 3/4 0 9
S1 0 5/2 0 3 1 1/4 0 10 4
x2 0 -1/2 1 0 0 1/4 0 3 -
S3 0 -5/2 0 8 0 -3/4 1 1 -
Therefore, x1 is the entering variable and S1 is the
departing variable.
44
Dr. Atif Shahzad 15-Oct-15
Cont…
Basic
Variable
Coefficients of: Sol.
Z’ x1 x2 x3 S1 S2 S3
Z’ 1 0 0 13/5 1/5 8/10 0 11
x1 0 1 0 6/5 2/5 1/10 0 4
x2 0 0 1 3/5 1/5 3/10 0 5
S3 0 0 0 11 1 -1/2 1 11
Optimal Solution is : x1= 4, x2= 5, x3= 0,
Z’ = 11 Z = -11
45
Dr. Atif Shahzad 15-Oct-15
Example 4
Max.. Z = 3x1 + 4x2
Subject to constraints:
x1 - x2 < 1
-x1 + x2 < 2
x1, x2 > 0
46
Dr. Atif Shahzad 15-Oct-15
Cont…
Let S1 and S2 be two slack variables
.
Modified form is:
Z -3x1 - 4x2 = 0
x1 - x2 +S1 = 1
-x1 + x2 +S2 = 2
x1, x2, S1, S2 > 0
Initial BFS is : x1= 0, x2= 0, S1= 1, S2= 2
and Z=0.
47
Dr. Atif Shahzad 15-Oct-15
Cont…
Basic
Variable
Coefficients of: Sol. Ratio
Z x1 x2 S1 S2
Z 1 -3 -4 0 0 0
S1 0 1 -1 1 0 1 -
S2 0 -1 1 0 1 2 2
Therefore, x2 is the entering variable and S2 is the
departing variable.
48
Dr. Atif Shahzad 15-Oct-15
Cont…
Basic
Variable
Coefficients of: Sol. Ratio
Z x1 x2 S1 S2
Z 1 -7 0 0 4 8
S1 0 0 0 1 1 3 -
x2 0 -1 1 0 1 2 -
x1 is the entering variable, but as in x1 column every no. is less than equal to
zero, ratio cannot be calculated. Therefore given problem is having a
unbounded solution.
49
Dr. Atif Shahzad 15-Oct-15
Example :
Solving in a compact form
max z = 40𝑥1 + 88𝑥2
2𝑥1 + 8𝑥2 ≤ 60
5𝑥1 + 2𝑥2 ≤ 60
𝑥1, 𝑥2 ≥ 0
50
Dr. Atif Shahzad 15-Oct-15
Step 0:
Standard Form
Convert all the inequality constraints into equalities by the use of slack
variables.
Let S1, S2 be three slack variables.
Model can rewritten as:
z - 40x1 -88x2 = 0
Subject to constraints:
2x1+8x2 + S1 = 60
5x1+2x2 + S2 = 60
x1, x2, S1, S2> 0
51
Dr. Atif Shahzad 15-Oct-15
1
0
0
−40
2
5
−88
8
2
0
1
0
0
0
1
0
60
60
𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏
52
Dr. Atif Shahzad 15-Oct-15
1
0
0
−40
2
5
−88
8
2
0
1
0
0
0
1
0
60
60
𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏
53
Dr. Atif Shahzad 15-Oct-15
1
0
0
−40
2
5
−88
8
2
0
1
0
0
0
1
0
60
60
𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏
60
2
60
5
54
Dr. Atif Shahzad 15-Oct-15
1
0
0
−40
2
5
−88
8
2
0
1
0
0
0
1
0
60
60
𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏
60
2
60
5
55
Dr. Atif Shahzad 15-Oct-15
1
0
0
−40
2
5
−88
8
2
0
1
0
0
0
1
0
60
60
𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏
𝑅1 + 8𝑅3
𝑅2 − 0.4𝑅3
56
Dr. Atif Shahzad 15-Oct-15
1
0
0
0
0
5
−72
7.2
2
0
1
0
8
−0.4
1
480
36
60
𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏
𝑅1 + 8𝑅3
𝑅2 − 0.4𝑅3
57
Dr. Atif Shahzad 15-Oct-15
1
0
0
0
0
5
−72
7.2
2
0
1
0
8
−0.4
1
480
36
60
𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏
𝑅1 + 10𝑅2
𝑅3 − 2
7.2
𝑅2
58
Dr. Atif Shahzad 15-Oct-15
1
0
0
0
0
5
0
7.2
0
10
1
− 1
3.6
8
−0.4
1
0.9
840
36
50
𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏
𝑅1 + 10𝑅2
𝑅3 − 2
7.2
𝑅2
59
Dr. Atif Shahzad 15-Oct-15
1
0
0
0
0
5
0
7.2
0
10
1
− 1
3.6
8
−0.4
1
0.9
840
36
50
𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏
𝑅1 + 10𝑅2
𝑅3 − 2
7.2
𝑅2
𝒛 𝒙 𝟏 𝒙 𝟐
𝟖𝟒𝟎 𝟓𝟎
𝟓
𝟑𝟔
𝟕.𝟐
60
Dr. Atif Shahzad 15-Oct-15
QUESTIONS
Dr. Atif Shahzad
THANK YOU FOR YOUR INTEREST
15-Oct-15

More Related Content

PPT
Simplex two phase
PPTX
Solving linear programming model by simplex method
PPT
L20 Simplex Method
PPTX
Simplex Method
PPT
Simplex Algorithm
PPT
Simplex method
PDF
Module 3 lp-simplex
Simplex two phase
Solving linear programming model by simplex method
L20 Simplex Method
Simplex Method
Simplex Algorithm
Simplex method
Module 3 lp-simplex

What's hot (20)

PPTX
Big M method
PPTX
Simplex algorithm
PDF
Simplex method
PPT
simplex method
PDF
Big m method
PPT
Simplex Method
PPTX
Simplex method concept,
PPTX
Big m method
PPTX
Linear programming simplex method
PPTX
Special Cases in Simplex Method
PPTX
Linear programming
PPTX
Linear programming - Model formulation, Graphical Method
PPT
Operations Research
PPT
Duality
PPTX
Two Phase Method- Linear Programming
PDF
Simplex method: Slack, Surplus & Artificial variable
PPTX
Nonlinear programming 2013
PPT
Simplex Method
PPTX
Big-M Method Presentation
PDF
Chapter 4 Simplex Method ppt
Big M method
Simplex algorithm
Simplex method
simplex method
Big m method
Simplex Method
Simplex method concept,
Big m method
Linear programming simplex method
Special Cases in Simplex Method
Linear programming
Linear programming - Model formulation, Graphical Method
Operations Research
Duality
Two Phase Method- Linear Programming
Simplex method: Slack, Surplus & Artificial variable
Nonlinear programming 2013
Simplex Method
Big-M Method Presentation
Chapter 4 Simplex Method ppt
Ad

Similar to Simplex Method Explained (20)

PPTX
LINEAR PROGRAMMING
PPTX
Twophasemethod 131003081339-phpapp01
PPT
simplex method-maths 4 mumbai university
PPTX
Simplex part 2 of 4
PDF
simplex method ppt_ibh.pdfjjsjjsjskhhsjjjj
PPT
part3for food and accelerationpresentation.ppt
PPTX
MFCS2-Module1.pptx
PPTX
Metode simpleks dual
PPTX
SG 8 Lecture 15 Simplex - Min - 2 phase.pptx
PPTX
MODULE_05-Matrix Decomposition.pptx
PPTX
Optimization_is_the_process_of_Opt_.pptx
PPTX
Optimization_is_the_process_of_Opt_.pptx
PPTX
performance management and Resource optimization part-2.pptx
PPTX
Simplex Algorithm
PPTX
Linear programming.pptx
PDF
Chapter07.pdf
PPTX
Linear programming
PDF
D026017036
PDF
simplex method for operation research .pdf
LINEAR PROGRAMMING
Twophasemethod 131003081339-phpapp01
simplex method-maths 4 mumbai university
Simplex part 2 of 4
simplex method ppt_ibh.pdfjjsjjsjskhhsjjjj
part3for food and accelerationpresentation.ppt
MFCS2-Module1.pptx
Metode simpleks dual
SG 8 Lecture 15 Simplex - Min - 2 phase.pptx
MODULE_05-Matrix Decomposition.pptx
Optimization_is_the_process_of_Opt_.pptx
Optimization_is_the_process_of_Opt_.pptx
performance management and Resource optimization part-2.pptx
Simplex Algorithm
Linear programming.pptx
Chapter07.pdf
Linear programming
D026017036
simplex method for operation research .pdf
Ad

More from Atif Shahzad (20)

PDF
Lecture04 computer applicationsie1_dratifshahzad
PDF
Lecture03 computer applicationsie1_dratifshahzad
PDF
Lecture01 computer applicationsie1_dratifshahzad
PDF
Lecture02 computer applicationsie1_dratifshahzad
PDF
Lecture02 computer applicationsie1_dratifshahzad
PDF
Dr atif shahzad_sys_ management_lecture_agile
PDF
Dr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmea
PDF
Dr atif shahzad_engg_ management_module_01
PDF
Dr atif shahzad_engg_ management_lecture_inventory models
PDF
Dr atif shahzad_engg_ management_lecture_inventory management
PDF
Dr atif shahzad_engg_ management_cost management
PDF
Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...
PDF
Lecture17 ie321 dr_atifshahzad_js
PDF
Lecture16 ie321 dr_atifshahzad_css
PDF
Lecture15 ie321 dr_atifshahzad_html
PDF
Lecture14 ie321 dr_atifshahzad -algorithmic thinking part2
PDF
Lecture13 ie321 dr_atifshahzad -algorithmic thinking
PDF
Lecture12 ie321 dr_atifshahzad - networks
PDF
Lecture11 ie321 dr_atifshahzad -security
PDF
Lecture10 ie321 dr_atifshahzad
Lecture04 computer applicationsie1_dratifshahzad
Lecture03 computer applicationsie1_dratifshahzad
Lecture01 computer applicationsie1_dratifshahzad
Lecture02 computer applicationsie1_dratifshahzad
Lecture02 computer applicationsie1_dratifshahzad
Dr atif shahzad_sys_ management_lecture_agile
Dr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmea
Dr atif shahzad_engg_ management_module_01
Dr atif shahzad_engg_ management_lecture_inventory models
Dr atif shahzad_engg_ management_lecture_inventory management
Dr atif shahzad_engg_ management_cost management
Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...
Lecture17 ie321 dr_atifshahzad_js
Lecture16 ie321 dr_atifshahzad_css
Lecture15 ie321 dr_atifshahzad_html
Lecture14 ie321 dr_atifshahzad -algorithmic thinking part2
Lecture13 ie321 dr_atifshahzad -algorithmic thinking
Lecture12 ie321 dr_atifshahzad - networks
Lecture11 ie321 dr_atifshahzad -security
Lecture10 ie321 dr_atifshahzad

Recently uploaded (20)

PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PPT
introduction to datamining and warehousing
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
PPTX
Information Storage and Retrieval Techniques Unit III
PDF
86236642-Electric-Loco-Shed.pdf jfkduklg
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PDF
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
PDF
PPT on Performance Review to get promotions
PPT
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
PPTX
UNIT 4 Total Quality Management .pptx
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PPTX
Nature of X-rays, X- Ray Equipment, Fluoroscopy
PPT
Total quality management ppt for engineering students
PDF
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
PPTX
Current and future trends in Computer Vision.pptx
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
introduction to datamining and warehousing
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
Information Storage and Retrieval Techniques Unit III
86236642-Electric-Loco-Shed.pdf jfkduklg
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
R24 SURVEYING LAB MANUAL for civil enggi
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
PPT on Performance Review to get promotions
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
UNIT 4 Total Quality Management .pptx
Categorization of Factors Affecting Classification Algorithms Selection
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
Nature of X-rays, X- Ray Equipment, Fluoroscopy
Total quality management ppt for engineering students
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
Current and future trends in Computer Vision.pptx

Simplex Method Explained

  • 1. _____________________Dr. Atif Shahzad BE, MECHANICAL ENGINEERING UNIVERSITY OF ENGINEERING & TECHNOLOGY, TAXILA, PAKISTAN, 2000 MCS, SOFTWARE ENGINEERING SZABIST,, ISLAMABAD, PAKISTAN, 2003 MS, AUTOMATION & PRODUCTION SYSTEMS ECOLE CENTRALE DE NANTES, NANTES, FRANCE, 2007 PhD, AUTOMATION & APPLIED INFORMATICS UNIVERSITE DE NANTES, NANTES, FRANCE, 2011 EMAIL: atifshahzad@Gmail.com TEL: +92-333-5219846, +92-51-5179755 LINKEDIN: pk.linkedin.com/in/dratifshahzad 1 Dr. Atif Shahzad 15-Oct-15
  • 4. 4 Dr. Atif Shahzad 15-Oct-15
  • 6. Converting LP to standard form 1 All Inequalities to be EQUATIONS 2 . All variables To be NON-NEGATIVE 1–6 15-Oct-15Dr. Atif Shahzad
  • 7. LP Standard Form Inequalities to Equations  Slack Variable: Variable added to a  constraint to convert it to an equation (=).  A slack variable represents unused resources  A slack variable contributes nothing to the objective function value.  Surplus Variable: Variable subtracted from a  constraint to convert it to an equation (=).  A surplus variable represents an excess above a constraint requirement level.  Surplus variables contribute nothing to the calculated value of the objective function. 1–7 15-Oct-15Dr. Atif Shahzad
  • 8. LP Standard Form Dealing with unrestricted variables  Unrestricted Variable:A variable that is unbounded and can take any value.  BUT, standards form requires that the variables be nonnegative  So, What to do??  Write an unrestricted variable 𝑥 as:  𝑥 = 𝑥+- 𝑥−, where 𝑥+, 𝑥−≥ 0  If 𝑥+> 0 and 𝑥−= 0 then 𝑥+ represents a slack  If 𝑥− > 0 and 𝑥+ = 0 then 𝑥− represents a surplus 1–8 15-Oct-15Dr. Atif Shahzad
  • 9. Basic & Non-Basic Variables  Consider a System A𝑥 = 𝑏 of 𝑚 linear equations in 𝑛 variables  Assume 𝑛 ≥ 𝑚  Set 𝑛 − 𝑚 variables equal to ZERO (Non-Basic Variables)  Solve for remaining 𝑚 variables (Basic Variables) 1–9 15-Oct-15Dr. Atif Shahzad
  • 10. Basic & Non-Basic Variables Example 𝑥1 + 𝑥2 = 3 −𝑥2 + 𝑥3 = −1  𝑛 = 3, 𝑚 = 2, 𝑛 − 𝑚 =1  If NBV={𝑥3} then BV={𝑥1, 𝑥2}  Setting 𝑥3 =0, we get {𝑥1, 𝑥2} ={2,1}  {𝑥1, 𝑥2, 𝑥3}={2,1,0} is a basic solution.  If NBV={𝑥2} then BV={𝑥1, 𝑥3} THEN ??  If NBV={𝑥1} then BV={𝑥2, 𝑥3} THEN ?? 1–10 15-Oct-15Dr. Atif Shahzad
  • 11. Basic Feasible Solution  Basic Solution(BS) : This solution is obtained by setting any n variables (among m+n variables) equal to zero and solving for remaining m variables, provided the determinant of the coefficients of these variables is non-zero.  Such m variables are called basic variables and remaining n zero valued variables are called non basic variables.  Basic Feasible Solution(BFS) : It is a basic solution which also satisfies the non negativity restrictions, i.e., all variables are nonnegative. 1–11 15-Oct-15Dr. Atif Shahzad
  • 12. Basic Feasible Solution  BFS are of two types: Degenerate BFS: If one or more basic variables are zero. Non-Degenerate BFS: All basic variables are non- zero.  Optimal BFS: BFS which optimizes the objective function. 1–12 15-Oct-15Dr. Atif Shahzad
  • 13. Optimality & Feasibility Conditions Conditions FEASIBILITY 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). OPTIMALITY The entering variable in a maximization (minimization) problem is the nonbasic variable having the most negative (positive) coefficient in the z-row. Tiesarebrokenarbitrarily. Tiesarebrokenarbitrarily. The optimum is reached at the iteration where all the z-row coefficients of the non basic variables are nonnegative (non-positive ). 1–14 15-Oct-15Dr. Atif Shahzad
  • 14. Simplex Method Algorithm  Step 1. Determine a starting basic feasible solution.  Step 2. Select an entering variable using the optimality condition. Stop if there is no entering variable; the last solution is optimal. Else, go to step 3.  Step 3. Select a leaving variable using the feasibility condition.  Step 4. Determine the new basic solution by using the appropriate Gauss-Jordan computations. Go to step 2. 1–15 15-Oct-15Dr. Atif Shahzad
  • 15. Example max z = 13𝑥1 + 11𝑥2 4𝑥1 + 5𝑥2 ≤ 1500 5𝑥1 + 3𝑥2 ≤ 1575 𝑥1 + 2𝑥2 ≤ 420 𝑥1, 𝑥2 ≥ 0 16 Dr. Atif Shahzad 15-Oct-15
  • 16. Step 0: Standard Form Convert all the inequality constraints into equalities by the use of slack variables. Let S1, S2 , S3 be three slack variables. Model can rewritten as: Z - 13x1 -11x2 = 0 Subject to constraints: 4x1+5x2 + S1 = 1500 5x1+3x2 + S2 = 1575 x1+2x2 +S3 = 420 x1, x2, S1, S2, S3 > 0 17 Dr. Atif Shahzad 15-Oct-15
  • 17. Step 1 Initial BFS  Find the Initial BFS.  Choose Basic variables  S1, S2, S3  One Feasible solution that satisfies all the constraints is: x1= 0, x2= 0, S1= 1500, S2= 1575, S3= 420 and Z=0. So, NBV={𝑥1, 𝑥2} & BV={𝑆1, 𝑆2, 𝑆3} And BFS is {𝑥1, 𝑥2, 𝑆1, 𝑆2, 𝑆3}={0,0,1500,1575,420} 1–18 15-Oct-15Dr. Atif Shahzad
  • 18. Step 1: Tableaux Row No. Basic Variable Coefficients of: Sol. Ratio Z x1 x2 S1 S2 S3 0 Z 1 -13 -11 0 0 0 0 1 S1 0 4 5 1 0 0 1500 2 S2 0 5 3 0 1 0 1575 3 S3 0 1 2 0 0 1 420 Set up an initial table. 19 Dr. Atif Shahzad 15-Oct-15
  • 19. Step 2: Entering Variable Row NO. Basic Variable Coefficients of: Sol. Ratio Z x1 x2 S1 S2 S3 0 Z 1 -13 -11 0 0 0 0 1 S1 0 4 5 1 0 0 1500 2 S2 0 5 3 0 1 0 1575 3 S3 0 1 2 0 0 1 420 Choose the most negative number from row 0 (i.e Z row). Therefore, x1 is an entering variable. Iteration 1 20 Dr. Atif Shahzad 15-Oct-15
  • 20. Step 3: Leaving variable Row NO. Basic Variable Coefficients of: Sol. Ratio Z x1 x2 S1 S2 S3 0 Z 1 -13 -11 0 0 0 0 1 S1 0 4 5 1 0 0 1500 375 2 S2 0 5 3 0 1 0 1575 315 3 S3 0 1 2 0 0 1 420 420 Calculate Ratio = Sol col. / 𝑥1 col. (𝑥1 > 0) Choose minimum Ratio. That variable(i.e., S2) is a leaving variable. Iteration 1 21 Dr. Atif Shahzad 15-Oct-15
  • 21. Step 4: Find New BFS (Pivoting) Row NO. Basic Variable Coefficients of: Sol. Ratio Z x1 x2 S1 S2 S3 0 Z 1 -13 -11 0 0 0 0 1 S1 0 4 5 1 0 0 1500 375 2 S2 0 5 3 0 1 0 1575 315 3 S3 0 1 2 0 0 1 420 420 • x1 becomes basic variable • S2 becomes non basic variable. Iteration 1 22 Dr. Atif Shahzad 15-Oct-15
  • 22. Step 4: Find New BFS (New Pivot Row) Row NO. Basic Variable Coefficients of: Sol. Ratio Z x1 x2 S1 S2 S3 0 Z 1 -13 -11 0 0 0 0 1 S1 0 4 5 1 0 0 1500 375 2 S2 0 5 3 0 1 0 1575 315 3 S3 0 1 2 0 0 1 420 420 0 5 3 0 1 0 15750 1 3/5 0 1/5 0 375 5 New Pivot row = Current Pivot row Pivot Element = Iteration 1 23 Dr. Atif Shahzad 15-Oct-15
  • 23. Step 4: Find New BFS (New Other Rows) Row NO. Basic Variable Coefficients of: Sol. Ratio Z x1 x2 S1 S2 S3 0 Z 1 -13 -11 0 0 0 0 1 S1 0 4 5 1 0 0 1500 2 S2 0 1 3/5 0 1/5 0 375 3 S3 0 1 2 0 0 1 420 1 0 -16/5 0 13/5 0 4095 -13 0 1 3/5 0 1/5 0 375 Iteration 1 New Other row Current row its Pivot col Coeff.x New pivot row = 1 -13 -11 0 0 0 0 − − 24 Dr. Atif Shahzad 15-Oct-15
  • 24. Step 4: New Tableaux Row No. Basic Varia ble Coefficients of: Sol. Ratio Z x1 x2 S1 S2 S3 0 Z 1 0 -16/5 0 13/5 0 4095 1 S1 0 0 13/5 1 -4/5 0 240 2 x1 0 1 3/5 0 1/5 0 315 3 S3 0 0 7/5 0 -1/5 1 105 Iteration 1 • x1 enters and becomes basic variable. • S2 leaves and becomes non basic variable. • We have a new table. 25 Dr. Atif Shahzad 15-Oct-15
  • 25. Step 2: Entering Variable Row NO. Basic Varia ble Coefficients of: Sol. Ratio Z x1 x2 S1 S2 S3 0 Z 1 0 -16/5 0 13/5 0 4095 1 S1 0 0 13/5 1 -4/5 0 240 2 x1 0 1 3/5 0 1/5 0 315 3 S3 0 0 7/5 0 -1/5 1 105 Iteration 2 26 Dr. Atif Shahzad 15-Oct-15
  • 26. Step 3: Leaving variable Row NO. Basic Variab le Coefficients of: Sol. Ratio Z x1 x2 S1 S2 S3 0 Z 1 0 -16/5 0 13/5 0 4095 1 S1 0 0 13/5 1 -4/5 0 240 277/3 2 x1 0 1 3/5 0 1/5 0 315 525 3 S3 0 0 7/5 0 -1/5 1 105 75 Iteration 2 Calculate Ratio = Sol col. / 𝑥2 col. (𝑜𝑛𝑙𝑦 𝑤ℎ𝑒𝑟𝑒 𝑥2 > 0) Choose minimum Ratio. That variable(i.e., S3) is a leaving variable. 27 Dr. Atif Shahzad 15-Oct-15
  • 27. Step 3: Leaving variable Row No. Basic Variab le Coefficients of: Sol. Ratio Z x1 x2 S1 S2 S3 0 Z 1 0 -16/5 0 13/5 0 4095 1 S1 0 0 13/5 1 -4/5 0 240 277/3 2 x1 0 1 3/5 0 1/5 0 315 525 3 S3 0 0 7/5 0 -1/5 1 105 75 Iteration 2 • x2 becomes basic variable • S3 becomes non basic variable. 28 Dr. Atif Shahzad 15-Oct-15
  • 28. Row No. Basic Variab le Coefficients of: Sol. Ratio Z x1 x2 S1 S2 S3 0 Z 1 0 -16/5 0 13/5 0 4095 1 S1 0 0 13/5 1 -4/5 0 240 277/3 2 x1 0 1 3/5 0 1/5 0 315 525 3 S3 0 0 7/5 0 -1/5 1 105 75 Iteration 2Step 4: Find New BFS (New Pivot Row) 0 0 7/5 0 -1/5 1 750 0 1 0 -1/7 5/7 375/7 7/5 New Pivot row = Current Pivot row Pivot Element = 29 Dr. Atif Shahzad 15-Oct-15
  • 29. Row No. Basic Variab le Coefficients of: Sol. Ratio Z x1 x2 S1 S2 S3 0 Z 1 0 -16/5 0 13/5 0 4095 1 S1 0 0 13/5 1 -4/5 0 240 277/3 2 x1 0 1 3/5 0 1/5 0 315 525 3 S3 0 0 7/5 0 -1/5 1 105 75 Iteration 2Step 4: Find New BFS (New Other Row) -16/5 0 0 1 0 -1/7 5/7 375/7 New Other row Current row its Pivot col Coeff. New pivot row = 1 0 -16/5 0 13/5 0 4095 − − x 30 Dr. Atif Shahzad 15-Oct-15
  • 30. Row No. Basic Variab le Coefficients of: Sol. Ratio Z x1 x2 S1 S2 S3 0 Z 1 0 0 0 15/7 16/7 4335 1 S1 0 0 0 1 -3/7 -13/7 45 2 x1 0 1 0 0 2/7 -3/7 270 3 S3 0 0 1 0 -1/7 5/7 75 Iteration 2Step 4: New Tableaux • x2 enters and becomes basic variable. • S3 leaves and becomes non basic variable. • We have a new table. 31 Dr. Atif Shahzad 15-Oct-15
  • 31. Step 4: RESULT Next Table is : Row NO. Basic Variab le Coefficients of: Sol. Z x1 x2 S1 S2 S3 0 Z 1 0 0 0 15/7 16/7 4335 1 S1 0 0 0 1 -3/7 -13/7 45 2 x1 0 1 0 0 2/7 -3/7 270 3 x2 0 0 1 0 -1/7 5/7 75 Optimal Solution is : x1= 270, x2= 75, Z= 4335 32 Dr. Atif Shahzad 15-Oct-15
  • 32. Iterations Done x1 x2 S1 S2 S3 Sol. Z -13 -11 0 0 0 S1 4 5 1 0 0 1500 S2 5 3 0 1 0 1575 S3 1 2 0 0 1 420 Z 0 -3 1/5 0 2 3/5 0 4095 S1 0 2 3/5 1 - 4/5 0 240 x1 1 3/5 0 1/5 0 315 S3 0 1 2/5 0 - 1/5 1 105 Z 0 0 0 2 1/7 2 2/7 4335 S1 0 0 1 - 3/7 -1 6/7 45 x1 1 0 0 2/7 - 3/7 270 x2 0 1 0 - 1/7 5/7 75 Optimal Solution is : x1= 270, x2= 75, Z= 4335 33 Dr. Atif Shahzad 15-Oct-15
  • 33. Example 2 Max. Z = 3x1+5x2+4x3 Subject to constraints: 2x1+3x2 < 8 2x2+5x3 < 10 3x1+2x2+4x3 < 15 x1, x2, x3 > 0 34 Dr. Atif Shahzad 15-Oct-15
  • 34. Cont… Let S1, S2, S3 be the three slack variables. Modified form is: Z - 3x1-5x2-4x3 =0 2x1+3x2 +S1= 8 2x2+5x3 +S2= 10 3x1+2x2+4x3+S3= 15 x1, x2, x3, S1, S2, S3 > 0 Initial BFS is : x1= 0, x2= 0, x3=0, S1= 8, S2= 10, S3= 15 and Z=0. 35 Dr. Atif Shahzad 15-Oct-15
  • 35. Cont… Basic Variable Coefficients of: Sol. Ratio Z x1 x2 x3 S1 S2 S3 Z 1 -3 -5 -4 0 0 0 0 S1 0 2 3 0 1 0 0 8 8/3 S2 0 0 2 5 0 1 0 10 5 S3 0 3 2 4 0 0 1 15 15/2 Therefore, x2 is the entering variable and S1 is the departing variable. 36 Dr. Atif Shahzad 15-Oct-15
  • 36. Cont… Basic Variable Coefficients of: Sol. Ratio Z x1 x2 x3 S1 S2 S3 Z 1 1/3 0 -4 5/3 0 0 40/3 x2 0 2/3 1 0 1/3 0 0 8/3 - S2 0 -4/3 0 5 -2/3 1 0 14/3 14/15 S3 0 5/3 0 4 -2/3 0 1 29/3 29/12 Therefore, x3 is the entering variable and S2 is the departing variable. 37 Dr. Atif Shahzad 15-Oct-15
  • 37. Cont… Basic Variable Coefficients of: Sol. Ratio Z x1 x2 x3 S1 S2 S3 Z 1 -11/15 0 0 17/15 4/5 0 256/15 x2 0 2/3 1 0 1/3 0 0 8/3 4 x3 0 -4/15 0 1 -2/15 1/5 0 14/15 - S3 0 41/15 0 0 2/15 -4/5 1 89/15 89/41 Therefore, x1 is the entering variable and S3 is the departing variable. 38 Dr. Atif Shahzad 15-Oct-15
  • 38. Cont… Basic Variable Coefficients of: Sol. Z x1 x2 x3 S1 S2 S3 Z 1 0 0 0 45/41 24/41 11/41 765/41 x2 0 0 1 0 15/41 8/41 -10/41 50/41 x3 0 0 0 1 -6/41 5/41 4/41 62/41 x1 0 1 0 0 -2/41 -12/41 15/41 89/41 Optimal Solution is : x1= 89/41, x2= 50/41, x3=62/41, Z= 765/41 39 Dr. Atif Shahzad 15-Oct-15
  • 39. Example 3: Minimization Min.. Z = x1 - 3x2 + 2x3 Subject to constraints: 3x1 - x2 + 3x3 < 7 -2x1 + 4x2 < 12 -4x1 + 3x2 + 8x3 < 10 x1, x2, x3 > 0 40 Dr. Atif Shahzad 15-Oct-15
  • 40. Cont… Convert the problem into maximization problem Max.. Z’ = -x1 + 3x2 - 2x3 where Z’= - Z Subject to constraints: 3x1 - x2 + 3x3 < 7 -2x1 + 4x2 < 12 -4x1 + 3x2 + 8x3 < 10 x1, x2, x3 > 0 41 Dr. Atif Shahzad 15-Oct-15
  • 41. Cont… Let S1, S2 and S3 be three slack variables. Modified form is: Z’ + x1 - 3x2 + 2x3 = 0 3x1 - x2 + 3x3 +S1 = 7 -2x1 + 4x2 + S2 = 12 -4x1 + 3x2 + 8x3 +S3 = 10 x1, x2, x3 > 0 Initial BFS is : x1= 0, x2= 0, x3=0, S1= 7, S2= 12, S3 = 10 42 Dr. Atif Shahzad 15-Oct-15
  • 42. Cont… Basic Variable Coefficients of: Sol. Ratio Z’ x1 x2 x3 S1 S2 S3 Z’ 1 1 -3 2 0 0 0 0 S1 0 3 -1 3 1 0 0 7 - S2 0 -2 4 0 0 1 0 12 3 S3 0 -4 3 8 0 0 1 10 10/3 Therefore, x2 is the entering variable and S2 is the departing variable. 43 Dr. Atif Shahzad 15-Oct-15
  • 43. Cont… Basic Variable Coefficients of: Sol. Ratio Z’ x1 x2 x3 S1 S2 S3 Z’ 1 -1/2 0 2 0 3/4 0 9 S1 0 5/2 0 3 1 1/4 0 10 4 x2 0 -1/2 1 0 0 1/4 0 3 - S3 0 -5/2 0 8 0 -3/4 1 1 - Therefore, x1 is the entering variable and S1 is the departing variable. 44 Dr. Atif Shahzad 15-Oct-15
  • 44. Cont… Basic Variable Coefficients of: Sol. Z’ x1 x2 x3 S1 S2 S3 Z’ 1 0 0 13/5 1/5 8/10 0 11 x1 0 1 0 6/5 2/5 1/10 0 4 x2 0 0 1 3/5 1/5 3/10 0 5 S3 0 0 0 11 1 -1/2 1 11 Optimal Solution is : x1= 4, x2= 5, x3= 0, Z’ = 11 Z = -11 45 Dr. Atif Shahzad 15-Oct-15
  • 45. Example 4 Max.. Z = 3x1 + 4x2 Subject to constraints: x1 - x2 < 1 -x1 + x2 < 2 x1, x2 > 0 46 Dr. Atif Shahzad 15-Oct-15
  • 46. Cont… Let S1 and S2 be two slack variables . Modified form is: Z -3x1 - 4x2 = 0 x1 - x2 +S1 = 1 -x1 + x2 +S2 = 2 x1, x2, S1, S2 > 0 Initial BFS is : x1= 0, x2= 0, S1= 1, S2= 2 and Z=0. 47 Dr. Atif Shahzad 15-Oct-15
  • 47. Cont… Basic Variable Coefficients of: Sol. Ratio Z x1 x2 S1 S2 Z 1 -3 -4 0 0 0 S1 0 1 -1 1 0 1 - S2 0 -1 1 0 1 2 2 Therefore, x2 is the entering variable and S2 is the departing variable. 48 Dr. Atif Shahzad 15-Oct-15
  • 48. Cont… Basic Variable Coefficients of: Sol. Ratio Z x1 x2 S1 S2 Z 1 -7 0 0 4 8 S1 0 0 0 1 1 3 - x2 0 -1 1 0 1 2 - x1 is the entering variable, but as in x1 column every no. is less than equal to zero, ratio cannot be calculated. Therefore given problem is having a unbounded solution. 49 Dr. Atif Shahzad 15-Oct-15
  • 49. Example : Solving in a compact form max z = 40𝑥1 + 88𝑥2 2𝑥1 + 8𝑥2 ≤ 60 5𝑥1 + 2𝑥2 ≤ 60 𝑥1, 𝑥2 ≥ 0 50 Dr. Atif Shahzad 15-Oct-15
  • 50. Step 0: Standard Form Convert all the inequality constraints into equalities by the use of slack variables. Let S1, S2 be three slack variables. Model can rewritten as: z - 40x1 -88x2 = 0 Subject to constraints: 2x1+8x2 + S1 = 60 5x1+2x2 + S2 = 60 x1, x2, S1, S2> 0 51 Dr. Atif Shahzad 15-Oct-15
  • 51. 1 0 0 −40 2 5 −88 8 2 0 1 0 0 0 1 0 60 60 𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏 52 Dr. Atif Shahzad 15-Oct-15
  • 52. 1 0 0 −40 2 5 −88 8 2 0 1 0 0 0 1 0 60 60 𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏 53 Dr. Atif Shahzad 15-Oct-15
  • 53. 1 0 0 −40 2 5 −88 8 2 0 1 0 0 0 1 0 60 60 𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏 60 2 60 5 54 Dr. Atif Shahzad 15-Oct-15
  • 54. 1 0 0 −40 2 5 −88 8 2 0 1 0 0 0 1 0 60 60 𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏 60 2 60 5 55 Dr. Atif Shahzad 15-Oct-15
  • 55. 1 0 0 −40 2 5 −88 8 2 0 1 0 0 0 1 0 60 60 𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏 𝑅1 + 8𝑅3 𝑅2 − 0.4𝑅3 56 Dr. Atif Shahzad 15-Oct-15
  • 56. 1 0 0 0 0 5 −72 7.2 2 0 1 0 8 −0.4 1 480 36 60 𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏 𝑅1 + 8𝑅3 𝑅2 − 0.4𝑅3 57 Dr. Atif Shahzad 15-Oct-15
  • 57. 1 0 0 0 0 5 −72 7.2 2 0 1 0 8 −0.4 1 480 36 60 𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏 𝑅1 + 10𝑅2 𝑅3 − 2 7.2 𝑅2 58 Dr. Atif Shahzad 15-Oct-15
  • 58. 1 0 0 0 0 5 0 7.2 0 10 1 − 1 3.6 8 −0.4 1 0.9 840 36 50 𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏 𝑅1 + 10𝑅2 𝑅3 − 2 7.2 𝑅2 59 Dr. Atif Shahzad 15-Oct-15
  • 59. 1 0 0 0 0 5 0 7.2 0 10 1 − 1 3.6 8 −0.4 1 0.9 840 36 50 𝑧 𝑥1 𝑥2 𝑆1 𝑆2 𝑏 𝑅1 + 10𝑅2 𝑅3 − 2 7.2 𝑅2 𝒛 𝒙 𝟏 𝒙 𝟐 𝟖𝟒𝟎 𝟓𝟎 𝟓 𝟑𝟔 𝟕.𝟐 60 Dr. Atif Shahzad 15-Oct-15
  • 61. Dr. Atif Shahzad THANK YOU FOR YOUR INTEREST 15-Oct-15