You are on page 1of 58

Chapter 3:

The Simplex Method and Sensitivity


Analysis
Operations Research: An Introduction, 10th Ed.

By Taha, H.A.

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Methodology
 The simplex method is based on
• Finding a corner point feasible (CPF) solution (extreme point)

• Evaluating the Z function at that point

• Trying to reach from that initial extreme point another CPF


solution (if any) that improves the z-value

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


An Example
Maximize Z  3 x1  5 x 2

subject to x1 £ 4
2 x 2 £ 12
3 x 1  2 x 2 £ 18
x1  0 Adjacent CPF solutions
x2 x2  0
for each CPF
3x1+x2 = 18
8 Adjacent CPF
x1=4 CPF solution
solutions
6 (0,0) (0,6), (4,0)
2x2 =12

4 (0,6) (2,6), (0,0)


Feasible Z=3x1+5x2
region
(2,6) (4,3), (0,6)
2
(4,3) (4,0), (2,6)
(4,0) (0,0), (4,3)
0 2 4 6 8 x1
ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM
Steps Leading to the Simplex Method

Put In
Formulate
problem as LP Standard
Form

Execute Put In
Simplex Tableau
Method Form
ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM
Standard Form
 Given the formulation of a Linear Program (LP), we need to
have the following:
• All variables to be non-negative

• All constraints to be written in terms of equations (except ≥ 0)

• The RHS of all equations should be non-negative

6 + 4 ≤ 24

How do we transform ≥ or ≤ into =?

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Standard Form
 If a constraint is expressed using ≤, we convert it into an
equality constraint by adding a new variable called a slack
variable
• e.g., 6 +4 ≤ 24 into 6 +4 + = 24

 If a constraint is expressed using ≥, we convert it into an


equality constraint by subtracting a new variable called a
surplus variable
• e.g., 2 + +3 ≥ 60 into 2 + +3 − = 60

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Standard Form
 If a variable is unrestricted, we can convert that variable
into two nonnegative variables by considering two new
(complementary) variables and
• e.g., if is unrestricted
6 + 4 £ 24 into 6 + 4( − ) + 1 = 24

where , ≥ 0

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Standard Form
 An LP is in standard form when:
• All variables are non-negative

• All constraints are equalities

• The RHS of all equations are non-negative

 Putting an LP formulation into standard form involves:


• Adding slack variables to “≤“ constraints

• Subtracting surplus variables from “≥” constraints

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Standard Form: Example
• Initial formulation: • Standard form:
min =2 1 −3 2 −4 3 min =2 1 −3 2 −4 3

subject to subject to

1 + 2 + 3 ≤ 30 1 + 2 + 3 + 1 = 30

2 1 + 2 +3 3 ≥ 60 2 1 + 2 +3 3 − 2 = 60

1 − 2 +2 3 = 20 1 − 2 +2 3 = 20

1, 2, 3 ≥0 1, 2, 3, 1, 2 ≥0

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Tableau Form
 A set of equations is in tableau form if for each equation:
• Its right hand side (RHS) is non-negative, and
• There is a basic variable
 A basic variable for an equation is a variable whose coefficient in the
equation is +1 and whose coefficient in all other equations of the
problem is 0

 To generate an initial tableau form:


• An artificial variable must be added to each constraint that does
not have a basic variable

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Tableau Form: Example
 Example 3.1-1 (The Reddy Mikks Company):

LP Formulation: Standard Form:


Maximize = 5 +4 Maximize = 5 +4
subject to subject to
6 +4 ≤ 24 6 +4 + = 24
+2 ≤ 6 +2 + = 6
− + ≤ 1 − + + = 1
≤ 2 + = 2
, ≥ 0 , , , , , ≥ 0

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Tableau Form: Example
 Example 3.1-1 (The Reddy Mikks Company):

Simple Tableau (starting): Non-basic


Optimality??
Variables
Basic Var.s RHS (Sol.)
1 -5 -4 0 0 0 0 0
0 6 4 1 0 0 0 24
0 1 2 0 1 0 0 6
0 -1 1 0 0 1 0 1
0 0 1 0 0 0 1 2

