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

Simplex Method

This document discusses the simplex method for solving linear programming problems. It begins by introducing the general and standard forms of linear programming problems, including key concepts like slack, surplus, and unrestricted variables. It then provides an example of converting a problem to standard form by adding these variables. Next, it defines the concepts of a basic solution and basic feasible solution. A basic solution results from setting certain variables to zero to equal the number of equations, while a basic feasible solution also satisfies non-negativity conditions. Finally, it illustrates these concepts using a graphical example problem with six basic solutions, identifying the optimal basic feasible solution.

Uploaded by

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

Simplex Method

This document discusses the simplex method for solving linear programming problems. It begins by introducing the general and standard forms of linear programming problems, including key concepts like slack, surplus, and unrestricted variables. It then provides an example of converting a problem to standard form by adding these variables. Next, it defines the concepts of a basic solution and basic feasible solution. A basic solution results from setting certain variables to zero to equal the number of equations, while a basic feasible solution also satisfies non-negativity conditions. Finally, it illustrates these concepts using a graphical example problem with six basic solutions, identifying the optimal basic feasible solution.

Uploaded by

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

EE 413: Operations Research

& Quality Control

Chapter -3

Simplex Method

Dr. Kamalakanta Muduli


Associate Professor
Mechanical Engineering Department
Office: 104
General Formulation of Linear Programming Problem

z= objective Function
x1, x2,….. xn-1, xn = ‘n’ decision variables
b1, b2,….. bm-1, bm = Right hand side values of ‘m’ constraints
‘n’ decision variables and ‘m’ constraints LPP

2
Standard Form of Linear Programming Problem

◼ A linear program in which


1. all the variables are non-negative
2. all the constraints are equalities and
3. Objective function is of Maximization type (optional)
is said to be in standard form.

3
Slack Variables

◼ Example:
◼ Suppose 4 kg/ unit of raw material ‘A’ is consumed for manufacturing
of a product x1 and 3 kg/ unit of raw material ‘A’ is consumed for
manufacturing of a product x2. The total available raw material ‘A’ is
20 Kg. the above can be written as (Mathematically)
4x1 + 3x2 ≤ 20
◼ Suppose company optimal product mix is x1= 3 , x2 = 2, then the
total consumption of raw material A is 18. Hence, the unused qty of
raw material ‘A’ is 2kg…
◼ The equation above using the slack variable can be written as
4x1 + 3x2 + s1 = 20
Slack Variables

◼ Standard form requires that all constraints be in the form of


equations (equalities).
◼ A slack variable is added to a  constraint to convert it to
an equation (=).
◼ A slack variable typically represents an unused resource.
◼ A slack variable contributes nothing to the objective
function value…
◼ Mostly it is represented by using symbol ‘s’
Surplus Variables

◼ Example:
◼ Referring to the diet problem discussed early. That the total feed
requirement is at least 800 kg. The feed comprises of Corn (x1) and
soybean (x2) the above can be written as (Mathematically)
x1 + x2 ≥ 800
◼ Suppose company optimal feed mix is x1= 500 kg , x2 = 350 kg, then
the total feed is 850 kg. Hence, the over stated or excess feed is 50
kg…
◼ The equation above using the surplus variable can be written as
x1 + x2 - S1 = 800
S1= 50 kg
Surplus Variables

◼ A surplus variable is subtracted from a  constraint to


convert it to an equation (=).
◼ A surplus variable represents an excess above a
constraint requirement level…
◼ A surplus variable contributes nothing to the calculated
value of the objective function.
Unrestricted variables

◼ Unrestricted variable means that the variable can take any


value i.e. non-negative (positive) or negative.
◼ The standard form of LPP deals with only non-negative
decision variables…
◼ If x1 is unrestricted in sign, replace it throughout the model
by the difference of two new nonnegative variables x1+, x1-
as x1 = x1+ - x1- or x1- - x1+

where x1+  0, x1-  0


Example: Standard Form of Reddy Mikks Model

Max z = 5x1 + 4x2 + 0s1 + 0s2 + 0s3 + 0s4

subject to:

6x1 + 4x2 + s1 = 24
x1 + 2x2 + s2 = 6
- x1 + x2 + s3 = 1
x2 + s4= 2

x1, x2, s1, s2, s3, s4  0


Where:
x1 = tons produced daily of exterior paint
x2 = tons produced daily of interior paint
s1, s2 , s3, s4 are slack variables

9
Example: Standard Form of Diet Problem Model

Max w (-z) = - 0.3x1 - 0.9x2 + 0s1 + 0S1+ 0S2

subject to:

x1 + x2 - S1 = 800
.21x1 - .30x2 + s1 = 0
.03x1 - .01x2 – S2 = 0

x1, x2, s1, S1, S2  0


Where:
x1 = lb of corn in the daily feed
x2 = ld of soybean in the daily feed
s1, is slack variables
S1, S2 are the surplus variables

10
Example: Standard Form of LPP Model

Max w (-z) = -6x1 – 3(x2+- x2-) + 0s1 + 0S1 Minimize Z = 6x1 + 3x2
subject to:
subject to: 2x1 + 4x2  16
4x1 + 3x2 ≤ 24
2x1 + 4(x2+- x2-) - S1 = 16
4x1 + 3(x2+- x2-) + s1 = 24 x1,  0
x2 is unrestricted in sign
x1, x2+ , x2- , s1, S1  0

11
Concept of Basic Solution and Basic Feasible Solution
Std form of the problem
Max z = 2x1 + 3x2 + 0s1 + 0s2 Maximize z = 2x1 + 3x2
subject to: subject to:
2x1 + x2 + s1 = 4 2x1 + x2 ≤ 4
x1 + 2x2 + s2 = 5
x1 + 2x2 ≤ 5
x1, x2 , s1, s2  0 x1, x2  0
Number of variables = 4
Number of equation = 2
So, to get the solution we need to put How Many variables at the zero level?

Number of variables – Number of equations = 2

How many Solutions?

4C2 = 6
12
Concept of Basic Solution and Basic Feasible Solution
Number of variables = 4 Max z = 2x1 + 3x2 + 0s1 + 0s2
Number of equation = 2 subject to:
So, to get the solution we need to put any 2x1 + x2 + s1 = 4
two variable (var – eq) at the zero level. x1 + 2x2 + s2 = 5
The variables at the zero level, are non-basic x1, x2 , s1, s2  0
The variables at the non-zero level, are basic

Solution Basic Non-basic Solution Remarks


No. variable Variable
(non-zero) (zero)
1 s1, s2 x1 , x 2 s1=4, s2 =5, z =0 Basic Feasible
2 s1, x1 s2 , x2 s1=-6 , x1 =5, z =10 Basic Infeasible
3 s1, x2 s2 , x1 s1=1.5, x2 =2.5, z =7.5 Basic Feasible
4 x1 , x 2 s1, s2 x1=1, x2 =2, z =8 Basic Feasible*
5 s2 , x1 s1, x2 s2=3, x1 =2, z =4 Basic Feasible
6 s2 , x2 s1, x1 s2=-3, x2 =4, z =12 Basic Infeasible
* optimum 13
Concept of Basic Solution and Basic Feasible Solution
The solutions which we get by placing How many Solutions?
(No of var – no. of eq) at the zero level is
called as Basic Solution 4C2 = 6
6 Basic Solutions
The Basic Solution which also satisfy the
non-negativity conditions is called as Basic
Feasible Solution

Solution Basic Non-basic Solution Remarks


No. variable Variable
(non-zero) (zero)
1 s1, s2 x1 , x 2 s1=4, s2 =5, z =0 Basic Feasible
2 s1, x1 s2 , x2 s1=-6 , x1 =5, z =10 Basic Infeasible
3 s1, x2 s2 , x1 s1=1.5, x2 =2.5, z =7.5 Basic Feasible
4 x1 , x 2 s1, s2 x1=1, x2 =2, z =8 Basic Feasible*
5 s2 , x1 s1, x2 s2=3, x1 =2, z =4 Basic Feasible
6 s2 , x2 s1, x1 s2=-3, x2 =4, z =12 Basic Infeasible
* optimum 14
x2 Graphical Representation of
Basic Solution and Basic
5 (0, 4)
Feasible Solution
4 F
Max z = 2x1 + 3x2 + 0s1 + 0s2
3
(0, 2.5) B subject to:
2 C (1, 2) (5, 0) 2x1 + x2 + s1 = 4
1 x1 + 2x2 + s2 = 5
D E x1, x2 , s1, s2  0
(0, 0) A x1
1 2 3 4 5 6
(2, 0)
Solution Basic variable Non-basic Solution Remarks
No. – (non-zero) Variable
Symbol (zero)
1–A s1, s2 x1 , x2 s1=4, s2 =5, z =0 Basic Feasible
2–E s1, x1 s2 , x2 s1=-6 , x1 =5, z =10 Basic Infeasible
3–B s1, x2 s2 , x1 s1=1.5, x2 =2.5, z =7.5 Basic Feasible
4–C x1 , x2 s1, s2 x1=1, x2 =2, z =8 Basic Feasible*
5–D s2 , x1 s1, x2 s2=3, x1 =2, z =4 Basic Feasible
6–F s2 , x2 s1, x1 s2=-3, x2 =4, z =12 Basic Infeasible 15
Important Observations
1. All basic sols are obtained by
x2 placing 2 variables (No. of eq –
No. of const) at zero levels.
2. Basic feasible sol is one of the
5
extreme point of the feasible sol
4 space.
3 3. There is change of one variable
B when we move from one extreme
C
2
point to another. That is one basic
1 variable becomes non-basic, and
D
A x1 one non-basic variable becomes
1 2 3 4 5 6
basic variable.

