Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 87

Operations Research

Course Code: IPE 3103


Chapter 3
The Simplex Method and Sensitivity analysis
Instructor: Md. Rasel Sarkar, Asst. Professor
Dept. of IPE, RUET, Bangladesh
Academic Session: 2019-20
Algebraic solution of LP (Simplex method)

The simplex method imposes two requirements on


the LP model:
1. All the constraints are equations with nonnegative
right-hand side.
2. All the variables are nonnegative.
Conversion…

To convert a () inequality to an equation, a


nonnegative slack variable is added to the left-hand
side of the constraint.
[inequality] 6x1 + 4x2 24
[equation] 6x1 + 4x2 + s1 = 24, s1 0
Conversion from () to (=) is achieved by subtracting
a nonnegative surplus variable from the left-hand
side of the inequality.
[inequality] x1 + x2 800
[equation] x1 + x2 - S1 = 800, S1 0
An equation can be replaced by two weak
inequalities in opposite direction.

The right-hand side of equation to be nonnegative


can be satisfied simply by multiplying both sides of
the equation by -1, if necessary.
Transition from Graphical to Algebraic
Solution (Simplex method)
#
Objective function:
Maximize z = 2x1 + 3x2
The key solution concepts
• Solution Concept 1: the simplex method focuses on
CPF (corner point feasible) solutions.
• Solution concept 2: the simplex method is an
iterative algorithm (repeating a fixed series of steps,
called, an iteration) with the following structure:
Initialization: setup to start iterations,
including finding an initial CPF
solution

Optimality test: is the current CPF solution


optimal?

if no if yes stop

Iteration: Perform an iteration to find a


better CFP solution
• Solution concept 3: whenever possible, the
initialization of the simplex method chooses the
origin point (all decision variables equal zero) to be
the initial CPF solution.
• Solution concept 4: Each time the simplex method
performs an iteration to move from the current CPF
solution to a better one, it always chooses a CPF
solution that is adjacent to the current one.
• Solution concept 5: After the current CPF solution is
identified, the simplex method examines each of the
edges of the feasible region that emanate from this
CPF solution.
Each of these edges leads to an adjacent CPF solution at
the other end, but the simplex method doesn’t even take
the time to solve for the adjacent CPF solution. Instead
it simply identifies the rate of improvement in Z that
would be obtained by moving along the edge. And then
chooses to move along the one with largest positive rate
of improvement.
• Solution concept 6: A positive rate of improvement in
Z implies that the adjacent CPF solution is better than
the current one, whereas a negative rate of
improvement in Z implies that the adjacent CPF
solution is worse. Therefore, the optimality test
consists simply of checking whether any of the edges
give a positive rate of improvement in Z. if none do,
then the current CPF solution is optimal.
The figure provides the graphical solution space for
the problem.
The Simplex Method
Let, for a LP problem
m = no. of linear constraint equations and
n = no. of nonnegative variables
In the algebraic solution, by setting (n – m) variables
equal to zero and solve the m equations for the
remaining m variables.
The zero n – m variables are known as non basic
variables.
The remaining m variables are called basic variables,
and their solution (obtained by solving the m
equations) is referred to as basic solution.
The simplex technique involves generating a series
of solutions in tabular form, called tableaus.
Each tableau corresponds to a corner point of the
feasible solution space.
The first tableau corresponds to the origin.
Subsequent tableaus are developed by shifting to an
adjacent corner point in the direction that yields the
highest (smallest) rate of profit (cost).
This process continues as long as a positive
(negative) rate of profit (cost) exists.
By inspecting the top row of each tableau, one can
immediately tell if it represents the optimal solution.
Simplex method in tabular form

a. Construct the initial simplex tableau

Basic X1 … Xn S1 …... Sn RHS


variable
Z Objective function Z
coefficient value
S b
Coefficient of the
constraints
Example (All constraints are )
Solve the following problem using the simplex method
Maximize
Z = 3X1+ 5X2
Subject to
X1  4
2 X2  12
3X1 +2X2  18
X1 , X2  0
Solution
Standard form
Maximize Z,
Z - 3X1- 5X2 = 0
Subject to

