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

Chapter 3

The Simplex Method and


Sensitivity analysis
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
 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:
Maximine 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


Unrestricted variable
Sometimes decision variables are positive, negative
or zero values, then they are called unrestricted
variables.
In all such cases, the decision variables can be
expressed as the difference between two non-
negative variables.

You might also like