0% found this document useful (0 votes)
24 views40 pages

OR-Chapter 3

Chapter Three discusses the Simplex Algorithm, an efficient method for solving linear programming problems with more than two variables, developed by George B. Dantzig in 1947. It outlines the steps to convert a linear programming model into standard form, obtain a basic feasible solution, and iterate to find the optimal solution using a simplex tableau. The chapter also introduces the Big M-method for handling mixed constraints in linear programming.

Uploaded by

astatessema
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views40 pages

OR-Chapter 3

Chapter Three discusses the Simplex Algorithm, an efficient method for solving linear programming problems with more than two variables, developed by George B. Dantzig in 1947. It outlines the steps to convert a linear programming model into standard form, obtain a basic feasible solution, and iterate to find the optimal solution using a simplex tableau. The chapter also introduces the Big M-method for handling mixed constraints in linear programming.

Uploaded by

astatessema
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

CHAPTER THREE

THE SIMPLEX ALGORITHM

Mulugeta K. (PhD)
Department of Management
3.1. The Simplex Method

• The graphical approach for solving LPPs is restricted to


problems with only two decision variables.
– When the number of variables to deal with increase
another method is required to be used.
• An efficient method for solving LPPs with more than two
variables is called the simplex method, or iterative or step by
step method.
• It was developed by George B. Datzing in 1947.
• It is an algebraic procedure which starts with a feasible
solution that is not optimal and systematically moves from
one feasible solution to another until an optimal solution is
found.
Standard form of an LP Model

• Before the simplex algorithm can be used, the LP must be


converted into a problem where all the constraints are
equations and all variables are nonnegative.
• An LP in this form is said to be in standard form.
• To convert the inequality constraint into equality, we
introduce slack or surplus variables.
• In economic terminology, slack variables represent unused
capacity and surplus variables represent excess amount.
• The contribution (cost or profit) associated with the slack
and surplus variables is zero.
Cont…

• To convert a ≤ constraint to an equality, define for each


