Linear Programming-Haitham
Linear Programming-Haitham
Linear
Programming
Fall 2020
Dr. Haitham
Learning Objectives
After completing this chapter, students will be able to:
1. Understand the basic assumptions and
properties of linear programming (LP).
2. Graphically solve any LP problem that has
only two variables by both the corner point
and isoprofit line methods.
3. Understand special issues in LP such as
infeasibility, unboundedness, redundancy,
and alternative optimal solutions.
4. Understand the role of sensitivity analysis.
5. Use Excel spreadsheets to solve LP
problems.
7.1 Introduction
7.2 Requirements of a Linear Programming
Problem
7.3 Formulating LP Problems
7.4 Graphical Solution to an LP Problem
7.5 Solving Flair Furniture’s LP Problem using
QM for Windows and Excel
7.6 Solving Minimization Problems
7.7 Four Special Cases in LP
7.8 Sensitivity Analysis
HOURS REQUIRED TO
PRODUCE 1 UNIT
(T) (C) AVAILABLE HOURS
DEPARTMENT TABLES CHAIRS THIS WEEK
Carpentry 4 3 240
Table 7.2
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
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-18
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.
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
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Number of Tables 7-21
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
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-22
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.
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
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Number of Tables 7-24
Graphical Representation of a
Constraint
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
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-26
Graphical Representation of a
Constraint
For the point (30, 20)
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
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-30
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, 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
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-31
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
Table 7.4
Table 7.5
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
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall
Pounds of Brand 1 7-39
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.
8–
–
6–
– Region Satisfying
4– Third Constraint
–
2–
–
0– | | | | | | | | | |
Figure 7.12 2 4 6 8 X1
Region Satisfying First Two Constraints
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-45
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.
X1 ≥ 5
15 –
X2 ≤ 10
10 –
Feasible Region
5–
X1 + 2X2 ≥ 15
| | | | |
Figure 7.13 0– 5 10 15 X1
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
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-49
Four Special Cases in LP
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
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-51
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, postoptimality
analysis, parametric programming, or optimality
analysis.
60 –
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
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-57
Changes in the
Technological Coefficients
60 – 60 – 60 –
Stereo Receivers
X2 (a)
60 –
| c | | |
0– 20 40 50 60 X1
Figure 7.19
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-63
Changes in the Electricians’ Time Resource
for the High Note Sound Company
X2 (b)
60 –
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
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
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall
Number of Tables 7-68
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
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall
Number of Tables 7-69
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
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall
Number of Tables 7-70
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.
Program 7.1A
Program 7.1B
Program 7.1C
Program 7.1D
Program 7.2A
Program 7.2B
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-81
Using Solver to Solve the Flair
Furniture Problem
Program 7.2C
Figure 7.2D
Figure 7.2E
Figure 7.2F
Figure 7.2G
Figure 7.2H
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
Program 7.4A
Program 7.4B
Program 7.5A
Program 7.5B
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-94
Excel Solver and Changes in
Objective Function Coefficients
Excel 2010 Spreadsheet for High Note Sound Company
Program 7.6A
Figure 7.6B
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-96
Excel Solver and Changes in
Objective Function Coefficients
Excel 2010 Sensitivity Report for High Note Sound
Company
Program 7.6C
Program 7.5B
Program 7.6C
Max (z) = 5 X1 + 8 X2
1 X1 + 2 X2 ≤ 6 …….(1) (constraint 1)
2 X1 + 1 X2 ≤ 8 …….(2) (constraint 2)
1 X1 ≥ 7 …….(3) (constraint 3)
Max (z) = 5 X1 + 8 X2
1 X1 + 1 X2 ≤ 1 …….(1) (constraint 1)
2 X1 + 1 X2 ≥ 3 …….(2) (constraint 2)
7-112
7-113
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-114
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-115
Managerial Report (Decision Statement)
(To provide the decision statement and to explain and provide
justification and providing managerial comments over our
decision.
Dried apricots cost $9/lb. (about 3 servings) and dried dates cost $8/lb. (about 4
servings). The company would like the box of bars to have at least the
recommended daily potassium intake of about 4700 mg, but would like to keep it
under twice the recommended daily intake. At least dried apricots should per
minimum 1000 mg and dried dates should per minimum 1000 mg of potassium
in the box.
In order to minimize cost, how many servings of each dried fruit should go into
the box of bars?
7-117
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-118
Managerial Report (Decision Statement)
MANAGERIAL REPORT
(Decision Statement with full explanation and justification of the answer)
Based on the outputs of the four Alternatives and to choose the best for the cost. I will choose
Second Alternative which suggest to in include dried apricots amount equal to (X1=11.5) while
not to include dried dates so its equal to (X2=0), in order to Minimize the Cost to be equal to
(z=$ 34.643)
X1,X2≥0
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-123
Question 4
Min (z) = 5000 X1 + 9000 X2
subject to
2X1 ≤ 16 - X2 ……(1)
5X1 ≤ 55 - 5X2 ……(2)
X1 + 2X2 ≥ 6 ……(3)
10X1 + 12X2 ≤ 180……(4)
4X1 ≥ 4 ……(5)
6X2 ≥ 6 ……(6)
X1,X2≥0
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall 7-124
Question 5
Max (z) = 3 X1 + 4 X2 profit
Subject to 2 X1 + 3 X2 ≤ 24 ……………. resource in constraint..(1)
3 X1 + 1 X2 ≤ 21 …………… resource in constraint..(2)
1 X 1 + 1 X2 ≤ 9 ………….. . resource in constraint..(3)
X1,X2≥0
X2
22
20 3X1 + x2 < 21
Find the 18
optimal
16
solution to
Maximize 14 X1 + X2 < 9
profit (with 12
all requested) 10
Optimal X1 = 3, X2 = 6, Z = 33
8
2X1 + 3X2 < 24
6
X1
2 4 Dr. Haitham
6 Alzubi
8 10 12 14 16 125
Question 6
Max (z) = 4 X1 + 5 X2 Profit
Subject to 1 X1 + 3 X2 ≤ 22 …………… resource in constraint..(1)
-1 X1 + 1 X2 ≤ 4 ……………resource in constraint..(2)
1 X2 ≤ 6 ……………resource in constraint..(3)
2 X1 - 5 X2 ≤ 0 …………....resource in constraint..(4)
X1,X2≥0
X
2
-X
1+X
2<4
1
0
Find the X
2<6
optimal
8 X
1+3
X2<2
2
solution to
Maximize
6
profit 2
X1-5
X2<0
(with all
4 O
ptim
alX
1=1
0,X2=4
above
Z=22
requested)
2
M
AXZ=4
X1+5
X2
X
1
2 4 6 8 1
0 1
2 1
4 1
6 1
8 2
0 2
2
Dr. Haitham Alzubi 126
Question 7
Show graphically why the following two linear programs do not have
optimal solutions …and explain the difference between the two…
(a) Max (z) = 2X1 + 6X2 (b) Max (z) = 3X1 + 4X2
s.t. 4X1 + 3X2 < 12 s.t. X 1 + X2 > 5
2X1 + X2 > 8 3X1 + X2 > 8
(a) (b)
X2 X2
10 10 3X1 + X2 > 8
2X1 + X2 > 8
8 8
6 6 X1 + X2 > 5
4X1 + 3X2 < 12
4 4
MAX 3X1 + 4X2
2 2
X1 X1
2 4 6 8 10 Dr. Haitham 2
Alzubi 4 6 8 10 127
Question 8
Find the 20
optimal 18 X2 < 15
solution to 16 A
Minimize 14
6
C B
4 X2 > 6
X1
2 4 Dr.6 Haitham
8 Alzubi
10 12 14 16 18 20 128
22
Question 9
Max (z) = 5 X1 + 7 X2
Subject to 2 X1 + 3 X2 ≤ 19 ……………. resource in constraint..(1)
1 X1 + 1 X2 ≤ 8 ……………..resource in constraint..(2)
1 X1 ≤ 6 ……………..resource in constraint..(3)
X1,X2≥0
X2
8
X1 + X2 < 8
Find the 7
MAX 5X1 + 7X2
optimal 6
solution to
X1 < 6
Maximize 5
X1
1 2 3 4 5
Dr. Haitham 6
Alzubi 7 8 9 10 129
Question 10