Solution Basic variable Non-basic Solution Remarks


No. – (non-zero) Variable
Symbol (zero)
1–A s1, s2 x1, x2 s1=4, s2 =5, z =0 Basic Feasible
3–B s1, x2 s2 , x1 s1=1.5, x2 =2.5, z =7.5 Basic Feasible
4–C x1, x2 s1, s2 x1=1, x2 =2, z =8 Basic Feasible*
5–D x1, s2 s1, x2 s2=3, x1 =2, z =4 Basic Feasible 16
The Simplex Method

❖ When decision variables are more than 2, it is always


advisable to use Simplex Method to avoid lengthy
graphical procedure.

❖ The simplex method does not examine all the feasible


solutions.

❖ It deals only with a unique set of basic feasible solutions,


the set of vertex points (i.e., extreme points) of the feasible
solution space that contains the optimal solution.

17
The Simplex Method
❖ Steps involved:
1. Locate an extreme point of the feasible region (Normally
simplex method starts from the origin point).
2. Examine each boundary edge intersecting at this point to
see whether movement along any edge increases the value
of the objective function.
3. If the value of the objective function increases along any
edge, move along this edge to the adjacent extreme point. If
several edges indicate improvement, the edge providing the
greatest rate of increase is selected.
4. Repeat steps 2 and 3 until movement along any edge no
longer increases the value of the objective function.

18
The Simplex Method – Iterative Nature
x2
❖ Steps involved:
1. Start at ‘A’ Maximize z = 2x1 + 3x2
5
Sol (A) x1=0, x2=0, s1=4, s2 =5, z =0 4
2. From A, we can move to B or D. 3
B
Sol (B) x1=0, x2=2.5, s1=1.5, s2 =0, z =7.5 2 C

Sol (D) x1=2, x2=0, s1=0, s2 =3, z =4 1


D
Move to B A x1
1 2 3 4 5 6
3. From B, move to C.
The simplex method is
Note: Sol. Cannot move back (already
considered extreme points), and next sol designed in such a way that
should not skip extreme point it reaches to the optimal
solution in a least iterative
Sol (C) x1=1, x2=2, s1=0, s2 =0, z =8
steps.
Hence optimal solution is at point C… 19
Computational details of the Simplex Method
Reddy Mikks Problem: Std Form
x2
Max z = 5x1 + 4x2 + 0s1 + 0s2 + 0s3 + 0s4 E D
2
z - 5x1 - 4x2 - 0s1 - 0s2 - 0s3 - 0s4 =0 C
subject to: 1 F
6x1 + 4x2 + s1 = 24 A B
x1 + 2x2 + s2 = 6 1 2 3 4 x1
- x 1 + x 2 + s3 = 1
x2 + s4= 2
x1, x2, s1, s2, s3, s4  0

1.Start at ‘A’
Sol (A) x1=0, x2=0, s1=24, s2 =6, s3=1, s4 =2, z =0

20
Computational details of the Simplex Method
z - 5x1 - 4x2 - 0s1 - 0s2 - 0s3 - 0s4 =0
x2
subject to:
E D
2
6x1 + 4x2 + s1 = 24 C
x1 + 2x2 + s2 = 6 1 F
- x1 + x2 + s3 = 1
A B
x2 + s4= 2
x1, x2, s1, s2, s3, s4  0 1 2 3 4 x1

1.Start at ‘A’ : Sol (A) x1=0, x2=0, s1=24, s2 =6, s3=1, s4 =2, z =0
Solution ‘A’ represented in tabular form as below:

Basic z x1 x2 s1 s2 s3 s4 solution
z 1 -5 -4 0 0 0 0 0
s1 0 6 4 1 0 0 0 24
s2 0 1 2 0 1 0 0 6
s3 0 -1 1 0 0 1 0 1
s4 0 0 1 0 0 0 1 2

21
Computational details of the Simplex Method
Initial solution

Basic z x1 x2 s1 s2 s3 s4 solution
z 1 -5 -4 0 0 0 0 0
s1 0 6 4 1 0 0 0 24
s2 0 1 2 0 1 0 0 6
s3 0 -1 1 0 0 1 0 1
s4 0 0 1 0 0 0 1 2

Solution is feasible: If all the values under solution column are +ve
Solution is optimal:
For maximization case: If all the elements in z row are 0 or +ve
For minimization case: If all the elements in z row are 0 or -ve

The initial solution above is feasible as all the values under solution column are +ve.

The initial solution above is NOT optimal as some of the elements in z row are negative

Since solution is feasible but non-optimal, so Develop the next iteration


22
Computational details of the Simplex Method
Key Element Key column Key row

Basic z x1 x2 s1 s2 s3 s4 solution
z 1 -5 -4 0 0 0 0 0
s1 0 66 4 1 0 0 0 24 24/6=4
s2 0 1 2 0 1 0 0 6 6/1= 6
s3 0 -1 1 0 0 1 0 1 1/-1
s4 0 0 1 0 0 0 1 2 1/0

For developing the next iteration first find out most negative number (z=max) in the z row.
Most negative number is -5, highlight that column, the corresponding variable i.e. x1
which is non-basic now, will enter the solution or become the basic variable.
So, entering variable is x1, the column corresponding to x1 var. is known as key column

Second find out the basic variable, which will leave the solution, means become non-
basic from basic and for this
Divide each element of solution by the corresponding element of key column. (Ignore
the ratio with 0 and –ve as denominator)
Highlight the row which gives minimum +ve ratio, The variable corresponding to this
row, known as key row, and leaves the sol and becomes non-basic from basic.

The COMMON ELEMENT OF KEY ROW AND KEY COLUMN IS KEY ELEMENT
23
Computational details of the Simplex Method
Key Element Key column Key row

Basic z x1 x2 s1 s2 s3 s4 solution
z 1 -5 -4 0 0 0 0 0
s1 0 6 4 1 0 0 0 24 24/6=4
s2 0 1 2 0 1 0 0 6 6/1= 6
s3 0 -1 1 0 0 1 0 1 1/-1
s4 0 0 1 0 0 0 1 2 1/0

How to generate the next solution?


1. Change the s1 variable under basic column to x1
2. Make the fresh table by incorporating the above change as below

Basic z x1 x2 s1 s2 s3 s4 solution
z
x1
s2
s3
s4
24
Computational details of the Simplex Method
Initial solution
Basic z x1 x2 s1 s2 s3 s4 solution
z 1 -5 -4 0 0 0 0 0
s1 0 6 4 1 0 0 0 24
s2 0 1 2 0 1 0 0 6
s3 0 -1 1 0 0 1 0 1
s4 0 0 1 0 0 0 1 2

How to generate the next solution?


3. Calculate and Write down the elements of x1 row in new table as
Corresponding element in key row / key element

Basic z x1 x2 s1 s2 s3 s4 solution
z
x1 0 1 2/3 1/6 0 0 0 4
s2
s3
s4
25
Computational details of the Simplex Method
Initial solution
Basic z x1 x2 s1 s2 s3 s4 solution
z 1 -5 -4 0 0 0 0 0
s1 0 6 4 1 0 0 0 24
s2 0 1 2 0 1 0 0 6
s3 0 -1 1 0 0 1 0 1
s4 0 0 1 0 0 0 1 2

How to generate the next solution?


4. Calculate and Write down rest of the elements in new table by using the formula below:
corresponding elementi in key row X correspodning element in key column
New element = old element − key element

Basic z x1 x2 s1 s2 s3 s4 solution
z 1 0 - 2/3 5/6 0 0 0 20
x1 0 1 2/3 1/6 0 0 0 4
s2 0 0 4/3 - 1/6 1 0 0 2
s3 0 0 5/3 1/6 0 1 0 5
s4 0 0 1 0 0 0 1 2
26
Computational details of the Simplex Method
Second solution
Basic z x1 x2 s1 s2 s3 s4 solution
z 1 0 - 2/3 5/6 0 0 0 20
x1 0 1 2/3 1/6 0 0 0 4
s2 0 0 4/3 - 1/6 1 0 0 2
s3 0 0 5/3 1/6 0 1 0 5
s4 0 0 1 0 0 0 1 2
Solution: basic variables: x1=4, s2=2, s3=5, s4=2, Objective function value z=20
Non - basic variables: s1=0, x2=0

Solution: x1=4, s2=2, s3=5, s4=2, s1=0, x2=0 Objective function value z=20
This is corresponding to Point ‘B’ (refer the graphical solution)
x2
E D
2
C
1 F
A B