Basic
Feasibility??
Variables
ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM
Simplex basic solution
 A basic solution has the following properties:
• Each variable is either a non-basic variable or a basic variable
• The number of basic variables equals the number of functional
constraints
• The non-basic variables are set equal to zero
• The values of the basic variables are obtained as the
simultaneous solution of the system of equations
• If the basic variables satisfy the non-negativity constraints, the
basic solution is a BF solution

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Simplex Algorithm: Example
 Example 3.1-1 (The Reddy Mikks Company): Is this solution
optimal??

Enter

Basic Var.s RHS (Sol.)


1 -5 -4 0 0 0 0 0 Ratio
Leave 0 6 4 1 0 0 0 24 24/6=4 min
0 1 2 0 1 0 0 6 6/1=6
0 -1 1 0 0 1 0 1 1/-1=-1
Ignore
0 0 1 0 0 0 1 2 2/0= ∞

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Simplex Algorithm: Example
 Example 3.1-1 (The Reddy Mikks Company):

Basic Var.s RHS (Sol.)


1 -5 -4 0 0 0 0 0
0 6 4 1 0 0 0 24 Pivot row
0 1 2 0 1 0 0 6
0 -1 1 0 0 1 0 1
0 0 1 0 0 0 1 2
Pivot col.

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Simplex Algorithm: Example
 Example 3.1-1 (The Reddy Mikks Company):

Basic Var.s RHS (Sol.)


1 -5 -4 0 0 0 0 0
0 1 2/3 1/6 0 0 0 4 Pivot row
0 1 2 0 1 0 0 6
0 -1 1 0 0 1 0 1
0 0 1 0 0 0 1 2
Pivot col.

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Simplex Algorithm: Example
 Example 3.1-1 (The Reddy Mikks Company):

Basic Var.s RHS (Sol.)


1 0 -2/3 5/6 0 0 0 20
0 1 2/3 1/6 0 0 0 4 Pivot row
0 1 2 0 1 0 0 6
0 -1 1 0 0 1 0 1
0 0 1 0 0 0 1 2
Pivot col.

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Simplex Algorithm: Example
 Example 3.1-1 (The Reddy Mikks Company):

Basic Var.s RHS (Sol.)


1 0 -2/3 5/6 0 0 0 20
0 1 2/3 1/6 0 0 0 4 Pivot row
0 0 4/3 -1/6 1 0 0 2
0 -1 1 0 0 1 0 1
0 0 1 0 0 0 1 2
Pivot col.

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Simplex Algorithm: Example
 Example 3.1-1 (The Reddy Mikks Company):

Basic Var.s RHS (Sol.)


1 0 -2/3 5/6 0 0 0 20
0 1 2/3 1/6 0 0 0 4 Pivot row
0 0 4/3 -1/6 1 0 0 2
0 0 5/3 1/6 0 1 0 5
0 0 1 0 0 0 1 2
Pivot col.

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Simplex Algorithm: Example
 Example 3.1-1 (The Reddy Mikks Company): Is this solution
optimal??

Basic Var.s Enter RHS (Sol.)


1 0 -2/3 5/6 0 0 0 20 Ratio
0 1 2/3 1/6 0 0 0 4 4/(3/2)=6
Leave 0 0 4/3 -1/6 1 0 0 2 2/(4/3)=1.5 min
0 0 5/3 1/6 0 1 0 5 5/(5/3)=3
0 0 1 0 0 0 1 2 2/1=2

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Simplex Algorithm: Example
 Example 3.1-1 (The Reddy Mikks Company):

Basic Var.s RHS (Sol.)


1 0 -2/3 5/6 0 0 0 20
0 1 2/3 1/6 0 0 0 4
0 0 4/3 -1/6 1 0 0 2 Pivot row
0 0 5/3 1/6 0 1 0 5
0 0 1 0 0 0 1 2
Pivot col.

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Simplex Algorithm: Example
 Example 3.1-1 (The Reddy Mikks Company):

Basic Var.s RHS (Sol.)