X1 + S1 = 4
2 X2 + S2 = 12
3X1 +2X2 + S3 = 18

X1 , X2, S1, S2, S3  0


a. Initial tableau

Iteration 0:
Basic X1 X2 S1 S2 S3 RHS
variable
Z -3 -5 0 0 0 0
S1 1 0 1 0 0 4
S2 0 2 0 1 0 12
S3 3 2 0 0 1 18
Notes:
• The basic feasible solution at the initial tableau is (0,
0, 4, 12, 18) where:
X1 = 0, X2 = 0, S1 = 4, S2 = 12, S3 = 18, and Z = 0
Where S1, S2, and S3 are basic variables
X1 and X2 are non basic variables
• The solution at the initial tableau is associated to the
origin point at which all the decision variables are
zero.
b. Iteration
Step 1. Determine the entering basic variable by
selecting the variable (from a non basic variable)
with the most negative value (in case of
maximization) or with the most positive (in case of
minimization) in the objective row (Z-row). Put a
box around the column below this variable, and call
it the “pivot column”
Entering
variable

Basic X1 X2 S1 S2 S3 RHS
variable
Z -3 -5 0 0 0 0
S1 1 0 1 0 0 4
S2 0 2 0 1 0 12
S3 3 2 0 0 1 18

Leaving Pivot row


Pivot column
variable Pivot
number
Step 2:
Determine the leaving basic variable by applying the
minimum ratio test as following:
1. Pick out each coefficient in the pivot column that is
strictly positive (>0)
2. Divide each of these coefficients into the right
hand side entry for the same row
3. Identify the row that has the smallest of these ratios
4. The basic variable for that row is the leaving
variable, so replace that variable by the entering
variable in the basic variable column of the next
simplex tableau. Put a box around this row and call
it the “pivot row”
• Step 2: Determining the leaving variable by using the
minimum ratio test as following:

Basic Entering RHS Ratio


variable variable X2
(1) (2) (2)(1)
S1 0 4 None
S2 2 12 6
Leaving Smallest ratio
S3 2 18 9
Step 3: Solve for the new BF solution by using
elementary row operations to construct a new simplex
tableau, and then return to the optimality test. The
specific elementary row operations are:
Step 3: solving for the new BF solution by using the
eliminatory row operations as following:
1. New pivot row = old pivot row  pivot number

Basic X1 X2 S1 S2 S3 RHS
variable
S1
X2 0 1 0 1/2 0 6
S3

Note that X2 becomes in the basic


variables list instead of S2
Basic X1 X2 S1 S2 S3 RHS
variable
Z -3 0 0 5/2 0 30
S1 1 0 1 0 0 4
X2 0 1 0 1/2 0 6
S3 3 0 0 -1 1 6

This solution is not optimal, since there is a


negative numbers in the last row
Apply the same rules we will obtain this solution:
Iteration 02:

Basic X1 X2 S1 S2 S3 RHS
variable
Z 0 0 0 3/2 1 36
S1 0 0 1 1/3 -1/3 2
X2 0 1 0 1/2 0 6
X1 1 0 0 -1/3 1/3 2

This solution is optimal; since there is no negative solution in the


objective row: basic variables are X1 = 2, X2 = 6 and S1 = 2; the
non basic variables are S2 = S3 = 0
Z = 36
Solution

Iteration 0:

Basic X1 X2 S1 S2 S3 RHS
variable
Z -3 -5 0 0 0 0
S1 1 0 1 0 0 4
S2 0 2 0 1 0 12
S3 3 2 0 0 1 18
Iteration 01:

Basic X1 X2 S1 S2 S3 RHS
variable
Z -3 0 0 5/2 0 30
S1 1 0 1 0 0 4
X2 0 1 0 1/2 0 6
S3 3 0 0 -1 1 6
Iteration 02:

Basic X1 X2 S1 S2 S3 RHS
variable
Z 0 0 0 3/2 1 36
S1 0 0 1 1/3 -1/3 2
X2 0 1 0 1/2 0 6
X1 1 0 0 -1/3 1/3 2
Optimality condition: The entering variable in a
maximization (minimization) problem is the non-
basic variable with the most negative (positive)
coefficient in the z-row. Ties are broken arbitrarily.
The optimum is reached at the iteration where all the
z-row coefficients are nonnegative (nonpositive).

Feasibility condition: 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.
Ties are broken arbitrarily.
Practice -1
Reddy Mikks produces both interior and exterior paints from two raw
materials, M1 and M2. The following table provides the basic data of the
problem:

The daily demand for interior paint cannot exceed that for exterior paint
by more than 1 ton. Also, the maximum daily demand for interior paint is
2 tons.

Reddy Mikks wants to determine the optimum (best) product mix of


interior and exterior paints that maximizes the total daily profit. Solve the
problem using simplex method.
Practice -2
A furniture company manufactures desks and chairs. The
sawing department cuts the lumber for both products, which
is then sent to separate assembly departments. Assembled
items are sent to the painting department for finishing. The
daily capacity of the sawing department is 200 chairs or 80
desks. The chair assembly department can produce 120 chairs
daily, and the desk assembly department 60 desks daily. The
paint department has a daily capacity of either 150 chairs or
110 desks. Given that the profit per chair is
$50 and that of a desk is $100, determine the optimal
production mix for the company.
Practice -3
Solve the following maximization problem -

maximize x0 =3x1+2x2+5x3

Subject to
x1+2x2+x3 430
3x1+2x3 460
x1+4x2 420
x10, x20, x3 0.
Practice -4
Solve the following minimization problem -

minimize x0 = x1 - 3x2 - 2x3

Subject to
3x1 - x2 + 2x3 7
-2x1+4x2 12
-4x1+3x2 +8x3 10
x10, x20, x3 0.
Artificial Starting Solution Technique
 If any of the constraints in the