1 2 3 4 x1 27
Computational details of the Simplex Method
Second solution
Basic z x1 x2 s1 s2 s3 s4 solution
z 1 0 - 2/3 5/6 0 0 0 20
x1 0 1 2/3 1/6 0 0 0 4 4/(2/3)=6
s2 0 0 4/3 - 1/6 1 0 0 2 2/(4/3)=1.5
s3 0 0 5/3 1/6 0 1 0 5 5/(5/3)=3

s4 0 0 1 0 0 0 1 2 2/1=2

The second solution above is feasible as all the values under solution column are +ve.
The second solution above is NOT optimal as some of the elements in z row are negative
Since solution is feasible but non-optimal, so Develop the next iteration

First find out the entering variable: as the z row has only one –ve element so variable
corresponding to that is entering variable and column corresponding is key column

Next find out the outgoing variable: the minimum ratio rule, the minimum ratio is 1.5,
So the variable s2 is outgoing variable (means becoming non-basic from basic) and the
Corresponding row is the key row.

The COMMON ELEMENT OF KEY ROW AND KEY COLUMN IS KEY ELEMENT
28
Computational details of the Simplex Method
Second solution
Basic z x1 x2 s1 s2 s3 s4 solution
z 1 0 - 2/3 5/6 0 0 0 20
x1 0 1 2/3 1/6 0 0 0 4
s2 0 0 4/3 - 1/6 1 0 0 2
s3 0 0 5/3 1/6 0 1 0 5
s4 0 0 1 0 0 0 1 2
The
Howsecond solution the
to generate above is feasible
next as all the values under solution column are +ve.
solution?
The
1. second
Changesolution
the s2above is NOT
variable optimal
under ascolumn
basic some of to
thex2
elements in z row are negative
2. Make
Since theisfresh
solution table
feasible but by incorporating
non-optimal, the above
so Develop change
the next as below
iteration

Basic z x1 x2 s1 s2 s3 s4 solution
z
x1
x2
s3
s4

29
Computational details of the Simplex Method
Second solution
Basic z x1 x2 s1 s2 s3 s4 solution
z 1 0 - 2/3 5/6 0 0 0 20
x1 0 1 2/3 1/6 0 0 0 4
s2 0 0 4/3 - 1/6 1 0 0 2
s3 0 0 5/3 1/6 0 1 0 5
s4 0 0 1 0 0 0 1 2

How to generate the next solution?


3. Calculate and Write down the elements of x2 row in new table as
= Corresponding element in key row / key element

Basic z x1 x2 s1 s2 s3 s4 solution
z
x1
x2 0 0 1 -1/8 3/4 0 0 3/2
s3
s4

30
Computational details of the Simplex Method
Second solution
Basic z x1 x2 s1 s2 s3 s4 solution
z 1 0 - 2/3 5/6 0 0 0 20
x1 0 1 2/3 1/6 0 0 0 4
s2 0 0 4/3 - 1/6 1 0 0 2
s3 0 0 5/3 1/6 0 1 0 5
s4 0 0 1 0 0 0 1 2
How to generate the next solution?
4. Calculate and Write down rest of the elements in new table by using the formula below:
corresponding elementi in key row X correspodning element in key column
New element = old element − key element
Basic z x1 x2 s1 s2 s3 s4 solution
z 1 0 0 3/4 1/2 0 0 21
x1 0 1 0 1/4 - 1/2 0 0 3
x2 0 0 1 - 1/8 3/4 0 0 3/2
s3 0 0 0 3/8 -5/4 1 0 5/2
s4 0 0 0 1/8 - 3/4 0 1 1/2
31
Computational details of the Simplex Method
Third solution
Basic z x1 x2 s1 s2 s3 s4 solution
z 1 0 0 3/4 1/2 0 0 21
x1 0 1 0 1/4 - 1/2 0 0 3
x2 0 0 1 - 1/8 3/4 0 0 3/2
s3 0 0 0 3/8 -5/4 1 0 5/2
s4 0 0 0 1/8 - 3/4 0 1 1/2
The third solution above is feasible as all the values under solution column are +ve.
The third solution above is OPTIMAL as all elements in z row are 0 or +ve
So, solution is feasible and optimal
Maximize z = 5x1 + 4x2
x2
Solution: E D
2
x1=3, x2 = 3/2, s1=0, s2=0, s3=5/2, s4=1/2,
C
Objective function value z=21
This is corresponding to Point ‘C’ 1 F
(refer the graphical solution) A B

1 2 3 4 x1
32
Insight into the solution of Reddy Mikks Problem
Max z = 5x1 +4x2 +0s1 +0s2 +0s3 +0s4 Solution:
x1=3, x2 = 3/2, s1=0, s2=0, s3=5/2, s4=1/2,
subject to: Objective function value z=21
6x1 + 4x2 + s1 = 24 (Raw material M1)
x1 + 2x2 + s2 = 6 (Raw material M2) s1=0, s2=0 means that Raw materials
- x1 + x2 + s3 = 1 (Market Limit) M1 and M2will be fully consumed
x2 + s4= 2 (Demand Limit) when x1=3, and x2=1.5, this means
Raw materials M1 and M2 are Scarce
x1, x2, s1, s2, s3, s4  0
Where:
s3=5/2,s4=1/2 means that market and demand
x1 = tons produced daily of ext paint Limits are not fully consumed.
x2 = tons produced daily of int paint this means
s1, s2 , s3, s4 are slack variables market limit and demand is abundant

Data

33
Example: Simplex Method (Minimization)
Standard Form
Min w = x1 - 3x2 - 2x3
Min w = x1 - 3x2 - 2x3 + 0s1 + 0s2 + 0s3
subject to:
w - x1 + 3x2 + 2x3 - 0s1 - 0s2 - 0s3 =0
3x1 - x2 + 2x3 ≤ 7
subject to:
- 2x1 + 4x2 ≤ 12
- 4x1 + 3x2 + 8x3 ≤ 10 3x1 - x2 + 2x3 + s1 =7
- 2x1 + 4x2 + s2 = 12
x1, x2, x3 0
- 4x1 + 3x2 + 8x3 + s3 = 10
x1, x2, x3, s1, s2, s3  0

No. of variables = 6
No. of constraints = 3
How many non-basic variable (zero level) = 3
Initial solutions, x1=0, x2 =0, x3 = 0, s1 = 7, s2 = 12, s3 = 10, w=0

34
Example: Simplex Method (Minimization)
Standard Form
Initial solution is feasible
Min w = x1 - 3x2 - 2x3 + 0s1 + 0s2 + 0s3 Initial solution is non-optimal
w - x1 + 3x2 + 2x3 - 0s1 - 0s2 - 0s3 =0
subject to:
3x1 - x2 + 2x3 + s1 =7
- 2x1 + 4x2 + s2 = 12
- 4x1 + 3x2 + 8x3 + s3 = 10
x1, x2, x3, s1, s2, s3  0

Initial Solution

Basic w x1 x2 x3 s1 s2 s3 solution
w 1 -1 3 2 0 0 0 0
s1 0 3 -1 2 1 0 0 7
s2 0 -2 4 0 0 1 0 12
s3 0 -4 3 8 0 0 1 10

35
Example: Simplex Method (Minimization)
Standard Form
Initial solution is feasible
Min w = x1 - 3x2 - 2x3 + 0s1 + 0s2 + 0s3 Initial solution is non-optimal
w - x1 + 3x2 + 2x3 - 0s1 - 0s2 - 0s3 =0
subject to:
Key variable is x2
3x1 - x2 + 2x3 + s1 =7 Key column is corresponding to x2
- 2x1 + 4x2 + s2 = 12
- 4x1 + 3x2 + 8x3 + s3 = 10
x1, x2, x3, s1, s2, s3  0

Initial Solution

Basic w x1 x2 x3 s1 s2 s3 solution
w 1 -1 3 2 0 0 0 0
s1 0 3 -1 2 1 0 0 7
s2 0 -2 4 0 0 1 0 12
s3 0 -4 3 8 0 0 1 10

36
Example: Simplex Method (Minimization)
Standard Form Initial solution is feasible
Initial solution is non-optimal
Min w = x1 - 3x2 - 2x3 + 0s1 + 0s2 + 0s3
w - x1 + 3x2 + 2x3 - 0s1 - 0s2 - 0s3 =0 Key variable is x2
Key column is corresponding to x2
subject to:
Key row?
3x1 - x2 + 2x3 + s1 =7
Min ratio corresponding to s2
- 2x1 + 4x2 + s2 = 12
So key row is s2
- 4x1 + 3x2 + 8x3 + s3 = 10
x1, x2, x3, s1, s2, s3  0 Key Element? = 4

Initial Solution

Basic w x1 x2 x3 s1 s2 s3 solution
w 1 -1 3 2 0 0 0 0
s1 0 3 -1 2 1 0 0 7 NA
s2 0 -2 4 0 0 1 0 12 12/4=3
s3 0 -4 3 8 0 0 1 10 10/3=3.3