constraint a slack variable [si] (si = the slack variable for
the ith constraint).
– A slack variable is the amount of the resource unused
in the ith constraint.
• To convert a ≥ constraint to an equality constraint, define
a surplus variable [ei] (ei = the excess variable for the ith
≥ constraint.
• Since, slack and surplus variables are insignificant with
no contribution, they are represented with coefficient of
zero in the objective function.
Cont…

Example: Constraints with ≤ sign


• Non Standard form Standard form
X1+2X2 ≤ 6 X1+2X2+S1= 6
• where X1 and X2 are decision variables and S1 is a slack
variable, added to the smaller side of the inequality.
Example: Constraints with ≥ sign
• Non Standard form Standard form
X1+2X2 ≥ 6 X1+2X2-e1= 6
• where X1 and X2 are decision variables and e1 is a surplus
variable, added to the smaller side of the inequality.
Cont…

• To find a unique solution, the number of variables should


not exceed the number of equations.
• When the number of variables is more than the number of
equations, the number of solutions is unlimited.
• So as to get a unique solution, we have to set at least (n-
m) variables to zero, where:
n = the number of variables and
m = the number of equalities.
• Those variables that are set to zero are called non basic
variables indicating they are not in the solution.
• The variables that are in solution are called basic variable.
Cont…

• For a set of m simultaneous equations in n variables (


n>m), a solution obtained by setting ( n-m) variables
equal to zero and solving for remaining m equations
in m variables is called a basic solution
• Any basic solution in which all variables are
nonnegative is called a basic feasible solution
(or BFS).
General Steps in the Simplex Algorithm

• Step 1: Convert the LP to standard form


• Step 2: Obtain a Basic Feasible Solution [BFs] (if possible)
from the standard form
• Step 3: Determine whether the current BFS is optimal
• Step 4: If the current BFS is not optimal, determine which
non-basic variable should become a basic variable and
which basic variable should become a non-basic variable
to find a BFS with a better objective function value.
• Step 5 Use Elementary Row Operations (EROs) to find a
new BFS with a better objective function value.
– Go back to Step 3.
Example: Maximization Problem

• A microcomputer manufacturing firm is about to start


production of two new microcomputers, Model-I and
Model-II. Each requires limited resources of assembly time,
inspection time, and storage space. Currently, 100 hours of
assembly time, 22 hours of inspection time and 39 cubic feet
of storage space are available. A unit of Model-I and Model-
II microcomputers contribute $60 and $50 to the profit of the
firm respectively. The amount of each resource needed to
make each type of microcomputer is given in the following
table. The manager wants to determine how much of each
computer to produce in order to maximize the profit
generated by selling them.
Cont…

• Table 3.1: The amount of each resource needed to


make each type of microcomputer

Resources Model-I MC Model-II MC


Assembly time/unit 4 hrs 10 hrs

Inspection time/unit 2 hrs 1 hr

Storage space/unit 3 cubic feet 3 cubic feet


Solution:

Let:
o x1 = number of Model-I microcomputers manufactured
o x2 = number of Model-II microcomputers manufactured
• The LP is
Max z = 60x1 + 50x2
s.t. 4x1 + 10x2 ≤ 100 (Assembly time constraint)
2x1 + x2 ≤ 22 (Inspection time constraint)
3x1 + 3x2 ≤ 39 (Storage space constraint)
x1, x2 ≥ 0
Solving the Problem using the Simplex method (Step by step)

 Step 1: Convert the model in to a standard form: It can be by


introducing slack variables to the constraints and adding the
slack variables to the objective function with zero coefficients
• Standard Form of the LP:
Max Z = 60X1+50X2+0S1+0S2+0S3
Subject to 4X1+10X2+S1 = 100
2X1+ X2+S2 = 22
3X1+ 3X2+S3 = 39
X1, X2, S1, S2, S3 ≥ 0
Cont…

 Step 2: Design the initial feasible solution: An initial basic


feasible solution is obtained by setting the decision variables
to zero.
• In our example (at the origin):
X1 = 0
X2 = 0
• Thus, we get:
S1 = 100
S2 = 22
S3 = 39
Cont…

 Step 3: Set up the initial simplex tableau: it can be developed


as follows. (Table 1)

Basic Cj 60 50 0 0 0 RHS RR
Variables X1 X2 S1 S2 S3
S1 0 4 10 1 0 0 100 100/4= 25

S2 0 2 1 0 1 0 22 22/2 = 11

S3 0 3 3 0 0 1 39 39/3 = 13

Zj 0 0 0 0 0 0
Cj-Zj 60 50 0 0 0

Leaving Variable Entering Variable Pivot Element


Cont…

 Interpretation of the data in the above tableau:


– In the first row labeled "Cj” are stated the coefficients of the
variables in the objective function.
• These values will remain the same in subsequent
tableaus.
– To find an entry in the Zj row under a column, we multiply
the entries of that column by the corresponding entries of
‘CB’ column and add the results, i.e., Zj= ∑CBiXj.
– The Zj row entries will all be equal to zero in the initial
simplex tableau.
– The Zj entry under the “Quantity Column" gives the current
value of the objective function.
Cont…

– The last row labeled "Cj-Zj“ is called the index row or net
evaluation row.
– It is used to determine whether or not the current solution
is optimal or not.
– The calculation of Cj-Zj row simply involves subtracting each Zj
value from the corresponding Cj value for that column.
– The entries in the Cj - Zj, row represent the net contribution
to the objective function that results by introducing one unit
of each of the respective column variables.
– A plus value indicates that a greater contribution can be
made by bringing the variable for that column into the
solution. [Negative values indicate a decrease in contribution]
Cont…

– Index row elements are also known as the shadow prices.


 Step 4: Test if the current solution is optimum or not:
– If all the elements or entries in the Cj- Zj row are negative or
zero, then the current solution is optimum.
– If there exists some positive number, the current solution can
be further improved by removing one basic variable from the
basis and replacing it by some non-basic one.
 Step 5: Identify the Entering and Leaving Variables
 The variable with the largest positive value in the Cj - Zj row is
the entering variable.
Cont…

• The column associated with the entering variable is called


Key/pivot Column.
• We need to compute the replacement ratio to identify the
leaving variable:
Replacement Ratio (RR) = Solution Quantity (Q)
Corresponding values in pivot column

• The row with the minimum ratio is the key/pivot row.


• The corresponding variable in the key row (the departing
variable) will leave the basis.
• The number that lies at the intersection of the key column and
key row is called a pivot element.
Cont…

 Step 7. Evaluate the new solution by constructing a second


simplex tableau.
 Use Elementary Row Operations (EROs) to find a new BFS
with a better objective function value.
 Step 8. Do the Iteration and Complete it.
 If any of the numbers in Cj - Zj row are positive, repeat
the steps (6-7) again until an optimum solution is
obtained.
 Step 9. Interpret the result
Cont…

 Simplex Tableau 2
• ERO: 1/2R2→R2 -4R2+R1→R1 -3R2+R3→R3

Basic Cj 60 50 0 0 0 RHS RR
Variables X1 X2 S1 S2 S3
56/8= 7
S1 0 0 8 1 -2 0 56
11/1/2 =22
X1 60 1 1/2 0 1/2 0 11
6/3/2 =4
S3 0 0 3/2 0 -3/2 1 6
Zj 60 30 0 30 0 660
Cj-Zj 0 20 0 -30 0
Cont…

 Simplex Tableau 3
• ERO: 2/3R3→R3 -1/2R3+R2→R2 -8R3+R1→R1
Basic Cj 60 50 0 0 0 RHS
Variables X1 X2 S1 S2 S3
S1 0 0 0 1 6 -16/3 24
X1 60 1 0 0 1 -1/3 9
X2 50 0 1 0 -1 2/3 4
Zj 60 50 0 10 40/3 740
Cj-Zj 0 0 0 -10 -40/3
All elements in the Cj-Zj row are ≥0. So, the optimal solution is found.
Cont…

• All the values in the Cj-Zj row are zero and negative
indicating that there can no be additional improvement.
• This makes the third tableau to contain the optimal
solution with the following basic variables:
S1 = 24,
X1 = 9, and
X2 = 4, producing a maximum profit of $740.
 Interpretation: In order to achieve the maximum profit of
$740, the company should produce 9 units of Model-I and 4
units of Model-II micro computers leaving 24 hours of
unused resource of the assembly time constraint.
Exercise

A farmer owns a 100 acre farm and plans to plant at


most three crops. The seed for crops A,B, and C costs
$40, $20, and $30 per acre, respectively. A maximum of
$3200 can be spent on seed. Crops A,B, and C require
1,2, and 1 workdays per acre, respectively, and there are
maximum of 160 workdays available. If the farmer can
make a profit of $100 per acre on crop A, $300 per acre
on crop B, and $200 per acre on crop C, how many acres
of each crop should be planted to maximize profit?
The Big M-method /Charnes Penalty Method/

1. Simplex Maximization with Mixed Constraints


• If a model constraint has negative constants on the RHS,
multiply both sides by -1 to obtain a constraint with a
non-negative constant.
• If the constraint is an inequality, this will reverse the
direction of the inequality.
– Introduce a slack variable (S) in each ≤ constraint.
– Introduce a surplus variable (e) and an artificial
variable (A) in each ≥ constraint.
– Introduce an artificial variable (A) in each = constraint.
Cont…

• For each artificial variable Ai, add -MAi to the objective


function in case of maximization and +MAi in case of
minimization.
• Use the same constant M for all artificial variables.
• The artificial variables are introduced for the limited
purpose of obtaining an initial solution.
• They do not have physical representation relating to the
decision problem.
• So, they must be driven out of the system and must not
remain in the final solution (and if at all they do, it
represents a situation of infeasibility).
Cont…

• This can be ensured by assigning an extremely high cost to


them.
• Generally, a value M is assigned to each artificial variable,
where M represents a number higher than any finite number.
• For this reason, the method of solving the problems where
artificial variables are involved is termed as the 'Big M
Method'.
• Artificial Variables will have the following coefficients in the
objective function.
– -M if the problem is maximization and
– +M if the problem is minimization.
Example:

• Solve the following LP model with mixed constraints


using the Big-M Method.
Max Z = 6X1+8X2
S.t: X2 ≤ 4
X1+X2 = 9
6X1+2X2 ≥ 24
X1, X2 ≥ 0
Cont…

Standard form:
Maximize Z = 6x1 + 8x2 + 0S1 + 0e3 - MA2 - MA3
s.t: x 2 + S1 = 4
x1 + x2 + A2 = 9
6x1 + 2x2 -e3+ A3 = 24
x1, x2, S1, e3, A2, A3≥ 0
At the Origin:
x1=x2 =e3=0, where as:
S1=4 A2= 9 A3= 24
Solution

• Initial and Second Simplex Tableaus


Cj 6 8 0 0 -M -M Quantity RR
B.V X1 X2 S1 e3 A2 A3
S1 0 0 1 1 0 0 0 4 --
A2 -M 1 1 0 0 1 0 9 9
A3 -M 6 2 0 -1 0 1 24
4
Zj -7M -3M 0 +M -M -M -33M
Cj-Zj 6+7M 8+3M 0 -M 0 0

B.V Cj 6 8 0 0 -M Quantity RR
X1 X2 S1 e3 A2
S1 0 0 1 1 0 0 4 4
A2 -M 0 2/3 0 1/6 1 5 7.5
X1 6 1 1/3 0 -1/6 0 4
12
Zj 6 2-2/3M 0 -1-M/6 -M 24-5M
Cj-Zj 0 6+2/3M 0 1+M/6 0
Cont…

• Third and Fourth Simplex Tableaus


Cj 6 8 0 0 -M RHS
B.V RR
X1 X2 S1 S3 A2
X2 8 0 1 1 0 0 4 --
A2 -M 0 0 -2/3 1/6 1 7/3 14
X1 6 1 0 -1/3 -1/6 0 8/3 --
Zj 6 8 6+2/3M -1-M/6 -M 48-7/3
Cj-Zj 0 0 -6-2/3M 1+M/6 0
Cj 6 8 0 0 RHS Solution
B.V
X1 X2 S1 e3 X1 = 5
X2 8 0 1 1 0 4 X2 = 4
e3 0 0 0 -4 1 14 e3 =14
X1 6 1 0 -1 0 5 Max Z= 62
Zj 6 8 2 0 62
Cj-Zj 0 0 -2 0
2. Simplex Minimization: The Big M Method

• Introduce a surplus variable (e) and an artificial variable (A)


in each ≥ constraint.
• A very large positive price (called penalty) is assigned to
each artificial variable in the Min. objective function.
• Coefficient of e (surplus) takes zero values in the objective
function Z.
• The incoming variable corresponds to the highest negative
value of Cj-Zj.
• The solution is optimal when there is no negative value of
Cj-Zj.
• Big M is used to remove artificial variables from the solution.
Cont…

Example: Solve the following LP model using the Big-M


(Charnes Penalty) Method.

Minimize ɵ = 16x1 + 9x2 + 21x3


s.t. x1 + x2 + 3x3 ≥ 12
2x1 + x2 + x3 ≥ 16
x1, x2, x3 ≥ 0
Cont…

Standard form:
Minimize ɵ = 16x1 + 9x2 + 21x3 + 0e1 + 0e2 + MA1 + MA2
s.t: x1 + x2 + 3x3 – e1 + A1 = 12
2x1 + x2 + x3 – e2 + A2 = 16
x1, x2, x3, e1, e2, A1, A2≥ 0
At the Origin:
x1=x2 =x3=e1=e2=0, where as:
A1=12
A2= 16
Solution

• Final Simplex tableau


Basic Cj 16 9 21 0 0 RHS
Variables X1 X2 X3 e1 e2
X2 9 0 1 5 -2 1 8
X1 16 1 0 -2 1 -1 4
Zj 16 9 13 -2 -7 136
Cj-Zj 0 0 8 2 7

• Optimal Solution: x1= 4, x2= 8, x3= 0; e1=0, e2=0


Minimum Cost = 136
Special Issues in the Simplex Method

1. Non-feasible Solution/ Infeasibility


– Whenever the optimality criteria is satisfied but still
there exist an artificial variable in the basis or solution
mix, this is the indication of infeasibility.
2. Unbounded Solution
– It is detected when trying to decide which variable to
leave [while computing replacement ratio for all
variables]
– If the entire ratios turn out to be negative or undefined,
it indicates that the problem is unbounded.
Cont…

– A negative ratio means that increasing that variable


would increase resources.
– A zero ratio means that increasing the variable would not
use any resources.
3. Degeneracy
– Tie for leaving basic variable (key row)
– If there is a tie for the smallest ratio, this is a signal that
degeneracy exists.
– Such problems can be overcome by trial and error
method.
Cont…

• Degeneracy could lead to a situation known as cycling,


– in which the algorithm puts a new variable in, then takes
it out in the next tableau, puts it back in, and so on.
• Adopt the following rules to minimize the number of
iterations:
a) Divide the coefficient of slack variables in the simplex
table where degeneracy occurs by the corresponding
positive numbers of the key column in the row, starting
from left to right.
b) The row which contains smallest ratio comparing from
left to right column wise becomes the key row.
Cont…

4. Tie for entering variables


• Selection can be made arbitrarily. However, the following
rules help to minimize iterations.
a) If there is a tie between two decision variables, then the
selection can be made arbitrary.
b) If there is a tie between a decision variable and a slack
(or surplus) variable, then select the decision variable.
c) If there is a tie between slack or surplus variable, then
selection can be made arbitrary.
Cont…

5. Multiple Optimum Solutions


– A situation when there can be infinite number of
solutions possible for a given problem.
– This can be recognized when one of the non-basic
variables in the Cj-Zj, row have a value of zero.
– To obtain the other solution, we will make a non-
basic variable with a zero Cj-Zj value to enter in to
the basis and solve.
40

You might also like