1 0 -2/3 5/6 0 0 0 20
0 1 2/3 1/6 0 0 0 4
0 0 1 -1/8 3/4 0 0 3/2 Pivot row
0 0 5/3 1/6 0 1 0 5
0 0 1 0 0 0 1 2
Pivot col.

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Simplex Algorithm: Example
 Example 3.1-1 (The Reddy Mikks Company):

Basic Var.s RHS (Sol.)


1 0 0 3/4 1/2 0 0 21
0 1 2/3 1/6 0 0 0 4
0 0 1 -1/8 3/4 0 0 3/2 Pivot row
0 0 5/3 1/6 0 1 0 5
0 0 1 0 0 0 1 2
Pivot col.

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Simplex Algorithm: Example
 Example 3.1-1 (The Reddy Mikks Company):

Basic Var.s RHS (Sol.)


1 0 0 3/4 1/2 0 0 21
0 1 0 1/4 -1/2 0 0 3
0 0 1 -1/8 3/4 0 0 3/2 Pivot row
0 0 5/3 1/6 0 1 0 5
0 0 1 0 0 0 1 2
Pivot col.

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Simplex Algorithm: Example
 Example 3.1-1 (The Reddy Mikks Company):

Basic Var.s RHS (Sol.)


1 0 0 3/4 1/2 0 0 21
0 1 0 1/4 -1/2 0 0 3
0 0 1 -1/8 3/4 0 0 3/2 Pivot row
0 0 0 3/8 -5/4 1 0 5/2
0 0 1 0 0 0 1 2
Pivot col.

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Simplex Algorithm: Example
 Example 3.1-1 (The Reddy Mikks Company):

Basic Var.s RHS (Sol.)


1 0 0 3/4 1/2 0 0 21
0 1 0 1/4 -1/2 0 0 3
0 0 1 -1/8 3/4 0 0 3/2 Pivot row
0 0 0 3/8 -5/4 1 0 5/2
0 0 0 1/8 -3/4 0 1 1/2
Pivot col.

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Simplex Algorithm: Example
 Example 3.1-1 (The Reddy Mikks Company): Is this solution
optimal??

Basic Var.s RHS (Sol.)


1 0 0 3/4 1/2 0 0 21
0 1 0 1/4 -1/2 0 0 3
0 0 1 -1/8 3/4 0 0 3/2
0 0 0 3/8 -5/4 1 0 5/2
0 0 0 1/8 -3/4 0 1 1/2

Optimal solution: =3, = 1.5 , = 21

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Artificial Starting Solutions
 If all constraints from the LP formulation require slack
variables (i.e., ≤), then we know that the corresponding
basic solution can be used to start the simplex
 What (to do) if they are not all ≤ , for example = or ≥
 Try one of the two following methods to find a starting
solution to the simplex:
• The big M-method
• The two-phase method

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Big M-Method
 Introduce non-negative variable to the left-hand side of the
constraints of (≥ or =) type
• These variables are called artificial variables

 The purpose of introducing these variables is just to obtain


an initial basic feasible solution
 However, the addition of these artificial variables causes
violation of the corresponding constraints
 Therefore, we would like to get rid of these variables

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Big M-Method: Steps
 For = or ≥ constraints, we introduce an artificial variable Ri
 Assign a penalty coefficient M to each artificial variable
• We choose M as big as necessary to force the value of Ri at the
optimum to be 0

 We penalize the objective function by adding


• –MRi (for a maximization), or
• MRi (for a minimization)

 Solve the modified LP by simplex method

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Big M-Method: Example
 Example 3.4-1:
LP Formulation: Standard Form: Adding Artificial Variables:
Min = 4 + Min = 4 + Min = 4 + + +
subject to subject to subject to
3 + =3 3 + =3 3 + + =3
4 +3 ≥6 4 +3 − =6 4 +3 − + =6
+2 ≤4 +2 + =4 +2 + =4
, ≥ 0 , , , ≥ 0 , , , , , ≥ 0

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Big M-Method: Example
 Example 3.4-1:

Basic Var.s Sol.