37
Example: Simplex Method (Minimization)
Second Solution
Basic w x1 x2 x3 s1 s2 s3 solution
w 1 1/2 0 2 0 -3/4 0 -9
s1 0 5/2 0 2 1 1/4 0 10
x2 0 -1/2 1 0 0 1/4 0 3
s3 0 -5/2 0 8 0 -3/4 1 1
Third Solution Fourth solution
is feasible and
Basic w x1 x2 x3 s1 s2 s3 solution
w 1 9/8 0 0 0 -9/16 -1/4 -37/4 optimal
s1 0 25/8 0 0 1 7/16 -1/4 39/4
x2 0 -1/2 1 0 0 1/4 0 3
x3 0 -5/16 0 1 0 -3/32 1/8 1/8
Fourth Solution
Basic w x1 x2 x3 s1 s2 s3 solution
w 1 0 0 0 -9/25 -18/25 -4/25 -319/25
x1 0 1 0 0 8/25 7/50 -2/25 78/25
x2 0 0 1 0 4/25 8/25 -1/25 114/25
x3 0 0 0 1 1/10 -43/800 1/10 11/10 38
Example: Simplex Method (Minimization)
Fourth Solution
Basic w x1 x2 x3 s1 s2 s3 solution
w 1 0 0 0 -9/25 -18/25 -4/25 -319/25 Fourth solution
x1 0 1 0 0 8/25 7/50 -2/25 78/25 is feasible and
x2 0 0 1 0 4/25 8/25 -1/25 114/25 optimal
x3 0 0 0 1 1/10 -43/800 1/10 11/10

Solution:
x1=78/25,
x2 = 114/25
x3 = 11/10
Objective function value w= -319/25

Min w = x1 - 3x2 - 2x3


subject to:
3x1 - x2 + 2x3 ≤ 7
- 2x1 + 4x2 ≤ 12
- 4x1 + 3x2 + 8x3 ≤ 10
x1, x2, x3 0 39
Simplex method when some or all the
constraints are NOT “≤” constraints
BIG ‘M’ METHOD

40
Example: Simplex Method (Minimization)
Standard Form
Min w = x1 - 3x2 - 2x3
Min w = x1 - 3x2 - 2x3 + 0s1 + 0s2 + 0s3
subject to:
w - x1 + 3x2 + 2x3 - 0s1 - 0s2 - 0s3 =0
3x1 - x2 + 2x3 ≤ 7
subject to:
- 2x1 + 4x2 ≤ 12
- 4x1 + 3x2 + 8x3 ≤ 10 3x1 - x2 + 2x3 + s1 =7
- 2x1 + 4x2 + s2 = 12
x1, x2, x3 0
- 4x1 + 3x2 + 8x3 + s3 = 10
x1, x2, x3, s1, s2, s3  0
No. of variables = 6
No. of constraints = 3
How many variables to put at zero level to get solution = 3
Initial solutions, x1=0, x2 =0, x3 = 0, s1 = 7, s2 = 12, s3 = 10, z=0

When all the constraints are less than or equal type, ≤,


we get immediate starting feasible solution in terms of slack variables.
41
Simplex method when some or all the constraints
are NOT “≤” constraints

Example:

Max z= 16x1+15x2+20x3-18x4
Subject to
2x1 + x2 + 3x3 ≤ 3000 [1]
3x1 + 4x2 + 5x3 – 60x4 ≤ 2400 [2]
x4 ≤ 32 [3]
x2 ≥ 200 [4]
x1 + x2 + x3 ≥ 800 [5]
x1 – x2 – x3 =0 [6]
xj ≥ 0 for all J

42
Simplex method when some or all the constraints are
NOT “≤” constraints
Example: in Standard Form

Max z= 16x1+15x2+20x3-18x4 +s1 +s2 +s3 + S1 + S2


z - 6x1-15x2-20x3+18x4 -s1 -s2-s3 - S1 - S2 = 0
Subject to

2x1 + x2 + 3x3 +s1 = 3000 [1]


3x1 + 4x2 + 5x3 – 60x4 +s2 = 2400 [2]
x4 +s3 = 32 [3]
x2 -S1 = 200 [4]
x1 + x2 + x3 -S2 = 800 [5]
x1 – x2 – x3 =0 [6]
xj , sj, Sj ≥ 0 for all J

No. of variables = 9
No. of constraints = 6
How many variables to put at zero level to get solution = 3
Initial solutions, ??
Most of the time it is tough to find initial
43 immediate feasible solution
Simplex method when some or all the constraints are
NOT “≤” constraints

◼ We employ a mathematical “ trick” to jumpstart the


problem by adding artificial variables to the
equations.

44
Simplex method when some or all the constraints
are NOT “≤” constraints

Example:

Max z= 16x1+15x2+20x3-18x4
Subject to
2x1 + x2 + 3x3 ≤ 3000 [1]
3x1 + 4x2 + 5x3 – 60x4 ≤ 2400 [2]
x4 ≤ 32 [3]
x2 ≥ 200 [4]
x1 + x2 + x3 ≥ 800 [5]
x1 – x2 – x3 =0 [6]
xj ≥ 0 for all J

45
Simplex method when some or all the constraints are
NOT “≤” constraints
We assign a very
Example: in Standard Form (First Step)
large negative
objective function
Max z= 16x1+15x2+20x3-18x4+0s1+0s2+0s3+0S1+0S2
coefficient , -M , (
z- 6x1-15x2-20x3+18x4-0s1-0s2-0s3-0S1-0S2 = 0
Subject to +M for minimization
problem) to each
2x1 + x2 + 3x3 +s1 = 3000 [1] artificial variable
3x1 + 4x2 + 5x3 – 60x4 +s2 = 2400 [2]
x4 +s3 = 32 [3]
x2 -S1 = 200 [4] We add artificial :
x1 + x2 + x3 -S2 = 800 [5] R4, R5, R6, respectively to
x1 – x2 – x3 =0 [6] the fourth, fifth, and sixth
xj , sj, Sj ≥ 0 for all J equations.

