C2 Linear Programing or
C2 Linear Programing or
Linear programing
1
Chapter outline
q Introduction
q Requirements of a Linear Programming Problem
q LP Properties and Assumptions
q Formulating LP Problems
q Graphical Solution to an LP Problem
q Solving Maximization Problems
q Four Special Cases in LP
q Sensitivity Analysis
2
Requirements of a Linear
Programming Problem
n 4 properties :
1. maximize / minimize (the objective function).
2. Restrictions / constraints
3. There must be alternative courses of action from which to
choose.
4. The objective and constraints : linear equations /inequalities.
Copyright ©
2012 Pearson
Education
7-5
Flair Furniture Company
n The Flair Furniture Company produces
inexpensive tables and chairs.
n Processes are similar in that both require a certain amount of
hours of carpentry work and in the painting and varnishing
department.
n Each table takes 4 hours of carpentry and 2 hours of painting
and varnishing.
n Each chair requires 3 of carpentry and 1 hour of painting and
varnishing.
n 240 hours of carpentry time available and 100 hours of painting
and varnishing.
n Each table yields a profit of $70 and each chair a profit of $50.
AVAILABLE HOURS
DEPARTMENT (T) TABLES (C) CHAIRS THIS WEEK
Carpentry 4 3 240
Painting and
2 1 100
varnishing
Profit per unit $70 $50
8
Flair Furniture Company
n Objective:
n Maximize profit
n Constraints= subject to
n The hours of carpentry time used cannot exceed 240 hours
per week.
n The hours of painting and varnishing time used cannot exceed
100 hours per week.
n Decision variables:
n T = number of tables to be produced per week.
n C = number of chairs to be produced per week
• WYNDOR GLASS CO problem: Determine what the production rates should be for
the two products in order to maximize their total profit
12
Example:
• The objective function is
Maximize profit Z = $3000x1 + $5000x2
Subject to the restrictions:
x1 £4
2x2 £12
3x1 + 2x2 £ 18
x1 ³0
x2 ³0.
13
EX:
q The owner of Crackers, Inc. produces both Deluxe (D) and
Classic (C) crackers. She only has 4,800 ounces of sugar,
9,600 ounces of flour, and 2,000 ounces of salt for her next
production run. A box of Deluxe crackers requires 2 ounces
of sugar, 6 ounces of flour, and 1 ounce of salt to produce. A
box of Classic crackers requires 3 ounces of sugar, 8 ounces
of flour, and 2 ounces of salt to produce. Profits are 40 cents
for a box of Deluxe crackers and 50 cents for a box of Classic
crackers.
D C
15
q Objective: maximize profit = 40D + 50C
Subject to:
2D + 3C <= 4,800
6D + 8C <= 9,600
D + 2C <= 2,000
D, C >=0
16
EX
q An electronics firm produces two models of pocket
calculators: the A-100 (A) and the B-200 (B). Each model uses
one circuit board, of which there are only 2,500 available for
this week’s production. In addition, the company has
allocated a maximum of 800 hours of assembly time this
week for producing these calculators. Each A-100 requires 15
minutes to produce while each B-200 requires 30 minutes to
produce. The firm forecasts that it could sell a maximum of
4,000 of the A-100s this week and a maximum of 1,000 B-
200s. Profits for the A-100 are $1.00 each and profits for the
B-200 are $4.00 each.
17
q Objective: maximize profit = A + 4B
Subjective:
A + B <= 2,500
0.25A + 0.5B <= 800
A <= 4000
B <= 1000
A, B >= 0
18
Graphical Method
n Solve LP problem with two decision variables.
n If more than two variables: simplex method.
n Two graphical methods:
n Isoprofit Line (watch video 1)
n Corner points (watch video 2)
100 –
– This Axis Represents the Constraint T ≥ 0
80 –
Number of Chairs
–
60 –
–
40 – This Axis Represents the
– Constraint C ≥ 0
20 –
–
|– | | | | | | | | | | |
Figure 7.1 0 20 40 60 80 100 T
Copyright © Number of Tables
2012 Pearson 7-20
Graphical Representation of a Constraint
100 –
–
80 – (T = 0, C = 80)
Number of Chairs
–
60 –
–
40 –
–
(T = 60, C = 0)
20 –
–
|– | | | | | | | | | | |
Figure 7.2
0 20 40 60 80 100 T
Copyright ©
2012 Pearson 7-22
Number of Tables
Graphical Representation of a Constraint
Region that Satisfies the Carpentry Constraint
C
n Any point on or below
100 – the constraint plot will
– not violate the
Number of Chairs 80 – restriction.
– n 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
Copyright © Number of Tables
2012 Pearson 7-23
Graphical Representation of a Constraint
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 7-25
Number of Tables
Graphical Representation of a Constraint
Feasible Solution Region for the Flair
Furniture Company Problem Maximize profit = $70T + $50C
C subject to:
4T + 3C ≤ 240 (carpentry constraint)
100 – 2T + 1C ≤ 100 (painting and varnishi
– T, C ≥ 0 (nonnegativity
Number of Chairs 80 – Painting/Varnishing Constraint
–
60 –
–
40 –
–
Carpentry Constraint
20 – Feasible
– Region
|– | | | | | | | | | | |
Figure 7.5
0 20 40 60 80 100 T
Copyright © Number of Tables
2012 Pearson 7-26
Graphical Representation of a Constraint
q For the point (30, 20)
Carpentry 4T + 3C ≤ 240 hours available
constraint (4)(30) + (3)(20) = 180 hours used ü
Painting 2T + 1C ≤ 100 hours available
constraint (2)(30) + (1)(20) = 80 hours used
ü
Copyright ©
2012 Pearson 7-28
Isoprofit Line Solution Method
Copyright ©
2012 Pearson 7-29
Isoprofit Line Solution Method
q For Flair Furniture, choose a profit of $2,100.
q The objective function is then
§ $2,100 = 70T + 50C
q The further we move from the origin, the larger
the profit will be.
q The highest profit ($4,100) will be generated
when the isoprofit line passes through the point
(30, 40).
Copyright ©
2012 Pearson 7-30
Isoprofit Line Solution Method
Profit line of $2,100 Plotted for the Flair
C
Furniture Company
100 –
–
$3,500 = $70T + $50C
80 –
Number of Chairs
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 © Number of Tables
2012 Pearson 7-33
Corner Point Solution Method
q The profit at every corner point of the feasible
region.
q The optimal solution must lie at one of the corner
points, or extreme point, in the feasible region.
q (Watch video)
100 –
2 –
Number of Chairs 80 –
–
60 –
–
3
40 –
–
20 –
–
1 |– | | | | | | | | | | |
Figure 7.9 0 20 40 60 80 100
4 T
Number of Tables
Copyright © 2012 Pearson Education 7-35
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
Copyright ©
2012 Pearson 7-36
Slack and Surplus
q Slack
§ the amount of a resource that is not used.
§ For a less-than-or-equal constraint
§ Slack = Amount of resource available – amount of resource
used.
q Surplus
§ greater-than-or-equal constraint to indicate the amount by
which the right hand side of the constraint is exceeded.
§ Surplus = Actual amount – minimum amount.
Copyright ©
2012 Pearson 7-37
Summary of Graphical Solution Methods
ISOPROFIT METHOD
1. Graph all constraints and find the feasible region.
2. Select a specific profit (or cost) line and graph it to find the slope.
3. Move the objective function line in the direction of increasing profit (or
decreasing cost) while maintaining the slope. The last point it touches in the
feasible region is the optimal solution.
4. Find the values of the decision variables at this last point and compute the
profit (or cost).
CORNER POINT METHOD
1. Graph all constraints and find the feasible region.
2. Find the corner points of the feasible reason.
3. Compute the profit (or cost) at each of the feasible corner points.
4. Select the corner point with the best value of the objective function found in
Step 3. This is the optimal solution.
Copyright ©
2012 Pearson 7-38
Using Excel’s Solver
q The Solver tool in Excel can be used to find
solutions to:
§ LP problems.
§ Integer programming problems.
§ Noninteger programming problems.
q Limited to 200 variables and 100 constraints.
Table 7.5
Copyright ©
2012 Pearson 7-42
Holiday Meal Turkey Ranch
Copyright ©
2012 Pearson 7-43
Feasible Region for the Holiday Meal Turkey Ranch
Problem Minimize cost (in cents) = 2X 1 +3
subject to:
X2 5X1 + 10X2 >=≥ 90 ounces
–
4X1 + 3X2 =>≥ 48 ounces
0.5X1 =>≥ 1.5 ounces
20 –
Ingredient C Constraint X1 >= ≥ 0 (no
Pounds of Brand 2 X2 >=≥ 0 (no
15 –
Feasible Region
a
10 –
Ingredient B Constraint
5–
b Ingredient A Constraint
Figure 7.10
0 |– | | | c | |
5 10 15 20 25 X1
Pounds of Brand 1
Copyright © 2012 Pearson Education 7-44
Holiday Meal Turkey Ranch
Copyright ©
2012 Pearson 7-46
Holiday Meal Turkey Ranch
• Using the Iso-cost Approach
Minimize cost (in cents) = 2X1 + 3
X2
– subject to:
Feasible Region 5X1 + 10X2 >=≥ 90 ounces
4X1 + 3X2 =>≥ 48 ounces
20 – 0.5X1 =>≥ 1.5 ounces
X1 >= ≥ 0 (no
Pounds of Brand 2
15 – 54 X2 >=≥ 0 (no
¢=
Di 2X
re 1 +
cti 3X
10 – ono 2 Is
31 f De oc
.2¢ cr os
=2 ea tL
s i ine
5– X ngC
1 +
3X os
2 t
Figure 7.11 (X1 = 8.4, X2 = 4.8)
0–| | | | | |
Copyright ©
5 10 15 20 25 X1
2012 Pearson 7-47 Pounds of Brand 1
Four Special Cases in LP
q No feasible solution
q Unboundedness
q Redundancy
q Alternate (Multiple) Optimal Solutions (watch
video)
Copyright ©
2012 Pearson 7-48
Four Special Cases in LP
q No feasible solution
§ 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.
Copyright ©
2012 Pearson 7-49
Four Special Cases in LP
8–
–
6–
–
Region Satisfying
4– Third Constraint
–
2–
–
0– | | | | | | | | | |
Figure 7.12 2 4 6 8 X1
Unboundedness
§ Have no a finite solution.
§ In a maximization problem, one or more solution
variables, and the profit, can be made infinitely
large without violating any constraints.
§ The feasible region will be open ended.
§ The problem has been formulated improperly.
Copyright ©
2012 Pearson 7-51
Four Special Cases in LP
X1 ≥ 5
15 –
X2 ≤ 10
10 –
Feasible Region
5–
X1 + 2X2 ≥ 15
0 |– | | | |
Figure 7.13 5 10 15 X1
Copyright ©
2012 Pearson 7-52
Four Special Cases in LP
q 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.
Copyright ©
2012 Pearson 7-53
Four Special Cases in LP
Problem
X2 with a Redundant Constraint
30 –
25 –
2X1 + X2 ≤ 30
20 –
Redundant
Constraint
15 –
X1 ≤ 25
10 –
X1 + X2 ≤ 20
Feasible
5– Region
0– | | | | | |
5 10 15 20 25 30 X1
Copyright ©
2012 Pearson 7-54
Four Special Cases in LP
Copyright ©
2012 Pearson 7-55
Four Special Cases in LP
Example
X2 of Alternate Optimal Solutions
8–
7–
6 –A
Optimal Solution Consists of All
5– Combinations of X1 and X2 Along
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 7-56
Sensitivity Analysis
Copyright ©
2012 Pearson 7-57
Sensitivity Analysis
q Sensitivity analysis often involves a series of
what-if? questions concerning constraints,
variable coefficients, and the objective function.
q The trial-and-error method where values are
changed and the entire model is resolved.
q The preferred way is to use an analytic
postoptimality analysis.
q 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.
Copyright ©
2012 Pearson 7-58
High Note Sound Company
q The High Note Sound Company manufactures
quality CD players and stereo receivers.
q Products require a certain amount of skilled
artisanship which is in limited supply.
q The firm has formulated the following product mix
LP model.
Maximize profit = $50X1 + $120X2
Subject to 2X1 + 4X2 ≤ 80 (hours of electrician’s
time available)
3X1 + 1X2 ≤ 60 (hours of audio
technician’s time
available)
X1 , X2 ≥ 0
Copyright ©
2012 Pearson 7-59
High Note Sound Company
The High Note Sound Company Graphical Solution
X2
(receivers)
60 –
0– | | | | | |
10 20 30 40 50 60 X1
c = (20, 0) (CD players)
Copyright ©
2012 Pearson 7-60
Changes in the
Objective Function Coefficient
0– | | c | | | |
10 20 30 40 50 60 X1
Copyright ©
2012 Pearson 7-62
Changes in the
Technological Coefficients
Copyright ©
2012 Pearson 7-63
Changes in Resources or Right-Hand-Side
Values
Copyright ©
2012 Pearson 7-65
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) 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.
Copyright ©
2012 Pearson 7-66
EX: Changes in the Electricians’ Time
Resource for the High Note Sound Company
(a) Original Problem
X2 (a) X2
60 – 60 –
Stereo Receivers
3X1 + 1X2 ≤ b1
40 –
Optimal
40 – Solution
Constraint Representing 60 Hours of 20 –a
Audio Technician’s Time Resource b 2X1 + 4X2 ≤ b2
a c
25 – – | | |
20 – b Changed Constraint Representing 100 Hours 0 20 40 X1
of Electrician’s Time Resource CD Players
– | c | | |
?≤ b1 ≤? ?≤ b2 ≤?
0 20 40 50 60 X1
Optimal Solution
Z=2400
Copyright ©
2012 Pearson 7-67
EX: Changes in the Electricians’ Time
Resource for the High Note Sound Company
X2 (b)
X2 (c)
60 –
60 – Changed Constraint
Representing 240 Hours
of Electrician’s Time
40 – Resource
Constraint Representing 60 Hours of
Audio Technician’s Time Resource 40 –
Copyright ©
2012 Pearson 7-69
Changes in Resources or Right-Hand-Side
Values
q Sensitivity analysis:
q Find sensitive parameters those
70
EX: Changes in Resources or Right-Hand-
Side Values
Shadow price:
x2
q The objective function is
§ Maximize profit Z = $3x1 + $5x2
9 3x1 2 x2 18
q Subject to : Z 36 3x1 5 x2
8
§ x1 £ 4+1 : 0 7
*4.8+ 2 x2 12
0 1 2 3 4 5 6 7 x1
Pwo dgt qhdcvej gu qhr tqf wev71
3
EX: Changes in Resources or Right-Hand-
Side Values
Shadow price:
q On constraint 3:
72
EX: Changes in Resources or Right-Hand-
Side Values
Shadow price:
q On constraint 2:
§ If we increase RHS by 1: 2X2 £ 13,
§ X1= 5/3 , X2 =13/2, Z2= 37.5
q On constrain 1:
9 3x1 2 x2 18
§ X1 £ 4+1 : Z3= 36 8
§ The net change in profit = 0 Z 36 3 x1 5 x2
7
*4.8+ 2 x2 12
0 1 2 3 4 5 6 7 x1
Pwo dgt qhdcvej gu qhr tqf wev 3
Tuesday,
September 09, 74
EX: Changes in Resources or Right-Hand-
Side Values
Shadow price:
q Constraint 2, 3: binding constraint
§ (shadow price > 0)
q Constraint 1: not binding constraint
§ (shadow price =0)
75
For reference:
q How to solve graphical method by excel solver
and QM for window
76
Using Solver to Solve the Flair Furniture Problem
Program 7.2A
Program 7.2B
Program 7.2C
If Solver does not appear in the indicated place, see Appendix F for instructions on how to
activate this add-in.
Figure 7.2D
Figure 7.2E
Figure 7.2F
Figure 7.2G
Figure 7.2H
Program 7.3
Copyright ©
2012 Pearson 7-87
Holiday Meal Turkey Ranch
Excel 2010 Spreadsheet for the Holiday Meal Turkey
Ranch problem
Program 7.4A
Copyright ©
2012 Pearson 7-88
Holiday Meal Turkey Ranch
Excel 2010 Solution to the Holiday Meal Turkey
Ranch Problem
Program 7.4B
Copyright ©
2012 Pearson 7-89