Linear Programming Linear Programming
Linear Programming Linear Programming
Linear Programming
Programming
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Module Outline
Introduction
The Linear Programming Model
Examples of Linear Programming Problems
Developing Linear Programming Models
Graphical Solution to LP Problems
The Simplex Method
Simplex Tableau for Maximization Problem
Marginal Values of Additional Resources
Sensitivity Analysis
Complications in Applying the Simplex Method
Duality
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Introduction
Mathematical programming is used to find the best or
optimal solution to a problem that requires a decision or set
of decisions about how best to use a set of limited
resources to achieve a state goal of objectives.
..Eq (2)
..Eq (3)
The decision variables, xI, x2, ..., xn, represent levels of n competing
activities.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Examples of LP Problems (1)
1. A Product Mix Problem
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Examples of LP Problems (2)
2. A Blending Problem
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Examples of LP Problems (3)
3. A Production Scheduling Problem
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Examples of LP Problems (4)
4. A Transportation Problem
The cost of shipping a unit from the ith origin to the jth
destination is known for all combinations of origins and
destinations.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Examples of LP Problems (5)
5. A Flow Capacity Problem
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Developing LP Model (1)
The variety of situations to which linear programming has
been applied ranges from agriculture to zinc smelting.
Steps Involved:
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Developing LP Model (2)
Example: Product Mix Problem
The N. Dustrious Company produces two products: I and II. The raw
material requirements, space needed for storage, production rates, and
selling prices for these products are given in Table 1.
The total amount of raw material available per day for both products is
15751b. The total storage space for all products is 1500 ft2, and a
maximum of 7 hours per day can be used for production.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Developing LP Model (3)
Example Problem
All products manufactured are shipped out of the storage area at the end
of the day. Therefore, the two products must share the total raw material,
storage space, and production time. The company wants to determine
how many units of each product to produce per day to maximize its
total income.
Solution
The company has decided that it wants to maximize its sale income,
which depends on the number of units of product I and II that it
produces.
Therefore, the decision variables, x1 and x2 can be the number of units
of products I and II, respectively, produced per day.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Developing LP Model (4)
The object is to maximize the equation:
Z = 13x1 + 11x2
subject to the constraints on storage space, raw materials, and
production time.
Each unit of product I requires 4 ft2 of storage space and each unit of
product II requires 5 ft2. Thus a total of 4x1 + 5x2 ft2 of storage space is
needed each day. This space must be less than or equal to the
available storage space, which is 1500 ft2. Therefore,
4X1 + 5X2 1500
Similarly, each unit of product I and II produced requires 5 and 3 1bs,
respectively, of raw material. Hence a total of 5xl + 3x2 Ib of raw
material is used.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Developing LP Model (5)
This must be less than or equal to the total amount of raw material
available, which is 1575 Ib. Therefore,
5x1 + 3x2 1575
Prouct I can be produced at the rate of 60 units per hour. Therefore, it
must take I minute or 1/60 of an hour to produce I unit. Similarly, it
requires 1/30 of an hour to produce 1 unit of product II. Hence a total of
x1/60 + x2/30 hours is required for the daily production. This quantity
must be less than or equal to the total production time available each
day. Therefore,
x1 / 60 + x2 / 30 7
or x1 + 2x2 420
Finally, the company cannot produce a negative quantity of any
product, therefore x1 and x2 must each be greater than or equal to
zero.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Developing LP Model (6)
The linear programming model for this example can be summarized
as:
..Eq (4)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Graphical Solution to LP Problems (1)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Graphical Solution to LP Problems (2)
An equation of the form 4x1 + 5x2 = 1500 defines a straight line in the
x1-x2 plane. An inequality defines an area bounded by a straight line.
Therefore, the region below and including the line 4x1 + 5x2 = 1500 in
the Figure represents the region defined by 4x1 + 5x2 1500.
Same thing applies to other equations as well.
The shaded area of the figure comprises the area common to all the
regions defined by the constraints and contains all pairs of x I and x2
that are feasible solutions to the problem.
This area is known as the feasible region or feasible solution space.
The optimal solution must lie within this region.
There are various pairs of x1 and x2 that satisfy the constraints such as:
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Graphical Solution to LP Problems (3)
Trying different solutions, the optimal solution will be:
X1 = 270
X2 = 75
This indicates that maximum income of $4335 is obtained by producing
270 units of product I and 75 units of product II.
In this solution, all the raw material and available time are used,
because the optimal point lies on the two constraint lines for these
resources.
However, 1500- [4(270) + 5(75)], or 45 ft2 of storage space, is not
used. Thus the storage space is not a constraint on the optimal
solution; that is, more products could be produced before the company
ran out of storage space. Thus this constraint is said to be slack.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Graphical Solution to LP Problems (4)
If the objective function happens to be parallel to one of the
edges of the feasible region, any point along this edge between
the two extreme points may be an optimal solution that
maximizes the objective function. When this occurs, there is no
unique solution, but there is an infinite number of optimal
solutions.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
The Simplex Method (1)
When decision variables are more than 2, it is always
advisable to use Simplex Method to avoid lengthy graphical
procedure.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
The Simplex Method (2)
Steps involved:
1. Locate an extreme point of the feasible region.
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.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
The Simplex Method (3)
Example: Product Mix Problem
The N. Dustrious Company produces two products: I and II. The raw
material requirements, space needed for storage, production rates, and
selling prices for these products are given below:
The total amount of raw material available per day for both products is
15751b. The total storage space for all products is 1500 ft2, and a
maximum of 7 hours per day can be used for production. The company
wants to determine how many units of each product to produce per
day to maximize its total income.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
The Simplex Method (4)
Solution
Step 1: Convert all the inequality constraints into equalities by
the use of slack variables. Let:
..Eq (4)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
The Simplex Method (5)
Introducing these slack variables into the inequality constraints
and rewriting the objective function such that all variables are on
the left-hand side of the equation. Equation 4 can be expressed
as:
..Eq (5)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
The Simplex Method (6)
..Eq (6)
Substituting this equation into Eq. (5) yields the following new
formulation of the model.
..Eq (7)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
The Simplex Method (8)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
The Simplex Method (9)
Following the same analysis procedure used in step 1, it is clear
that:
From Eq. (C2), x2 can take on the value (5/3 )(315) = 525 if
x1 = S2 = 0
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
The Simplex Method (10)
Step 3: From Equation D2:
..Eq (8)
..Eq (9)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Simplex Tableau for Maximization (1)
..Eq (5)
In any
iteration, a
variable that
has a
nonzero
value in the
solution is
called a
basic
variable.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Simplex Tableau for Maximization (2)
Step III: Identify the variable, called the leaving variable, which
will be changed from a nonzero to a zero value in the next
solution.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Simplex Tableau for Maximization (3)
Step IV: . Enter the basic variables for the second tableau. The
row sequence of the previous tableau should be maintained,
with the leaving variable being replaced by the entering variable.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Simplex Tableau for Maximization (4)
Step V: Compute the coefficients for the second tableau. A
sequence of operations will be performed so that at the end the
x1 column in the second tableau will have the following
coefficients:
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Simplex Tableau for Maximization (5)
The row operations proceed as fo1lows:
The coefficients in row C2 are obtained by dividing the
corresponding coefficients in row C1 by 5.
The coefficients in row A2 are obtained by multiplying the
coefficients of row C2 by 13 and adding the products to the
corresponding coefficients in row Al.
The coefficients in row B2 are obtained by multiplying the
coefficients of row C2 by -4 and adding the products to the
corresponding coefficients in row Bl.
The coefficients in row D2 are obtained by multiplying the
coefficients of row C2 by -1 and adding the products to the
corresponding coefficients in row Dl.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Simplex Tableau for Maximization (6)
Step VI: Check for optimality. The second feasible solution is
also not optimal, because the objective function (row A2)
contains a negative coefficient. Another iteration beginning with
step 2 is necessary.
In the third tableau (next slide), all the coefficients in the
objective function (row A3) are positive. Thus an optimal solution
has been reached and it is as follows:
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Marginal Values of Additional
Resources (1)
The simplex solution yields the optimum production program for
N. Dustrious Company.
The company can maximize its sale income to $4335 by
producing 270 units of product I and 75 units of product II.
There will be no surplus of raw materials or production time.
But there will be 45 units of unused storage space.
The managers are interested to know if it is worthwhile to
increase its production by purchasing additional units of
raw materials and by either expanding its production
facilities or working overtime.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Marginal Values of Additional
Resources (2)
The critical questions are:
What is the income value (or marginal value) of each additional
unit of each type of resources?
What is the maximum cost ( or marginal cost) that they should be
willing to pay for each additional unit of resources?
Answers to these questions can be obtained from the objective
function in the last tableau of the simplex solution:
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Marginal Values of Additional
Resources (3)
Because S1, S2 and S3 represent surplus resources, the
negatives of these variables (i.e., -S1, -S2, -S3) represent
additional units of these resources that can be made available.
The income values (or marginal values of additional units of
these resources can be obtained by taking the partial derivatives
of Z with respect to -S1, -S2 and -S3.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Marginal Values of Additional
Resources (4)
Thus, the marginal values of additional units of resources can be
obtained directly from the coefficients of the objective function in
the last tableau of a simplex solution.
The N. Dustrious Company should be willing to pay up to $15/7
for an additional unit of raw materials and $16/7 for an additional
unit of production time.
If the actual cost of an additional unit (i.e., marginal cost) of
these resources are smaller than the marginal value, the
company should be able to increase its income by increasing
production.
The marginal values above are valid, however, only as long as
there is surplus storage space available.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Sensitivity Analysis
Sensitivity analysis helps to test the sensitivity of the optimum
solution with respect to changes of the coefficients in the
objective function, coefficients in the constraints inequalities, or
the constant terms in the constraints.
For Example in the case study discussed:
The actual selling prices (or market values) of the two products
may vary from time to time. Over what ranges can these prices
change without affecting the optimality of the present solution?
Will the present solution remain the optimum solution if the amount
of raw materials, production time, or storage space is suddenly
changed because of shortages, machine failures, or other events?
The amount of each type of resources needed to produce one unit
of each type of product can be either increased or decreased
slightly. Will such changes affect the optimal solution ?
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Complications in Simplex Method (1)
An objective function to be minimized instead of maximized.
Greater-than-or-equal-to constraints.
Equalities instead of inequalities for constraints.
Decision variables unrestricted in signs.
Zero constants on the right-hand side of one or more
constraints.
Some or all decision variables must be integers.
Non-positive constants on the right-hand side of the constraints.
More than one optimal solution, that is, multiple solutions such
that there is no unique optimal solution.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Complications in Simplex Method (2)
The constraints are such that no feasible solution exists.
The constraints are such that one or more of the variables can
increase without limit and never violate a constraint (i.e., the
solution is unbounded).
Some or all of the coefficients and right-hand-side terms are
given by a probability distribution rather than a single value.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Complications in Simplex Method (3)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Complications in Simplex Method (5)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Complications in Simplex Method (6)
.Eq. (1)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Complications in Simplex Method (7)
.Eq. (2)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Complications in Simplex Method (8)
.Eq. (4)
From Eq. (3):
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Complications in Simplex Method (9)
.Eq. (5)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Complications in Simplex Method (10)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Complications in Simplex Method (11)
Equality Constraint
An equality constraint has the following general form:
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Complications in Simplex Method (12)
Equality Constraint
Because xj and xj can have any nonnegative values their
difference (xj xj) can have any value (positive or negative).
After substitution, the simplex method can proceed with just
nonnegative variables.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Complications in Simplex Method (13)
Degenerate Solution
If the number of basic variables is fewer than the number of
constraints in a solution, the solution is said to be degenerate.
A zero constant term for one or more basic variables in any
iteration of the simplex solution would be a clear indication of a
degenerate solution.
The normal simplex procedure cannot solve a degenerate
problem.
Advanced methods are available to solve degenerate problems.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Complications in Simplex Method (14)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Duality (1)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Duality (2)
Let y1, y2 and y3 represent the unit price of each unit of storage
space, raw materials, and production time, respectively.
The unit prices are in fact the income values of each unit of
resource to the N. Dustrious Company.
There are available 500 ft2 of storage space, 1575 lb of raw
materials, and 420 minutes of production time per day.
Thus the total income value (P) of all the available resources
may be expressed as follows :
P = 1500y1 + 1575y2 + 420y3
In addition, the unit prices y1, y2 and y3 must all be greater than
or equal to zero.
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Duality (4)
.Eq. (1)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Duality (6)
Complete Regularization of the Primal Problem
Consider the following primal problem:
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Duality (7)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Duality (8)
The primal problem can now take the following standard form:
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Duality (9)
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.
Questions/Queries?
BCN67755
Decision and Risk Analysis Syed M. Ahmed, Ph.D.