46
Simplex method when some or all the constraints are
NOT “≤” constraints
Example: Standard Form (after adding artificial variables to constraints of type = or ≥ type
and –M to the objective function

Max z= 16x1+15x2+20x3-18x4+0s1+0s2+0s3+0S1+0S2-MR1-MR2-MR3
z-16x1-15x2-20x3+18x4-0s1-0s2-0s3-0S1-0S2+MR1+MR2+MR3= 0

Subject to
2x1 + x2 + 3x3 +s1 = 3000 [1]
3x1 + 4x2 + 5x3 – 60x4 +s2 = 2400 [2]
x4 +s3 = 32 [3]
x2 -S1 + R1 = 200 [4]
x1 + x2 + x3 -S2 + R2 = 800 [5]
x1 – x2 – x3 + R3 =0 [6]
xj , sj, Sj , Rj ≥ 0 for all J
No. of variables = 12
No. of constraints = 6
How many variables to put at zero level to get solution = 6
Initial solutions:
x1=0, x2 =0, x3 = 0, x4 = 0, S1 = 0, S2 = 0
s1 = 3000, s2 = 2400, s3 = 32, R1 = 200, R2 = 800, R3 = 0,
z=-1000M 47
Simplex method when some or all the constraints are
NOT “≤” constraints
This Method is known as BIG M Method or the PENALTY Method

We assign a very large negative objective function coefficient ,

-M in case of Maximization Problem to each artificial variable

+M in case of minimization problem to each artificial variable

This way we penalize the Objective function. The purpose of adding artificial
variable is to get the immediate feasible solution ONLY.

By penalizing the Objective function we make these variables Unattractive so


that in the final optimal solution they should not appear.

If the artificial variables still appear in the Optimal solution, this means the
problem is infeasible.

48
Solving For the optimal solution of [Maximization]
when there are artificial variables
Example
Maximize z = 2x1+ 5x2

Subject to
x1 ≥4
x1 + 4x2 ≤ 32
3x1+ 2x2 = 24

x1, x2 ≥ 0 for all J

49
Solving For the optimal solution of [Maximization]
when there are artificial variables
Solution
Maximize z = 2x1+ 5x2 ◼ By adding the appropriate slack, surplus,
and artificial variables, we obtain the
Subject to following in standard form:
x1 ≥4 Maximize z = 2x1+ 5x2+0S1+0s2-MR1-MR2
x1 + 4x2 ≤ 32
3x1+ 2x2 = 24 z -2x1-5x2-0S1-0s2+MR1+MR2 = 0
Subject to
x1, x2 ≥ 0 for all J x1 -S1 +R1 =4
x1 + 4x2 +s2 = 32
3x1+ 2x2 +R2 = 24
x1, x2, S1, s2, R1, R2 ≥ 0
No. of variables = 6
No. of constraints = 3
How many variables to put at zero level to get solution = 3
Initial solutions:
x1=0, x2 =0, S1 = 0,
R1 = 4, s2 = 32, R3 = 24, z=-28M 50
Maximize z = 2x1+ 5x2+0S1+0s2-MR1-MR2
Solving For the optimal
z -2x1-5x2-0S1-0s2+MR1+MR2 = 0
solution of
[Maximization] when Subject to
x1 -S1 +R1 =4
there are artificial variables x1 + 4x2 +s2 = 32
3x1+ 2x2 +R2 = 24
x1, x2, S1, s2, R1, R2 ≥ 0
The initial table (wrong) :
Basic z x1 x2 S1 s2 R1 R2 RHS
z 1 -2 -5 0 0 M M -28
R1 0 1 0 -1 0 1 0 4 R1, s2, R2 are
basic
s2 0 1 4 0 1 0 0 32 variables.

R2 0 3 2 0 0 0 1 24

Note : the values under the


column R1, and R2 (both being basic variable) should be 0
51
Solving For the optimal solution of [Maximization] when there
are artificial variables
Maximize z = 2x1+ 5x2+0S1+0s2-MR1-MR2 So before jumping to First table
first replace R1 and R2 in OF
Subject to
By substituting
x1 -S1 +R1 =4 [1]
the value of R1 and R2
x1 + 4x2 +s2 = 32 [2]
From the corresponding
3x1+ 2x2 +R2 = 24 [3]
constraints
x1, x2, S1, s2, R1, R2 ≥ 0

From eq. 1: R1= 4 - x1 + S1


From eq. 3: R2= 24-3x1-2x2 & Substitute the value of R1 and R2 in Objective function

Maximize z = (2+4M)x1+ (5+2M)x2-MS1+0s2-28M


z - (2+4M)x1-(5+2M)x2+MS1-0s2 = -28M

Subject to
x1 -S1 +R1 =4 [1]
x1 + 4x2 +s2 = 32 [2]
3x1+ 2x2 +R2 = 24 [3]
x1, x2, S1, s2, ≥ 0 52
Solving For the optimal Maximize z = (2+4M)x1+ (5+2M)x2-MS1+0s2-28M
solution of [Maximization]z - (2+4M)x1-(5+2M)x2+MS1-0s2 = 28M
when there are artificial
variables Subject to
x1 -S1 +R1 =4 [1]
x1 + 4x2 +s2 = 32 [2]
3x1+ 2x2 +R2 = 24 [3]
x1, x2, S1, s2, ≥ 0

The initial table :


Basic z x1 x2 S1 s2 R1 R2 RHS
z 1 -2-4M -5-2M +M 0 0 0 -28M
R1, s2, R2
R1 0 1 0 -1 0 1 0 4 are basic
variables.
s2 0 1 4 0 1 0 0 32
R2 0 3 2 0 0 0 1 24

Solution infeasible as R1 and R2 +ve


53
The initial table :
Basic z x1 x2 S1 s2 R1 R2 RHS
z 1 -2-4M -5-2M +M 0 0 0 -28M
R1, s2, R2
R1 0 1 0 -1 0 1 0 4 are basic
variables.
s2 0 1 4 0 1 0 0 32
R2 0 3 2 0 0 0 1 24

The SECOND table :


Basic z x1 x2 S1 s2 R1 R2 RHS
z 1 0 -5-2M -2-3M 0 2+4M 0 8-12M
x1, s2, R2
x1 0 1 0 -1 0 1 0 4 are basic
variables.
s2 0 0 4 1 1 -1 0 28
R2 0 0 2 3 0 -3 1 12

Solution infeasible as R2 +ve


54
The SECOND table :
Basic z x1 x2 S1 s2 R1 R2 RHS
z 1 0 -5-2M -2-3M 0 2+4M 0 8-12M
x1, s2, R2
x1 0 1 0 -1 0 1 0 4 are basic
variables.
s2 0 0 4 1 1 -1 0 28
R2 0 0 2 3 0 -3 1 12

The THIRD table :


Basic z x1 x2 S1 s2 R1 R2 RHS
z 1 0 -11/3 0 0 M M+2/3 16
x1, s2, S1
x1 0 1 2/3 0 0 0 1/3 8 are basic
variables.
s2 0 0 10/3 0 1 0 - 1/3 24
S1 0 0 2/3 1 0 -1 1/3 4

Solution Feasible but Non-Optimal


55
The THIRD table :
Basic z x1 x2 S1 s2 R1 R2 RHS
z 1 0 -11/3 0 0 M M+2/3 16
x1, s2, S1
x1 0 1 2/3 0 0 0 1/3 8 are basic
variables.
s2 0 0 10/3 0 1 0 - 1/3 24
S1 0 0 2/3 1 0 -1 1/3 4

The FOURTH table :


Basic z x1 x2 S1 s2 R1 R2 RHS
z 1 0 0 11/2 0 M-11/3 M+15/6 38
x1, s2, x2
x1 0 1 0 -1 0 1 0 4 are basic
variables.
s2 0 0 0 -5 1 5 -2 4
x2 0 0 1 3/2 0 -3/2 1/2 6

Solution Feasible and Optimal


56
Solving For the optimal solution of [Maximization] when there
are artificial variables

Summary

points Classification Reason


x1=0, x2=0 Not Feasible R1, R2 both Positive (4, 24)

x1=4, x2=0 Not Feasible R2 positive= 12


x1=8, x2=0 Feasible but not optimal Z row element is negative
x1=4, x2=6 Feasible and optimal Z row elements and x1,x2 ≥0

57
Solving For the optimal solution of [Minimization]
when there are artificial variables
Solution
Minimize w= 4x1 + x2
Subject to ◼ By adding the appropriate slack, surplus,
3x1+ x2 = 3 and artificial variables, we obtain the
4x1 + 3x2 ≥ 6 following in standard form:
x1+ 2x2 ≤ 4 Minimize w = 4x1 + x2 + 0s2 + 0S1+MR1+MR2
x1, x2 ≥ 0
w -4x1-x2+0S1+0s2-MR1-MR2 = 0
Subject to
3x1+ x2 + R1 =3
4x1 + 3x2 – S1 + R2 =6
x1+ 2x2 +s2= 4
x1, x2, S1, s2, R1, R2 ≥ 0
No. of variables = 6
No. of constraints = 3
How many variables to put at zero level to get solution = 3
Initial solutions:
x1=0, x2 =0, S1 = 0,
R1 = 3, s2 = 4, R2 = 6, w=9M 58
Solving For the optimal solution of [Minimization] when there
are artificial variables
Minimize w = 4x1 + x2 + 0s2 + 0S1+MR1+MR2
w -4x1-x2+0S1+0s2-MR1-MR2 = 0 So before jumping to First table
Subject to first replace R1 and R2 in OF
3x1+ x2 + R1 =3 By substituting
4x1 + 3x2 – S1 + R2 =6 the value of R1 and R2
x1+ 2x2 +s2= 4 From the corresponding
x1, x2, S1, s2, R1, R2 ≥ 0 constraints
From eq. 1: R1= 3 - 3x1 – x2
From eq. 2: R2= 6-4x1-3x2+S1 & Substitute the value of R1 and R2 in Objective
function
Minimize w = (4-7M)x1+ (1-4M)x2+MS1+0s2+9M
w - (4-7M)x1-(1-4M)x2-MS1-0s2 = 9M

Subject to
3x1+ x2 + R1 =3 [1]
4x1 + 3x2 – S1 + R2 =6 [2]
x1+ 2x2 +s2= 4 [3]
x1, x2, S1, s2, R1, R2 ≥ 0 59
Solving For the optimal Minimize w = (4-7M)x1+ (1-4M)x2+MS1+0s2+9M
solution of [Minimization] w - (4-7M)x1-(1-4M)x2-MS1-0s2 = 9M
when there are artificial
variables Subject to
3x1+ x2 + R1 =3 [1]
4x1 + 3x2 – S1 + R2 =6 [2]
x1+ 2x2 +s2= 4 [3]
x1, x2, S1, s2, R1, R2 ≥ 0

Basic w x1 x2 S1 s2 R1 R2 RHS
w 1 7M-4 4M-1 -M 0 0 0 9M
R1, s2, R2
R1 0 3 1 0 0 1 0 3 are basic
variables.
R2 0 4 3 -1 0 0 1 6
s2 0 1 2 0 1 0 0 4

Solution infeasible as R1 and R2 +ve


60
The initial table :
Basic w x1 x2 S1 s2 R1 R2 RHS
w 1 7M-4 4M-1 -M 0 0 0 9M
R1, s2, R2
R1 0 3 1 0 0 1 0 3 are basic
variables.
R2 0 4 3 -1 0 0 1 6
s2 0 1 2 0 1 0 0 4

The SECOND table :


Basic w x1 x2 S1 s2 R1 R2 RHS
w 1 0 (5M+1)/3 -M 0 (-7M+4)/3 0 2M+4
x1, R2, s2
x1 0 1 1/3 0 0 1/3 0 1 are basic
variables.
R2 0 0 5/3 -1 0 -4/3 1 2
s2 0 0 5/3 0 1 -1/3 0 3

Solution infeasible as R2 +ve


61
The SECOND table :
Basic w x1 x2 S1 s2 R1 R2 RHS
w 1 0 (5M+1)/3 -M 0 (-7M+4)/3 0 2M+4
x1, R2, s2
x1 0 1 1/3 0 0 1/3 0 1 are basic
variables.
R2 0 0 5/3 -1 0 -4/3 1 2
s2 0 0 5/3 0 1 -1/3 0 3

The THIRD table :


Basic z x1 x2 S1 s2 R1 R2 RHS
z 1 0 0 1/5 0 (-5M+8)/5 1/5-M 18/5
x1, x2, s2
x1 0 1 0 1/5 0 3/5 -1/5 3/5 are basic
variables.
x2 0 0 1 -3/5 0 -4/5 3/5 6/5
s2 0 0 0 1 1 1 -1 1

Solution Feasible but Non-Optimal


62
The THIRD table :
Basic z x1 x2 S1 s2 R1 R2 RHS
z 1 0 0 1/5 0 (-5M+8)/5 1/5-M 18/5 x1, x2, s2
x1 0 1 0 1/5 0 3/5 -1/5 3/5
are basic
variables.
x2 0 0 1 -3/5 0 -4/5 3/5 6/5
s2 0 0 0 1 1 1 -1 1

The FOURTH table :


Basic z x1 x2 S1 s2 R1 R2 RHS
z 1 0 0 0 -1/5 -M+7/5 -M 17/5
x1, x2, S1
x1 0 1 0 0 -1/5 2/5 0 2/5 are basic
variables.
x2 0 0 0 0 3/5 -1/5 0 9/5
S1 0 0 1 1 1 1 -1 1

Solution Feasible and Optimal


63
Solving For the optimal solution of [Minimization] when there
are artificial variables

Summary

points Classification Reason


x1=0, x2=0 Not Feasible R1, R2 both Positive (3, 6)

x1=1, x2=0 Not Feasible R2 positive= 2


x1=3/8, x2=6/5 Feasible but not optimal Z row element is negative
x1=2/5, x2=9/5 Feasible and optimal Z row elements and x1,x2 ≥0

64
Simplex method when some or all the
constraints are NOT “≤” constraints
Two Phase Method

65
Preview
◼ When a basic feasible solution is not readily available, the
two-phase method may be used as an alternative to the
big M method.
◼ In the two-phase method, we add artificial variables to the
same constraints as we did in big M method.
◼ Then we find a bfs to the original LP by solving the Phase I
◼ In the Phase I , the objective function is to
minimize the sum of all artificial variables.

◼ At the completion of Phase I, we reintroduce the original


objective function in phase II and determine the optimal
solution to the original LP.
Solving For the optimal solution of [Minimization] when
there are artificial variables by two phase method
Minimize w= 4x1 + x2 Solution: Phase I
Subject to ◼ Change the objective function as Minimization
3x1+ x2 = 3 of the sum of artificial variables
4x1 + 3x2 ≥ 6 ◼ Whether it is a maximization or minimization
x1+ 2x2 ≤ 4 problem, phase I objective is always
x1, x2 ≥ 0 Minimization of the sum of artificial variables
◼ By adding the appropriate slack, surplus, and
artificial variables, we obtain the following
Minimize R = R1+R2 or
Minimize R = R1+R2+0x1+0x2+0S1+0s2
Subject to
3x1+ x2 + R1 =3
4x1 + 3x2 – S1 + R2 =6
x1+ 2x2 +s2= 4
x1, x2, S1, s2, R1, R2 ≥ 0

67
Solving For the optimal solution of [Minimization] when
there are artificial variables by two phase method
Minimize R = R1+R2 or
Minimize R = R1+R2+0x1+0x2+0S1+0s2
So before jumping to First table
Subject to first replace R1 and R2 in OF
3x1+ x2 + R1 = 3 [1] By substituting
4x1 + 3x2 – S1 + R2 = 6 [2] the value of R1 and R2
x1+ 2x2 +s2= 4 [3] From the corresponding
x1, x2, S1, s2, R1, R2 ≥ 0 constraints

From eq. 1: R1= 3 - 3x1 – x2


From eq. 2: R2= 6-4x1-3x2+S1 & Substitute the value of R1 and R2 in Objective
function
Minimize R = -7x1 - 4x2 + S1 + 0s2+9
R +7x1 + 4x2 - S1 - 0s2 = 9
Subject to
3x1+ x2 + R1 = 3 [1]
4x1 + 3x2 – S1 + R2 = 6 [2]
x1+ 2x2 +s2= 4 [3]
x1, x2, S1, s2, R1, R2 ≥ 0
68
Minimize R = -7x1 - 4x2 + S1 + 0s2+9
Solving For the optimal solution of R +7x1 + 4x2 - S1 - 0s2 = 9
[Minimization] when there are
Subject to
artificial variables
3x1+ x2 + R1 = 3 [1]
4x1 + 3x2 – S1 + R2 = 6 [2]
x1+ 2x2 +s2= 4 [3]
x1, x2, S1, s2, R1, R2 ≥ 0

Basic R x1 x2 S1 s2 R1 R2 RHS
R 1 7 4 -1 0 0 0 9
R1, s2, R2
R1 0 3 1 0 0 1 0 3 are basic
variables.
R2 0 4 3 -1 0 0 1 6
s2 0 1 2 0 1 0 0 4

Solution infeasible as R1 and R2 +ve


69
The initial table :
Basic R x1 x2 S1 s2 R1 R2 RHS
R 1 7 4 -1 0 0 0 9
R1, s2, R2
R1 0 3 1 0 0 1 0 3 are basic
variables.
R2 0 4 3 -1 0 0 1 6
s2 0 1 2 0 1 0 0 4

The SECOND table :


Basic R x1 x2 S1 s2 R1 R2 RHS
R 1 0 5/3 -1 0 -7/3 0 2
x1, R2, s2
x1 0 1 1/3 0 0 1/3 0 1 are basic
variables.
R2 0 0 5/3 -1 0 -4/3 1 2
s2 0 0 5/3 0 1 -1/3 0 3

Solution infeasible as R2 +ve


70
The SECOND table :
Basic R x1 x2 S1 s2 R1 R2 RHS
R 1 0 5/3 -1 0 -7/3 0 2
x1, R2, s2
x1 0 1 1/3 0 0 1/3 0 1 are basic
variables.
R2 0 0 5/3 -1 0 -4/3 1 2
s2 0 0 5/3 0 1 -1/3 0 3

The THIRD table :


Basic R x1 x2 S1 s2 R1 R2 RHS
R 1 0 0 0 0 -1 -1 0
x1, x2, s2
x1 0 1 0 1/5 0 3/5 -1/5 3/5 are basic
variables.
x2 0 0 1 -3/5 0 -4/5 3/5 6/5
s2 0 0 0 1 1 1 -1 1

Phase I - Solution Feasible and Optimal


Phase I – Both R1 and R2 are not in basic and RHS is +Ve hence feasible
71
Solving For the optimal solution of [Minimization] when
there are artificial variables by two phase method
ORIGINAL PROBLEM Solution: Phase II
Minimize w= 4x1 + x2 ◼ Use the original objective function
Subject to ◼ Write the constraints from the optimal table of
3x1+ x2 = 3 Phase I by neglecting artificial variables
4x1 + 3x2 ≥ 6
◼ Solve as a regular simplex problem
x1+ 2x2 ≤ 4
x1, x2 ≥ 0 Optimal Table of Phase I
Basic z x1 x2 S1 s2 R1 R2 RHS
z 1 0 0 0 0 -1 -1 0
x1 0 1 0 1/5 0 3/5 -1/5 3/5
x2 0 0 1 -3/5 0 -4/5 3/5 6/5
Minimize w= 4x1 + x2 s2 0 0 0 1 1 1 -1 1

Subject to
x1+ 1/5 S1 = 3/5
x2 – 3/5 S1 = 6/5
S1 + s2 =1
72
x1, x2, S1, s2, ≥ 0
Solving For the optimal solution of [Minimization] when
there are artificial variables by two phase method
Minimize w= 4x1 + x2
So before jumping to First table
Subject to first replace x1 and x2 in OF
x1+ 1/5 S1 = 3/5 [1] By substituting
x2 – 3/5 S1 = 6/5 [2] the value of x1 and x2
S1 + s2 = 1 [3] From the corresponding constraints
x1, x2, S1, s2, ≥ 0
From eq. 1: x1= 3/5 – 1/5 S1
From eq. 2: x2= 6/5 +3/5 S1 & Substitute the value of x1 and x2 in Objective function

Minimize w = -1/5S1+18/5 + 0s2


w +1/5S1- 0s2= 18/5

Subject to
x1+ 1/5 S1 = 3/5
x2 – 3/5 S1 = 6/5
S1 + s2 =1
x1, x2, S1, s2, ≥ 0
73
Minimize w = -1/5S1+18/5 + 0s2
w +1/5S1- 0s2= 18/5
Solving For the optimal solution of
[Minimization] when there are Subject to
artificial variables by two phase x1+ 1/5 S1 = 3/5
method x2 – 3/5 S1 = 6/5
S1 + s2 =1
x1, x2, S1, s2, ≥ 0

Phase II First table :


Basic w x1 x2 S1 s2 RHS
w 1 0 0 1/5 0 18/5 x1, s2 x2 are
basic
x1 0 1 0 1/5 0 3/5 variables.

x2 0 0 1 -3/5 0 6/5
s2 0 0 0 1 1 1

Solution feasible but non-optimal as w row element (S1) is +ve (minimization)

74
Solving For the optimal solution of [Minimization] when there are artificial
variables by two phase method

Phase II First table :


Basic w x1 x2 S1 s2 RHS
w 1 0 0 1/5 0 18/5 x1, s2, x2 are
basic
x1 0 1 0 1/5 0 3/5 variables.

x2 0 0 1 -3/5 0 6/5
s2 0 0 0 1 1 1

Phase II Second table :


Basic w x1 x2 S1 s2 RHS
x1, S1, x2
w 1 0 0 0 -1/5 17/5 are basic
variables.
x1 0 1 0 0 -1/5 2/5
x2 0 0 1 0 3/5 9/5
S1 0 0 0 1 1 1

Solution feasible and Optimal


75
Simplex Algorithm – Special cases

76
Simplex Algorithm – Special cases

◼ There are four special cases arise in


the use of the simplex method.

1. Degeneracy
2. Alternative optima
3. Unbounded solution
4. Non-existing (infeasible) solution

77
Simplex Algorithm – Degeneracy

Degeneracy (no improvement in objective or goal value)

◼ It typically occurs in a simplex iteration when in the


minimum ratio test, more than one basic variable gets
equal value.
◼ The tie is broken arbitrarily.
◼ This is in itself not a problem, but making simplex
iterations from a degenerate solution may give rise to
cycling, meaning that after a certain number of iterations
without improvement in objective value the method may
turn back to the point where it started.
◼ One or more of the constraints are redundant.

78
Simplex Algorithm – Degeneracy
Example:
Maximize z = 3x1 + 9x2

Subject to
x1 + 4x2 ≤ 8
x1 + 2x2 ≤ 4
x1, x2 ≥ 0

79
Simplex Algorithm – Degeneracy
Maximize z = 3x1 + 9x2
Subject to
x1 + 4x2 ≤ 8
x1 + 2x2 ≤ 4
x1, x2 ≥ 0

The solution: Standard form


Maximize z = 3x1 + 9x2+0s1+0s2
z - 3x1 - 9x2- 0s1- 0s2 =0
Subject to
x1 + 4x2 + s1 = 8
x1 + 2x2 + s2 = 4
x1, x2, s1, s2 ≥ 0
80
Simplex Algorithm – Degeneracy
Maximize z = 3x1 + 9x2+0s1+0s2 Minimum ratio corresponding to basic
z - 3x1 - 9x2- 0s1- 0s2 =0 variable s1 and s2 is the same.
Subject to At this point, there is a hint
that degeneracy may exist.
x1 + 4x2 + s1 = 8 It may be temporary or permanent.
x1 + 2x2 + s2 = 4
We can select any one of them
as outgoing variable.
x1, x2, s1, s2 ≥ 0
We will notice that in the second table
the RHS value corresponding to not
Entering Variable selected basic variable will be 0

Basic z x1 x2 s1 s2 RHS Leaving Variable


z 1 -3 -9 0 0 0
s1 0 1 4 1 0 8 8/4=2
s2 0 1 2 0 1 4 4/2=2

81
Simplex Algorithm – Degeneracy
Entering Variable

Basic z x1 x2 s1 s2 RHS Leaving Variable


z 1 -3 -9 0 0 0
s1 0 1 4 1 0 8 8/4=2
s2 0 1 2 0 1 4 4/2=2

Second table Make a Note


Entering Variable

Basic z x1 x2 s1 s2 RHS
z 1 -3/4 0 9/4 0 18 Leaving Variable
x2 0 1/4 1 1/4 0 2 2/(1/4)=8
s2 0 1/2 0 -1/2 1 0 0/(1/2)=0

Now, if the basic variable corresponding to value ‘0’ in RHS leaves,


the solution is degenerate otherwise it is a temporary degeneracy.
Degeneracy means solution will not improve
82 in the next iteration
Simplex Algorithm – Degeneracy
Second table Make a Note
Entering Variable

Basic z x1 x2 s1 s2 RHS
z 1 -3/4 0 9/4 0 18 Leaving Variable
x2 0 1/4 1 1/4 0 2 2/(1/4)=8
s2 0 1/2 0 -1/2 1 0 0/(1/2)=0

Third table
Basic z x1 x2 s1 s2 RHS
z 1 0 0 3/2 3/2 18 Optimal and Feasible solution
x2 0 0 1 1/2 -1/2 2
x1 0 1 0 -1 2 0

Degeneracy means solution will not improve in the next iteration


Solution in second table: x2=2, s2=0, x1=0,s1=0 z= 18
Solution in third table: x2=2, x1=0, s1=0,s2=0
83 z= 18
Maximize z = 3x1 + 9x2
Simplex Algorithm – Degeneracy
Subject to (Graphical Representation)
x1 + 4x2 ≤ 8 [1]
x1 + 2x2 ≤ 4 [2] Solution in second table: x2=2, s2=0, x1=0,s1=0 z= 18
Solution in third table: x2=2, x1=0, s1=0,s2=0 z= 18
x1, x2 ≥ 0

x2 Both the constraints meet at point A


The Second table solution is corresponding to Equation 1 only
4
The third table solution is corresponding to
intersection point of Equation 1 and equation 2
3
Equation 1 is redundant
2
A
1
x1
1 2 3 4 5 6 7 8
84
Simplex Algorithm – Alternate Optima or Many Solutions

Alternative optima or Many Solutions

◼ If the z-row values for one or more non-basic


variables is 0 in the optimal table, alternate optimal
solution exists

85
Simplex Algorithm – Alternate Optima
Maximize z = 2x1 + 4x2
Subject to
x1 + 2x2 ≤ 5
x1 + x2 ≤ 4
x1, x2 ≥ 0

The solution: Standard form


Maximize z = 2x1 + 4x2+0s1+0s2
z - 2x1 - 4x2- 0s1- 0s2 =0
Subject to
x1 + 2x2 + s1 = 5
x1 + x2 + s2 = 4
x1, x2, s1, s2 ≥ 0
86
Simplex Algorithm – Alternate Optima
Maximize z = 2x1 + 4x2+0s1+0s2
z - 2x1 - 4x2- 0s1- 0s2 =0
Subject to
x1 + 2x2 + s1 = 5
x1 + x2 + s2 = 4
x1, x2, s1, s2 ≥ 0

Entering Variable

Basic z x1 x2 s1 s2 RHS Leaving Variable


z 1 -2 -4 0 0 0
s1 0 1 2 1 0 5 5/2=2.5
s2 0 1 1 0 1 4 4/1=4

87
Simplex Algorithm – Alternate Optima

Basic z x1 x2 s1 s2 RHS
z 1 -2 -4 0 0 0
s1 0 1 2 1 0 5 5/2=2.5
s2 0 1 1 0 1 4 4/1=4

Note that NBV in z row =0


Basic z x1 x2 s1 s2 RHS
1. Sol. Optimal and feasible
z 1 0 0 2 0 10 2. x2=5/2, s2=3/2 (BV), z=10
x2 0 1/2 1 1/2 0 5/2 3. x1=0, s1=0 (NBV)
s2 0 1/2 0 -1/2 1 3/2

Basic z x1 x2 s1 s2 RHS
1. Sol. Optimal and feasible
z 1 0 0 2 0 10 2. x2=1, x1=3 (BV), z=10
x2 0 0 1 1 -1 1 3. s1=0, s2=0 (NBV)
x1 0 1 0 -1 2 3
88
Simplex Algorithm – Unbounded Solutions
Unbounded Solutions

◼ For maximization problems


◼ It occurs when the value of non-basic variable in z row is –ve
(this means that non-basic variable has to enter the solution).
AND the values of constraints under this variable are
either –ve or 0 (this means no basic variable can leave the
solution)

◼ For minimization problems


◼ It occurs when the value of non-basic variable in z row is +ve
(this means that non-basic variable has to enter the solution).
AND the values of constraints under this variable are
either –ve or 0 (this means no basic variable can leave the
solution)

89
Simplex Algorithm – Unbounded Solutions
Maximize z = 2x1 + x2
Subject to
- x1 - x2 ≤ 10
-2x1 ≤ 40
x1, x2 ≥ 0

The solution: Standard form


Maximize z = 2x1 + x2+0s1+0s2
z - 2x1 - x2- 0s1- 0s2 =0
Subject to
-x1 - x2 + s1 = 10
-2x1 + s2 = 40
x1, x2, s1, s2 ≥ 0
90
Simplex Algorithm – Unbounded Solutions
Maximize z = 2x1 + x2+0s1+0s2
z - 2x1 - x2- 0s1- 0s2 =0
Subject to
-x1 - x2 + s1 = 10
-2x1 + s2 = 40
x1 non-basic variable can
x1, x2, s1, s2 ≥ 0
enter the solution, but none
of the basic variable can
leave the solution. So, the
Entering Variable solution is unbounded.

Basic z x1 x2 s1 s2 RHS
No Leaving
z 1 -2 -1 0 0 0 Variable
s1 0 -1 -1 1 0 10 10/-1=NA
s2 0 -2 0 0 1 40 40/-2= NA

91
Simplex Algorithm – Infeasible

Infeasible solution

◼ This occurs when in the optimal and feasible table,


there exist Artificial variable as a basic variable.

◼ This situation can never occur if all the constraints


are of the type “≤” with nonnegative RHS

92
Simplex Algorithm – Infeasible

◼ Consider the following LP problem.

Max 3x1 + 2x2

s.t. 2x1 + x2 < 2


3x1 + 4x2 > 12

x1, x2 > 0

93
Example: Infeasible Problem
◼ There are no points that satisfy both constraints, so there
is no feasible region (and no feasible solution).

x2
Max 3x1 + 2x2 10
3x1 + 4x2 > 12
s.t. 2x1 + x2 < 2 8
3x1 + 4x2 > 12
6
x1, x2 > 0 2x1 + x2 < 2
4

x1
2 4 6 8 10
94
Simplex Algorithm – Infeasible
Max 3x1 + 2x2

s.t. 2x1 + x2 < 2


3x1 + 4x2 > 12

x1, x2 > 0

The solution: Standard form


Maximize z = 3x1 + 2x2+0s1+0S2-MR1
z -(3M- 3)x1-(4M- 2)x2- 0s1+ MS2 =-12M
Subject to
2x1 + x2 + s1 =2
3x1+4x2-S2 + R1 = 12
x1, x2, s1, S2, R1 ≥ 0
95
Simplex Algorithm – Infeasible
Maximize z = 3x1 + 2x2+0s1+0S2-MR1
z -(3M+3)x1-(4M+2)x2- 0s1+ MS2 =-12M
Subject to
2x1 + x2 + s1 =2
3x1+4x2-S2 + R1 = 12
x1, x2, s1, S2, R1 ≥ 0

Basic z x1 x2 s1 S2 R1 RHS
z 1 -3-3M -2-4M 0 M 0 -12M
s1 0 2 1 1 0 0 2
R1 0 3 4 0 -1 1 12

96
Simplex Algorithm – Infeasible

Basic z x1 x2 s1 S2 R1 RHS
z 1 -3-3M -2-4M 0 M 0 -12M
s1 0 2 1 1 0 0 2
R1 0 3 4 0 -1 1 12

Basic z x1 x2 s1 S2 R1 RHS
z 1 5M+1 0 4M+2 M 0 4-4M
X2 0 2 1 1 0 0 2
R1 0 -5 0 -4 -1 1 4

Solution is feasible and optimal. But R1 (artificial variable is


still the basic variable. Hence, the solution is infeasible.

97
Sensitivity Analysis

98
The Role of Sensitivity Analysis of the
Optimal Solution

◼ Is the optimal solution sensitive to changes in input


parameters?
◼ The change in input parameters within certain range
does not affect the optimum,
◼ The analysis, to observe the effect of change in input
parameters on optimum solution, is known as
sensitivity analysis.

99
The Role of Sensitivity Analysis of the
Optimal Solution

◼ Sensitivity of the optimum solution to changes in unit


profit or unit cost (coefficients of the objective function)

◼ Sensitivity of the optimum solution to changes in the


availability of the resources (right hand side of the
constraints)

100
Sensitivity Analysis of Change in Objective
Function Coefficients

◼ Range of Optimality
◼ The optimal solution will remain unchanged as long as
◼ An objective function coefficient lies within its range of
optimality
◼ There are no changes in any other input parameters.

101
The Role of Sensitivity Analysis of the
Optimal Solution

102
Observe that OF line passes
Through the point C (Red Line). x2
If we draw lines in such a way
That every line passes through
Point C ( blue and black dotted 9
Line) and point C also remains
Optimum. E
8
Machine 1
7

5
Objective function line
4
This is possible only, if the OF
Line is between BF and DE 3
And passes through C, which B
will Always give optimum 2 optimum 3.2, 1.6, z=128
solution c Machine 2
1

A D F x1
0 0 1 2 3 4 5 6 7 8
103
To determine the ranges for OF
coefficients
x2
z = c1x1+c2x2 [1]

If the OF line is pivoted at C


9
The solution remains optimal
So long as OF equation E
8
lies between constraint 1 and Machine 1
constraint 2
7

5
Objective function line
4

3
B
The ratio c1/c2 should vary 2 optimum 3.2, 1.6, z=128
Between 1/3 (slope of M/C 2) c Machine 2
and 2/1 (slope of M/C 1 eq) 1

1 c1 2 A D F
  0 0 1 2 3 4 5 6 7 8
x1

3 c2 1 104
The ratio c1/c2 should vary
Between 1/3 (slope of M/C 2)
and 2/1 (slope of M/C 1 eq)
1 c1 2
 
3 c2 1

Q1: if c2 remains fixed i.e. 20 units, what is the range of c1 without affecting the
optimal solution?

A1:
1 c1 2 20
   c1  40
3 20 1 3
So long as c1 is between 6.67 and 40, the optimum solution remains unaffected.

Q2: if c1 remains fixed i.e. 30 units, what is the range of c2 without affecting the
optimal solution?

A2:
1 30 2
  90  c2  15
3 c2 1
So long as c2 is between 90 and 15, the optimum solution remains unaffected.

105
Sensitivity Analysis of Change in Resource
Availability

106
If the daily capacity of M1 is
Changed from 8 to 9 hrs.
x2
what will be the change
in the OF?

9
The new optimum point moves
to point G and OF 142.
8 E
Machine 1: 2x1+x2 <=8
7
Machine 1: 2x1+x2 <=9

4 Optimum (C) 3.2, 1.6, z=128


Optimum (G) 3.8, 1.4, z=142
3
B
2
G
c Machine 2
1

A D F x1
0
0 1 2 3 4 5 6 7 8
If the daily capacity of M1 is
Changed from 8 to 9 hrs.
what will be the change
in the OF?

The new optimum point moves


to point G and OF 142.

 Rate of revenue change 


  zG − zC 142 − 128
 resulting from increase in  = = = $14 / hr
 capacityof machine1, by 1 hour  capacitychange 9−8
 

The rate of change of OF per unit change of resource is called

“unit worth of a resource”, it is also known as

“dual price” or

“Shadow price”
The dual price $14/hr remains
Valid for changes in M1 capacity x2
so long as M1 constraints
is parallel to itself and cuts the
Line segment at any point 9
Between point B and F
8
Q1: what should be the capacity E
Machine 1: 2x1+x2 <=8
Of M1, if the constraint M1 7
Passes through point B (0,2.67) Machine 1: 2x1+x2 <=9
6
2x0+1x2.67 = 2.67 hrs
5
Q2: what should be the capacity
Of M1, if the constraint M1
4
Passes through point F (8,0) Optimum (C) 3.2, 1.6, z=128
Optimum (G) 3.8, 1.4, z=142
2x8+1x0=16 hrs 3

B
Conclusion is that 2
The dual price $14/hr remains G
Valid in the range 1
c Machine 2

2.67 ≤ M1 capacity ≤ 16 0 A D F x1
0 1 2 3 4 5 6 7 8
If the daily capacity of M2 is x2
Changed from 8 to 9 hrs.
what will be the change
in the OF?
9
The new optimum point moves
to point G and OF 130. 8
E
7
Machine 1

Machine 2: x1+3x2 <=9


5

4
Optimum (C) 3.2, 1.6, z=128
3
Optimum (G) 3, 2, z=130

B
2 G Machine 2: x1+3x2 <=8

c
1

A D F x1
0
0 1 2 3 4 5 6 7 8 9
If the daily capacity of M2 is
Changed from 8 to 9 hrs.
what will be the change
in the OF?

The new optimum point moves


to point G and OF 130.

 Rate of revenue change 


  zG − zC 130 − 128
 resulting from increasein  = = = $2 / hr
 capacityof machine1, by 1hour  capacitychange 9−8
 

The rate of change of OF per unit change of resource is called

“unit worth of a resource”, it is also known as

“dual price” or

“Shadow price”
x2
The dual price $2/hr remains
Valid for changes in M2 capacity
so long as M2 constraints
is parallel to itself and cuts the
9
Line segment at any point
Between point D and E
8
E
Q1: what should be the capacity
7
Of M2, if the constraint M2 Machine 1
Passes through point E (0,8)
6

0+3x8 = 24 hrs Machine 2: x1+3x2 <=9


5
Q2: what should be the capacity
Of M2, if the constraint M2 4
Optimum (C) 3.2, 1.6, z=128
Passes through point D (4,0)
3
Optimum (G) 3, 2, z=130
1x4+1x0=4 hrs
B
2 Machine 2: x1+3x2 <=8
Conclusion is that
The dual price $2/hr remains c
Valid in the range 1

A D F x1
4 ≤ M2 capacity ≤ 24 0
0 1 2 3 4 5 6 7 8 9
Conclusion is that Conclusion is that
The dual price $14/hr remains The dual price $2/hr remains
Valid in the range Valid in the range

2.67 ≤ M1 capacity ≤ 16 4 ≤ M2 capacity ≤ 24

Q1. IF WE WISH TO INCREASE THE CAPACITY WHICH MACHINE RECEIVE PRIORITY?


A1. MACHINE 1 AS DUAL PRICE IS HIGHER, IT CONTRIBUTES MORE IN OF.

Q2. IF the capacity of machine 1 is increased to 12 hrs, what will the total increase in OF
A2. $14 x (12-8) = $56, and the total OF = 128+56 =184
Q3. suppose the capacity of machine 1 is increased to 20
A3. As the upper limit for M1 = 16, we can not make any conclusion. Need for more calculations

Q4. IF the capacity of M1, and M2 are increased at additional cost of $10,
is it advisable to increase the capacities?

A2. Only M1 as the dual price is higher than cost. Not advisable for machine 2
114

You might also like