C2 - Linear Programing
C2 - Linear Programing
Linear programing
1
Chapter outline
Introduction
Requirements of a Linear Programming Problem
LP Properties and Assumptions
Formulating LP Problems
Graphical Solution to an LP Problem
Solving Maximization Problems
Four Special Cases in LP
Sensitivity Analysis
2
Requirements of a Linear
Programming Problem
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.
Objective: Maximize profit Z = $70T + $50C
Restrictions/ subject to:
4T + 3C ≤ 240 (carpentry constraint)
2T + 1C ≤ 100 (painting and varnishing constraint)
T, C ≥ 0 (nonnegativity constraint)
Copyright ©
2012 Pearson
Education
7-5
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.
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.
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
Objective:
Maximize profit
Constraints= subject to
The hours of carpentry time used cannot exceed 240 hours
per week.
The hours of painting and varnishing time used cannot exceed
100 hours per week.
Decision variables:
T = number of tables to be produced per week.
C = number of chairs to be produced per week
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:
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
Objective: maximize profit = 40D + 50C
Subject to:
2D + 3C <= 4,800
6D + 8C <= 9,600
D + 2C <= 2,000
D, C >=0
16
EX
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
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
Solve LP problem with two decision variables.
If more than two variables: simplex method.
Two graphical methods:
Isoprofit Line (watch video 1)
Corner points (watch video 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 7-20
Graphical Representation of a Constraint
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
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
100 –
$2,800 = $70T + $50C
C= -70/50T + 2800/ 50
–
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
Copyright © 2012 Pearson Education 7-31
Isoprofit Line Solution Method
Four Isoprofit Lines Plotted for the Flair
Furniture Company
C
100 –
–
Number of Chairs $3,500 = $70T + $50C
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
Copyright © 2012 Pearson Education 7-32
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
Copyright © 2012 Pearson Education 7-33
Corner Point Solution Method
The profit at every corner point of the feasible
region.
The optimal solution must lie at one of the corner
points, or extreme point, in the feasible region.
(Watch video)
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 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
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
Copyright © 2012 Pearson Education 7-44
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.
Copyright © 2012 Pearson Education 7-45
Holiday Meal Turkey Ranch
Substituting these value back into the objective
function we find
X1 >= ≥ 0 (nonne
54
15 –
=2 ¢ X2 >=≥ 0 (nonne
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
8–
–
6–
– Region Satisfying
4– Third Constraint
–
2–
–
0– | | | | | | | | | |
Figure 7.12 2 4 6 8 X1
Region Satisfying First Two Constraints
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.
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
5– Region
| | | | | |
0–
5 10 15 20 25 30 X1
Copyright © 2012 Pearson Education 7-54
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 7-56
Sensitivity Analysis
60 –
c
| | | | | |
0– 10 20 30 40 50 60 X1
60 – 60 – 60 –
Stereo Receivers
60 –
60 –
Stereo Receivers
3X1 + 1X2 ≤ b1
40 –
Optimal
Constraint Representing 60 Hours of a Solution
40 –
Audio Technician’s Time Resource 20 – b 2X1 + 4X2 ≤ b2
a c
25 – | | |
b Changed Constraint Representing 100 Hours 0– 20 40 X1
20 – of Electrician’s Time Resource CD Players
| c | | | ?≤ b1?≤
≤?b2 ≤?
0– 20 40 50 60 X1
Optimal Solution
Z=2400
Copyright © 2012 Pearson Education 7-67
EX: Changes in the Electricians’ Time
Resource for the High Note Sound Company
X2 (b)
X2 (c)
60 –
Changed Constraint
60 – Representing 240 Hours
of Electrician’s Time
Resource
40 – Constraint Representing 60 Hours of
Audio Technician’s Time Resource
40 –
70
EX: Changes in Resources or Right-Hand-
Side Values
Shadow price:
The objective function is x2
Maximize profit Z = $3x1 + $5x2
Subject to : 9 3 x1 2 x2 18
8
x1 4+1 : 0 Z 36 3 x1 5 x2
7
(2,6) 2 x2 12
12+1 : 1.5
0 1 2 3 4 5 6 7 x1
Number of batches of product71
1
EX: Changes in Resources or Right-Hand-
Side Values
Shadow price:
On constraint 3:
If we increase RHS by 1: 3X1 + 2X2 18+1
The new optimal solution is: X1= 7/3 , X2 =6 and the
new Z1 = 37 .
The net change in profit = Z1- Z= 37-36 = $1.
This is called shadow price (marginal value or dual
price) associated with constraint 3.
72
EX: Changes in Resources or Right-Hand-
Side Values
Shadow price:
On constraint 2:
If we increase RHS by 1: 2X2 13,
X1= 5/3 , X2 =13/2, Z2= 37.5
73
EX: Changes in Resources or Right-Hand-
Side Values
Shadow price: x2
On constrain 1:
X1 4+1 : Z3= 36 9 3 x1 2 x2 18
The net change in profit = 0 Z 36 3x1 5 x2 8
7
Shadow price = 0 (2,6) 2 x2 12
0 1 2 3 4 5 6 7 x1
Number of batches of product 1
Tuesday,
September 09, 74
EX: Changes in Resources or Right-Hand-
Side Values
Shadow price:
Constraint 2, 3: binding constraint
(shadow price > 0)
Constraint 1: not binding constraint
(shadow price =0)
75
For reference:
How to solve graphical method by excel solver
and QM for window
76