-4 -1 0 -100 -100 0 0
3 1 0 1 0 0 3 Not equal?
4 3 -1 0 1 0 6
1 2 0 0 0 1 4

=4 + + + = 4 0 + 0 + 100 3 + 100 6 =

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Big M-Method: Example
 Example 3.4-1:

Basic Var.s Sol.


-4 -1 0 -100 -100 0 0
3 1 0 1 0 0 3
4 3 -1 0 1 0 6
1 2 0 0 0 1 4

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Big M-Method: Example
 Example 3.4-1:

Enter

Basic Var.s Sol. Ratio


696 399 -100 0 0 0 900
Leave 3 1 0 1 0 0 3 3/3=1 min
4 3 -1 0 1 0 6 6/4=1.5
1 2 0 0 0 1 4 4/1=4

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Two-Phase Method
 An alternative method to obtain an initial basic feasible
solution
 In the first phase, the simplex method is applied to special
constructed LP leading to a final simplex table that contains
a basic feasible solution (BFS) to the original problem
 In the second phase, we use the BFS determined by the first
phase to find an optimum BFS by applying the simplex
method

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Two-Phase Method: Steps
 PHASE I:
• Write the standard form including artificial variables
• Minimize the sum of the artificial variables (always)
 If the minimum value is > 0 the LP has no feasible solution
 Otherwise (r*=0, all Ri =0 and Ri nonbasic variables), move to phase-II

 PHASE II:
• Use the feasible solution obtained from phase I to start the
simplex

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Two-Phase Method: Example
 Example 3.4-2 (same problem as in Example 3.4-1):
Phase I:
Min = +
subject to
3 + + =3
4 +3 − + =6
+2 + =4
, , , , , ≥ 0

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Two-Phase Method: Example
 Example 3.4-2 (same problem as in Example 3.4-1):
Phase I:

Basic Var.s Sol.


0 0 0 -1 -1 0 0
3 1 0 1 0 0 3 Not equal?
4 3 -1 0 1 0 6
1 2 0 0 0 1 4

= + =3+6=

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Two-Phase Method: Example
 Example 3.4-2 (same problem as in Example 3.4-1):
Phase I:

Basic Var.s Sol.


0 0 0 -1 -1 0 0
3 1 0 1 0 0 3
4 3 -1 0 1 0 6
1 2 0 0 0 1 4

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Two-Phase Method: Example
 Example 3.4-2 (same problem as in Example 3.4-1):
Phase I:

Basic Var.s Sol. Ratio


7 4 -1 0 0 0 9
3 1 0 1 0 0 3 3/3=1
4 3 -1 0 1 0 6 6/4=1.5
1 2 0 0 0 1 4 4/1=4

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Two-Phase Method: Example
 Example 3.4-2 (same problem as in Example 3.4-1):
Phase I:
Enter

Basic Var.s Sol. Ratio


7 4 -1 0 0 0 9
Leave 3 1 0 1 0 0 3 3/3=1 min
4 3 -1 0 1 0 6 6/4=1.5
1 2 0 0 0 1 4 4/1=4

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Two-Phase Method: Example
 Example 3.4-2 (same problem as in Example 3.4-1):
Phase I: Optimal tableau

Basic Var.s Sol.


0 0 0 -1 -1 0 0
1 0 1/5 3/5 -1/5 0 3/5
0 1 -3/5 -4/5 3/5 0 6/5
0 0 1 1 -1 1 1

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Two-Phase Method: Example
 Example 3.4-2 (same problem as in Example 3.4-1):
Phase I: Optimal tableau
To be
To be replaced with deleted
original objective function
Basic Var.s Sol.
0 0 0 -1 -1 0 0
1 0 1/5 3/5 -1/5 0 3/5
0 1 -3/5 -4/5 3/5 0 6/5
0 0 1 1 -1 1 1

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Two-Phase Method: Example
 Example 3.4-2 (same problem as in Example 3.4-1):
Phase II:

Basic Var.s Sol.