original problem is ( or (=), the
slack variable cannot provide a
starting (feasible) solution.
 Simplex method requires initial

basic solution at the origin


 In figure solution at origin is

outside feasible solution space


 In such cases we introduce a new

type of variable called the


artificial variable.
Cont’d
 …have any
These variables are fictitious and cannot
physical meaning
 Create an artificial positive solution at the origin

 Artificial solution helps get the simplex process

started
 To solve such LPP there are two methods.

(i) M-Method
(ii) Two-phase Method
M-method

If equation i does not have a slack, an artificial variable


Ri, is added to form a starting solution similar to the all-
slack basic solution.
Since the artificial variables are not part of the original
problem, it is needed to force them to zero in the final
solution.
The desired goal is achieved by assigning a large value
of M, which represents a large positive cost.

.
Solving steps
Step 1: Express the problem in the standard form.
Step 2: Add non-negative artificial variables to the left side of each
of the equations corresponding to constraints of the type >, or =
Step 3: Solve until anyone of the three cases may arise.
1. If no artificial variable appears in the basic and the optimality
conditions are satisfied.
2. If at least one artificial variable in the basis at zero level and the
optimality condition is satisfied then the current solution is an
optimal basic feasible solution (though degenerated solution).
3. If at least one artificial variable appears in the basis at positive
level and the optimality condition is satisfied, then the original
problem has no feasible solution. The solution satisfies the
constraints but does not optimize the objective function, since it
contains a very large penalty M and is called pseudo optimal
solution.
Example

subject to
Standard form:

Subject to

Starting tableau:

-M -M
Using M=100,
Iteration 0:

Iteration 1:
Iteration 2:

Iteration 3:
Iteration 4:

Optimum result: x1 = 2/5, x2 = 9/5, z = 17/5


Practice -5

Solve the following using M-method


maximize x0 = 2x1 + 3x2 - 5x3

subject to
x1 + x2 + x3 7
2x1 - 5x2 + x3 10

x10, x20, x3 0.
Practice -6

Solve the following using M-method


minimize x0 = 5x1 - 6x2 - 7x3

Subject to
x1 + 5x2 - 3x3
5x1 - 6x2 + 10x3 20
x1 + x2 + x3 = 5

x10, x20, x3 0
Assignment

Practice -2
Practice -4
Practice -6

Submission Deadline: 17/03/2021


Two-phase Method

In the M-method, the use of the penalty, M, can result


in computer roundoff error. The two-phase method
eliminates the use of the constant M altogether.

Phase I
Put the problem in equation form, and add the
necessary artificial variables to the constraints.
Example

subject to

Standard form:
 Next, we introduce an artificial objective function
as the sum of artificial variables introduced in the
constraints.
The objective function should minimize the sum of
the artificial variable regardless of whether the
original LP is maximization or minimization.
#
Phase I
Starting tableau:

Iteration 1:
Iteration 2:

Iteration 3:

If some artificial variable has a positive value in the optimal


solution, the original problem is infeasible; stop. Otherwise,
proceed to Phase II.
Phase II
In phase two rewrite the previous tableau by
dropping the artificial objective function and
artificial variables.

After deleting the artificial columns, we write the


original problem as -
• Associated tableau

• Again, because the basic variables x1 and x2 have nonzero


coefficients in the z-row, they must be substituted out
• Iteration 5:
Iteration 5:
Example

Maximize 3x1+2x2
Subject to 2x1+x2 2
3x1+4x2 12
x= 0, x2 0
Special Cases in The Simplex Method

1. Degeneracy
2. Alternative optima
3. Unbounded solutions
4. Non existing (or infeasible) solutions
Degeneracy

If a tie for the minimum ratio occurs in the


application of the feasibility condition at least one
basic variable will be zero in the next iteration and
the new solution is said to be Degenerate.
It is possible for the simplex method to enter a
repetitive sequence of iterations, thus never
improving the objective value and never satisfying
the optimality condition.
Sometimes the solution can be temporarily
degenerate.
Example

Max Z = 3x1 + 9x2

Subject to constraints:
x1 + 4x2 8
x1 + 2x2 4
x1, x2 0
Solution:
Let S1 and S2 be two slack variables.
Modified form is:
Z - 3x1 - 9x2 = 0
x1 + 4x2 + S1 = 8
x1 + 2x2+S2 = 4
x1, x2 , S1, S2 0

Initial BFS is : x1= 0, x2= 0, S1= 8, S2= 4 and Z=0


Iteration 0

Iteration 1
Iteration 2

Optimal Solution is : x1= 0, x2= 2


Z = 18
It results in a Degenerate Basic Solution.
Graphical Analysis of Degeneracy

The graphical solution of the problem is –


• Graphically, it occurs due to redundant constraint
(i.e. a constraint that can be removed from system
without changing the feasible solution). Equation x1
+ 4x2 8 is redundant here.

• It is noted that a degenerate solution occurs when


more than ‘m’ constraints pass through the same
solution point.
Alternative Optima

• If the z-row value for one or more non-basic


variable is zero in the optimal tableau, alternate
optimal solution exists.
• Negative coefficient in row Z values represent profit
and zero indicate no increase or loss
• Coefficients of x1 and s1 have zero values
• Coefficient of x2 has a value of zero and it is not part
of basic solution
• If x2 enters solution, we will have a new solution
without changing z
• To determine alternate solution, select x2 as the
entering variable and then determine pivot row as
usual.
Example

Basic Z x1 x2 s1 s2 Solution

Z 1 0 0 0 10 1200

x2 0 0 1 0.8 -0.2 8

x1 0 1 0 -0.6 0.4 24

The solution is, s1=10, x1=30, z= 1200


and x2=8, x1=24, z=1200
Graphically, it happens when the objective function
is parallel to a non-redundant binding constraint
(i.e. a constraint that is satisfied as an equation at
the optimal solution).
Unbounded solutions

• Occur where feasible solution area is not closed


without violating any of the constraints.
• When determining the leaving variable of any
tableau, if there is no positive minimum ratio or all
entries of pivot column are negative or zero.
Example:

Subject to

Graphical solution
Starting solution
Non existing (or infeasible) solutions

• Special case where a LP has not feasible solution


area
• This situation obviously does not occur when all the
constraints are type ≤ with non-negative right-hand
side because all slack variables provide an obvious
feasible solution.
• If at least one artificial variable is positive in the
optimum iteration, then the LPP has no feasible
solution.
Example

Subject to

Solution
Sensitivity Analysis
How does the value of the optimum solution change
when coefficients in the objective function or
constraints change?

Two cases will be considered –


1. Sensitivity of the optimum solution to changes in
the availability of the resources (right-hand side of the
constraints).
2. Sensitivity of the optimum solution to changes in
unit profit or unit cost (coefficients of the objective
function)
Changes in the Right-Hand side
TOYCO model
TOYCO uses three operations to assemble three
types of toys—trains, trucks, and cars. The daily
available times for the three operations are 430, 460,
and 420 mins, respectively, and the revenues per unit
of toy train, truck, and car are $3, $2, and $5,
respectively. The assembly times per train at the
three operations are 1, 3, and 1 mins, respectively.
The corresponding times per truck and per car are (2,
0, 4) and (1, 2, 0) mins (a zero time indicates that the
operation is not used). The objective is to maximize
profit.
Letting x1, x2, and x3 represent the daily number of
units assembled of trains, trucks, and cars,
respectively, the associated LP model is given as:

Using x4, x5, and x6 as the slack variables for the


constraints of operations 1, 2, and 3, respectively, the
optimum tableau is
# Optimal tableau
Let, D1, D2, and D3 are the (positive or negative) changes made
in the allotted daily manufacturing time of operations 1, 2, and
3, respectively. The original TOYCO model can then be
changed to -
We first rewrite the starting tableau –

The two shaded areas are identical. Hence, if we


repeat the same simplex iterations as in the original
model, the columns in the two highlighted area will
also be identical in the optimal tableau – that is
# Optimal tableau
Dual prices: The value of the objective function can
be written as
z = 1350 + 1D1 + 2D2 + 0D3
Feasibility range: The current solution remains
feasible if all the basic variables remain nonnegative
—that is,

a change in operation 1 time only means that D2 = D3


= 0. The simultaneous conditions thus reduce to
in a similar manner that the feasibility ranges for
operations 2 and 3 are
respectively (verify!).

Remember, the dual prices will remain applicable for


any simultaneous changes that keep the solution
feasible even if the changes violate the individual
ranges.
Changes in the Objective Function
# Given the TOYOCO problem -
Let d1, d2, and d3 represent the change in unit
revenues for toy trucks, trains, and cars, respectively.
The objective function then becomes –

Now the starting tableau appears as:


Optimal Tableau of the original problem is –

with the same sequence of entering and leaving variables


used in the original model (before the changes dj are made),
the optimal iteration will appear as follows –
A convenient way for computing the new tableau is to add a
new top row and a new leftmost column to the optimum
tableau

The entries in the top row are the change dj associated with
variable xj. For the leftmost column, the top element is 1 in
the z-row followed by di basic variable xi. Keep in mind that di
= 0 for slack variable xi.
To compute the new reduced cost for any variable (or the
value of z), multiply the elements of its column by the
corresponding elements in the leftmost column, add them up,
and subtract the top-row element from the sum.

The current solution remains optimal so long as the new


reduced costs (z equation coefficients) remain nonnegative
(maximization case)
Optimality range:
suppose that the objective coefficient of x2 only is changed to
2 + d2—meaning that d1 = d3 = 0. The simultaneous optimality
conditions thus reduce to,

In a similar manner, the optimality ranges for d1and d3 is –

You might also like