Linear Programming Models: Graphical and Computer Methods
Linear Programming Models: Graphical and Computer Methods
7-3
Formulating LP Problems
Formulating a linear program involves developing
a mathematical model to represent the managerial
problem.
The steps in formulating a linear program are:
1. Completely understand the managerial
problem being faced.
2. Identify the objective and the constraints.
3. Define the decision variables.
4. Use the decision variables to write
mathematical expressions for the objective
function and the constraints.
7-4
Flair Furniture Company
The Flair Furniture Company produces
inexpensive tables and chairs.
Processes are similar in that both require a
certain amount of hours of carpentry work and in
the painting and varnishing department.
Each table takes 4 hours of carpentry and 2 hours
of painting and varnishing.
Each chair requires 3 of carpentry and 1 hour of
painting and varnishing.
There are 240 hours of carpentry time available
and 100 hours of painting and varnishing.
Each table yields a profit of $70 and each chair a
profit of $50.
7-5
Flair Furniture Company Data
The company wants to determine the best
combination of tables and chairs to produce to reach
the maximum profit.
HOURS REQUIRED TO
PRODUCE 1 UNIT
(T) (C) AVAILABLE HOURS
DEPARTMENT TABLES CHAIRS THIS WEEK
Carpentry 4 3 240
Table 7.2
7-6
Flair Furniture Company
The objective is to:
Maximize profit
The constraints are:
1. The hours of carpentry time used cannot
exceed 240 hours per week.
2. The hours of painting and varnishing time
used cannot exceed 100 hours per week.
The decision variables representing the actual
decisions we will make are:
T = number of tables to be produced per week.
C = number of chairs to be produced per week.
7-7
Flair Furniture Company
We create the LP objective function in terms of T
and C:
Maximize profit = $70T + $50C
Develop mathematical relationships for the two
constraints:
For carpentry, total time used is:
(4 hours per table)(Number of tables produced)
+ (3 hours per chair)(Number of chairs produced).
We know that:
Carpentry time used ≤ Carpentry time available.
4T + 3C ≤ 240 (hours of carpentry time)
7-8
Flair Furniture Company
Similarly,
Painting and varnishing time used
≤ Painting and varnishing time available.
2 T + 1C ≤ 100 (hours of painting and varnishing time)
7-9
Flair Furniture Company
The values for T and C must be nonnegative.
T ≥ 0 (number of tables produced is greater than
or equal to 0)
C ≥ 0 (number of chairs produced is greater than
or equal to 0)
7-10
Graphical Solution to an LP Problem
7-11
Graphical Representation of a
Constraint
Quadrant Containing All Positive Values
C
100 –
– This Axis Represents the Constraint T ≥ 0
Number of Chairs
80 –
–
60 –
–
40 – This Axis Represents the
– Constraint C ≥ 0
20 –
–
|– | | | | | | | | | | |
Figure 7.1 0 20 40 60 80 100 T
Number of Tables
7-12
Graphical Representation of a
Constraint
The first step in solving the problem is to
identify a set or region of feasible
solutions.
To do this we plot each constraint
equation on a graph.
We start by graphing the equality portion
of the constraint equations:
4T + 3C = 240
We solve for the axis intercepts and draw
the line.
7-13
Graphical Representation of a
Constraint
When Flair produces no tables, the
carpentry constraint is:
4(0) + 3C = 240
3C = 240
C = 80
Similarly for no chairs:
4T + 3(0) = 240
4T = 240
T = 60
This line is shown on the following graph:
7-14
Graphical Representation of a
Constraint
Graph of carpentry constraint equation
C
100 –
–
(T = 0, C = 80)
Number of Chairs
80 –
–
60 –
–
40 –
–
(T = 60, C = 0)
20 –
–
Figure 7.2 |– | | | | | | | | | | |
0 20 40 60 80 100 T
Number of Tables 7-15
Graphical Representation of a
Constraint
Region that Satisfies the Carpentry Constraint
C
Any point on or below
100 – the constraint plot will
– not violate the
restriction.
Number of Chairs
80 –
Any point above the
–
plot will violate the
60 –
restriction.
–
(30, 40) (70, 40)
40 –
–
20 –
– (30, 20)
|– | | | | | | | | | | |
Figure 7.3 0 20 40 60 80 100 T
Number of Tables
7-16
Graphical Representation of a
Constraint
The point (30, 40) lies on the plot and
exactly satisfies the constraint
4(30) + 3(40) = 240.
The point (30, 20) lies below the plot and
satisfies the constraint
4(30) + 3(20) = 180.
The point (70, 40) lies above the plot and
does not satisfy the constraint
4(70) + 3(40) = 400.
7-17
Graphical Representation of a
Constraint
Region that Satisfies the Painting and
Varnishing Constraint
C
100 – (T = 0, C = 100)
–
Number of Chairs
80 –
–
60 –
–
40 –
–
(T = 50, C = 0)
20 –
–
Figure 7.4 |– | | | | | | | | | | |
0 20 40 60 80 100 T
Number of Tables 7-18
Graphical Representation of a
Constraint
7-19
Graphical Representation of a
Constraint
Feasible Solution Region for the Flair
Furniture Company Problem
C
100 –
–
Number of Chairs
80 – Painting/Varnishing Constraint
–
60 –
–
40 –
–
Carpentry Constraint
20 – Feasible
Region
–
|– | | | | | | | | | | |
Figure 7.5
0 20 40 60 80 100 T
Number of Tables
7-20
Graphical Representation of a
Constraint
For the point (30, 20)
7-21
Graphical Representation of a
Constraint
For the point (50, 5)
7-22
Isoprofit Line Solution Method
Once the feasible region has been graphed, we
need to find the optimal solution from the many
possible solutions.
The speediest way to do this is to use the isoprofit
line method.
Starting with a small but possible profit value, we
graph the objective function.
We move the objective function line in the
direction of increasing profit while maintaining the
slope.
The last point it touches in the feasible region is
the optimal solution.
7-23
Isoprofit Line Solution Method
For Flair Furniture, choose a profit of $2,100.
The objective function is then
$2,100 = 70T + 50C
Solving for the axis intercepts, we can draw the
graph.
This is obviously not the best possible solution.
Further graphs can be created using larger profits.
The further we move from the origin, the larger the
profit will be.
The highest profit ($4,100) will be generated when
the isoprofit line passes through the point (30, 40).
7-24
Isoprofit Line Solution Method
Profit line of $2,100 Plotted for the Flair
C
Furniture Company
100 –
–
Number of Chairs
80 –
–
60 –
–
(0, 42) $2,100 = $70T + $50C
40 –
–
(30, 0)
20 –
–
|– | | | | | | | | | | |
Figure 7.6
0 20 40 60 80 100 T
Number of Tables 7-25
Isoprofit Line Solution Method
Four Isoprofit Lines Plotted for the Flair
Furniture Company
C
100 –
–
$3,500 = $70T + $50C
Number of Chairs
80 –
– $2,800 = $70T + $50C
60 –
– $2,100 = $70T + $50C
40 –
– $4,200 = $70T + $50C
20 –
–
|– | | | | | | | | | | |
Figure 7.7
0 20 40 60 80 100 T
Number of Tables 7-26
Isoprofit Line Solution Method
Optimal Solution to the Flair Furniture problem
C
100 –
–
Number of Chairs
80 –
Maximum Profit Line
–
60 – Optimal Solution Point
– (T = 30, C = 40)
40 –
– $4,100 = $70T + $50C
20 –
–
Figure 7.8 |– | | | | | | | | | | |
0 20 40 60 80 100 T
Number of Tables 7-27
Corner Point Solution Method
A second approach to solving LP problems
employs the corner point method.
It involves looking at the profit at every
corner point of the feasible region.
The mathematical theory behind LP is that
the optimal solution must lie at one of the
corner points,
points or extreme point,
point in the
feasible region.
For Flair Furniture, the feasible region is a
four-sided polygon with four corner points
labeled 1, 2, 3, and 4 on the graph.
7-28
Corner Point Solution Method
Four Corner Points of the Feasible Region
C
100 –
2 –
Number of Chairs
80 –
–
60 –
–
3
40 –
–
20 –
–
1 |– | | | | | | | | | | |
Figure 7.9
0 20 40
4 60 80 100 T
Number of Tables
7-29
Corner Point Solution Method
To find the coordinates for Point 3 accurately we have to
solve for the intersection of the two constraint lines.
Using the simultaneous equations method,
method we multiply the
painting equation by –2 and add it to the carpentry equation
4T + 3C = 240 (carpentry line)
– 4T – 2C = –200 (painting line)
C = 40
Substituting 40 for C in either of the original equations
allows us to determine the value of T.
4T + (3)(40) = 240 (carpentry line)
4T + 120 = 240
T = 30
7-30
Corner Point Solution Method
Point 1 : (T = 0, C = 0) Profit = $70(0) + $50(0) = $0
Point 2 : (T = 0, C = 80) Profit = $70(0) + $50(80) = $4,000
Point 4 : (T = 50, C = 0) Profit = $70(50) + $50(0) = $3,500
Point 3 : (T = 30, C = 40) Profit = $70(30) + $50(40) = $4,100
7-31
Slack and Surplus
Table 7.4
7-33
Solving Flair Furniture’s LP Problem
Using QM for Windows and Excel
Most organizations have access to
software to solve big LP problems.
While there are differences between
software implementations, the approach
each takes towards handling LP is
basically the same.
Once you are experienced in dealing with
computerized LP algorithms, you can
easily adjust to minor changes.
7-34
Using QM for Windows
7-35
Using QM for Windows
Program 7.1A
7-36
Using QM for Windows
Program 7.1B
7-37
Using QM for Windows
Program 7.1C
7-38
Using QM for Windows
QM for Windows Graphical Output for Flair Furniture
Problem
Program 7.1D
7-39
Using Excel’s Solver Command to
Solve LP Problems
The Solver tool in Excel can be used to find
solutions to:
LP problems.
Integer programming problems.
Noninteger programming problems.
Solver is limited to 200 variables and 100
constraints.
7-40
Using Solver to Solve the Flair
Furniture Problem
Recall the model for Flair Furniture is:
7-41
Using Solver to Solve the Flair
Furniture Problem
1. Enter the variable names, the coefficients for the
objective function and constraints, and the right-
hand-side values for each of the constraints.
2. Designate specific cells for the values of the
decision variables.
3. Write a formula to calculate the value of the
objective function.
4. Write a formula to compute the left-hand sides of
each of the constraints.
7-42
Using Solver to Solve the Flair
Furniture Problem
Program 7.2A
7-43
Using Solver to Solve the Flair
Furniture Problem
Program 7.2B
7-44
Using Solver to Solve the Flair
Furniture Problem
Program 7.2C
7-45
Using Solver to Solve the Flair
Furniture Problem
Once the model has been entered, the following
steps can be used to solve the problem.
In Excel 2010, select Data – Solver.
Figure 7.2D
7-48
Using Solver to Solve the Flair
Furniture Problem
Solver
Parameters
Dialog Box
Figure 7.2E
7-49
Using Solver to Solve the Flair
Furniture Problem
Solver Add Constraint Dialog Box
Figure 7.2F
7-50
Using Solver to Solve the Flair
Furniture Problem
Solver Results Dialog Box
Figure 7.2G
7-51
Using Solver to Solve the Flair
Furniture Problem
Solution Found by Solver
Figure 7.2H
7-52
Solving Minimization Problems
Many LP problems involve minimizing an
objective such as cost instead of maximizing a
profit function.
Minimization problems can be solved graphically
by first setting up the feasible solution region and
then using either the corner point method or an
isocost line approach (which is analogous to the
isoprofit approach in maximization problems) to
find the values of the decision variables (e.g., X1
and X2) that yield the minimum cost.
7-53
Holiday Meal Turkey Ranch
The Holiday Meal Turkey Ranch is considering buying
two different brands of turkey feed and blending them
to provide a good, low-cost diet for its turkeys
Let
X1 = number of pounds of brand 1 feed purchased
X2 = number of pounds of brand 2 feed purchased
7-55
Feasible Region for the Holiday
Meal Turkey Ranch Problem
X2
–
20 – Ingredient C Constraint
Pounds of Brand 2
15 – Feasible Region
a
10 –
Ingredient B Constraint
5– b Ingredient A Constraint
Figure 7.10
| | | | c | |
0–
5 10 15 20 25 X1
Pounds of Brand 1 7-56
Holiday Meal Turkey Ranch
Solve for the values of the three corner points.
Point a is the intersection of ingredient constraints
C and B.
4X1 + 3X2 = 48
X1 = 3
Substituting 3 in the first equation, we find X2 = 12.
Solving for point b with basic algebra we find X1 =
8.4 and X2 = 4.8.
Solving for point c we find X1 = 18 and X2 = 0.
7-57
Holiday Meal Turkey Ranch
Substituting these value back into the objective
function we find
7-58
Holiday Meal Turkey Ranch
Graphical Solution to the Holiday Meal Turkey Ranch
Problem Using the Isocost Approach
X2
–
Feasible Region
20 –
Pounds of Brand 2
15 – 54
=2 ¢
Di X
re 1 +
cti 3X
on
of 2 Is
10 – De oc
31 os
.2¢ cr tL
=2 e as ine
X ing
1 + Co
5– 3X st
2
Program 7.3
7-60
Holiday Meal Turkey Ranch
Excel 2010 Spreadsheet for the Holiday Meal Turkey
Ranch problem
Program 7.4A
7-61
Holiday Meal Turkey Ranch
Excel 2010 Solution to the Holiday Meal Turkey
Ranch Problem
Program 7.4B
7-62
Four Special Cases in LP
7-63
Four Special Cases in LP
No feasible solution
This exists when there is no solution to the
problem that satisfies all the constraint
equations.
No feasible solution region exists.
This is a common occurrence in the real world.
Generally one or more constraints are relaxed
until a solution is found.
7-64
Four Special Cases in LP
A problem with no feasible solution
X2
8–
–
6–
– Region Satisfying
4– Third Constraint
–
2–
–
0– | | | | | | | | | |
Figure 7.12 2 4 6 8 X1
Region Satisfying First Two Constraints
7-65
Four Special Cases in LP
Unboundedness
Sometimes a linear program will not have a
finite solution.
In a maximization problem, one or more
solution variables, and the profit, can be made
infinitely large without violating any
constraints.
In a graphical solution, the feasible region will
be open ended.
This usually means the problem has been
formulated improperly.
7-66
Four Special Cases in LP
A Feasible Region That is Unbounded to the Right
X2
X1 ≥ 5
15 –
X2 ≤ 10
10 –
Feasible Region
5–
X1 + 2X2 ≥ 15
| | | | |
Figure 7.13 0– 5 10 15 X1
7-67
Four Special Cases in LP
Redundancy
A redundant constraint is one that does not
affect the feasible solution region.
One or more constraints may be binding.
This is a very common occurrence in the real
world.
It causes no particular problems, but
eliminating redundant constraints simplifies
the model.
7-68
Four Special Cases in LP
Problem with a Redundant Constraint
X2
30 –
25 –
2X1 + X2 ≤ 30
20 –
Redundant
Constraint
15 –
X1 ≤ 25
10 – X1 + X2 ≤ 20
Feasible
Figure 7.14 5– Region
| | | | | |
0–
5 10 15 20 25 30 X1
7-69
Four Special Cases in LP
7-70
Four Special Cases in LP
Example of Alternate Optimal Solutions
X2
8–
7–
A
6– Optimal Solution Consists of All
Combinations of X1 and X2 Along
5– the AB Segment
4–
2–
B Isoprofit Line for $12
1 – Feasible Overlays Line Segment AB
Figure 7.15
Region
0– | | | | | | | |
1 2 3 4 5 6 7 8 X1
7-71
Sensitivity Analysis
Optimal solutions to LP problems thus far have
been found under what are called deterministic
assumptions.
This means that we assume complete certainty in
the data and relationships of a problem.
But in the real world, conditions are dynamic and
changing.
We can analyze how sensitive a deterministic
solution is to changes in the assumptions of the
model.
This is called sensitivity analysis,
analysis postoptimality
analysis,
analysis parametric programming,
programming or optimality
analysis.
7-72
Sensitivity Analysis
Sensitivity analysis often involves a series of
what-if? questions concerning constraints,
variable coefficients, and the objective function.
One way to do this is the trial-and-error method
where values are changed and the entire model is
resolved.
The preferred way is to use an analytic
postoptimality analysis.
After a problem has been solved, we determine a
range of changes in problem parameters that will
not affect the optimal solution or change the
variables in the solution.
7-73
High Note Sound Company
The High Note Sound Company manufactures
quality CD players and stereo receivers.
Products require a certain amount of skilled
artisanship which is in limited supply.
The firm has formulated the following product mix
LP model.
60 –
7-76
Changes in the
Objective Function Coefficient
Changes in the Receiver Contribution Coefficients
X2
30 –
Old Profit Line for 50X1 + 120X2
(Passes through Point a)
20 – b
a Profit Line for 50X1 + 150X2
(Passes through Point a)
10 –
c
| | | | | |
0– 10 20 30 40 50 60 X1
Figure 7.17
7-77
QM for Windows and Changes in
Objective Function Coefficients
Input and Sensitivity Analysis for High Note Sound
Data Using QM For Windows
Program 7.5A
Program 7.5B
7-78
Excel Solver and Changes in
Objective Function Coefficients
Excel 2010 Spreadsheet for High Note Sound Company
Program 7.6A
7-79
Excel Solver and Changes in Objective
Function Coefficients
Figure 7.6B
7-80
Excel Solver and Changes in
Objective Function Coefficients
Excel 2010 Sensitivity Report for High Note Sound
Company
Program 7.6C
7-81
Changes in the
Technological Coefficients
7-82
Changes in the
Technological Coefficients
Change in the Technological Coefficients for the
High Note Sound Company
60 – 60 – 60 –
Stereo Receivers
7-83
Changes in Resources or
Right-Hand-Side Values
The right-hand-side values of the
constraints often represent resources
available to the firm.
If additional resources were available, a
higher total profit could be realized.
Sensitivity analysis about resources will
help answer questions about how much
should be paid for additional resources
and how much more of a resource would
be useful.
7-84
Changes in Resources or
Right-Hand-Side Values
If the right-hand side of a constraint is changed,
the feasible region will change (unless the
constraint is redundant).
Often the optimal solution will change.
The amount of change in the objective function
value that results from a unit change in one of the
resources available is called the dual price or dual
value .
The dual price for a constraint is the improvement
in the objective function value that results from a
one-unit increase in the right-hand side of the
constraint.
7-85
Changes in Resources or
Right-Hand-Side Values
However, the amount of possible increase in the
right-hand side of a resource is limited.
If the number of hours increased beyond the
upper bound, then the objective function would
no longer increase by the dual price.
There would simply be excess (slack)
slack hours of a
resource or the objective function may change by
an amount different from the dual price.
The dual price is relevant only within limits.
7-86
Changes in the Electricians’ Time Resource
for the High Note Sound Company
X2 (a)
60 –
| c | | |
0– 20 40 50 60 X1
Figure 7.19
7-87
Changes in the Electricians’ Time Resource
for the High Note Sound Company
X2 (b)
60 –
7-88
Changes in the Electricians’ Time Resource
for the High Note Sound Company
X2 (c)
40 –
Constraint
Representing
60 Hours of Audio
20 – Technician’s
Time Resource
| | | | | |
0– 20 40 60 80 100 120
X1
Figure 7.19
7-89
QM for Windows and Changes in
Right-Hand-Side Values
Sensitivity Analysis for High Note Sound Company
Using QM for Windows
Program 7.5B
7-90
Excel Solver and Changes in
Right-Hand-Side Values
Excel 2010 Sensitivity Analysis for High Note Sound Company
Program 7.6C
7-91