-4 -1 0 0 0
1 0 1/5 0 3/5
Not equal?
0 1 -3/5 0 6/5
0 0 1 1 1

=4 + = 4 3/5 + 6/5 = /

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Two-Phase Method: Example
 Example 3.4-2 (same problem as in Example 3.4-1):
Phase II:

Basic Var.s Sol.


-4 -1 0 0 0
1 0 1/5 0 3/5
0 1 -3/5 0 6/5
0 0 1 1 1

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Two-Phase Method: Example
 Example 3.4-2 (same problem as in Example 3.4-1):
Phase II:

Enter
Basic Var.s Sol. Ratio
0 0 1/5 0 18/5
1 0 1/5 0 3/5 3
0 1 -3/5 0 6/5 -2
Leave 0 0 1 1 1 1 min

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Special Cases in The Simplex Method

 Degeneracy

 Alternative Optima

 Unbounded Solution

 Infeasible Solution

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Special Cases in The Simplex Method
 Degeneracy

How to Identify in Tableau:


Tie for Minimum Ratio, Next Iteration will have one basic variable with zero value
ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM
Special Cases in The Simplex Method
 Alternative Optima

How to Identify in Tableau:


Non-basic variable with zero coefficient in objective function row
ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM
Special Cases in The Simplex Method
 Unbounded solution

How to Identify in Tableau:


Constraint coefficients for a non-basic
variable are non-positive (≤ 0)
(M.R. cannot be computed)

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Special Cases in The Simplex Method
 Infeasible Solutions

How to Identify in Tableau:


RHS is negative OR Artificial variable positive in optimal solution
ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM
Graphical Sensitivity Analysis

 Sensitivity of the optimum solution to changes in

• The availability of the resources (i.e., right-hand side of the

constraints)

• Units profit or unit cost (i.e., coefficients of the objective

function)

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Graphical Sensitivity Analysis
 Example 3.6-1 (Changes in the Right-Hand Side):
Max = 30 + 20
subject to
2 + ≤ 8 (M1)
+3 ≤ 8 (M2)
, ≥0

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Graphical Sensitivity Analysis
 Example 3.6-1 (Changes in the Right-Hand Side):

• The unit worth of resource (or dual/shadow price) for M1, is

ℎ ∆
= =
ℎ ∆

• That is, changing the resource by 1 unit will affect the


objective function by the amount
• What is the range of capacity (i.e., feasibility range)?

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Graphical Sensitivity Analysis
 Example 3.6-1 (Changes in the Right-Hand Side):

• Feasibility range:
• As can be seen for the graph, the dual price of $14 remains valid
for changes (increase/decrease) in machine 1 capacity that move
its constraint parallel to itself to any point on the line segment
(from point B to point F)
 Minimum M1 capacity [at B=(0,2.67)] = 2(0) + 1(2.67) = 2.67 hr
 Minimum M1 capacity [at F=(8,0)] = 2(8) + 1(0) = 16 hr
 Hence,
2.67 hr ≤ M1 capacity ≤ 16 hr

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Graphical Sensitivity Analysis
 Example 3.6-2 (Changes in the Objective Coefficients):
Max = 30 + 20
subject to
2 + ≤8
+3 ≤8
, ≥0

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM


Graphical Sensitivity Analysis
 Example 3.6-2 (Changes in the Objective Coefficients):

• The form of a 2-LP objective function is


= +
• By increasing or deceasing the values of or , we change the
slope of the Z-line
• By keeping the set F. S. unchanged, and varying the values of
and , we may eventually change the value of the optimum
solution: moving ∗ from one corner to another corner point of
F. S.
• Is there any range of variation of the coefficient and that
will keep the optimal solution unchanged?
ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM
Graphical Sensitivity Analysis
 Example 3.6-2 (Changes in the Objective Coefficients):

• Optimality range:

• Finding a range of optimality for or for is equivalent to find


the values of / or / that will keep the initial optimal
solution unchanged

• For the range, we have to look at the following ratios,

≤ ≤ or 0.333 ≤ ≤2

ISE 303 - Term 201 Dr. Yasser Almoghathawi, KFUPM

You might also like