Upload
ashanti-borrell
View
235
Download
1
Tags:
Embed Size (px)
Citation preview
MT 235 1
Chapter 2
An Introduction to Linear Programming
MT 235 2
• Courtesy of NPR:
“The Mathematician Who Solved Major Problems”
http://www.npr.org/dmg/dmg.php?prgCode=WESAT&showDate=21-May-2005&segNum=14&
George Dantzig
MT 235 3
General Form of an LP Model
Maximize (or Minimize)
Subject to
c x c x c x
a x a x a x b
a x a x a x b
a x a x a x b
x x x
n n
n n
n n
m m mn n m
n
1 1 2 2
11 1 12 2 1 1
21 1 22 2 2 2
1 1 2 2
1 2 0
( , , )
( , , )
( , , )
, , ,
MT 235 4
General Form of an LP Model where the c’s, a’s and b’s are constants
determined from the problem and the x’s are the decision variables
MT 235 5
Components of Linear Programming
An objective Decision variables Constraints Parameters
MT 235 6
Assumptions of the LP Model Divisibility - basic units of x’s are divisible Proportionality - a’s and c’s are strictly
proportional to the x’s Additivity - each term in the objective
function and constraints contains only one variable
Deterministic - all c’s, a’s and b’s are known and measured without error
Non-Negativity (caveat)
MT 235 7
Sherwood Furniture CompanyRecently, Sherwood Furniture Company has been interested in developing a new line of stereo speaker cabinets. In the coming month, Sherwood expects to have excess capacity in its Assembly and Finishing departments and would like to experiment with two new models. One model is the Standard, a large, high-quality cabinet in a traditional design that can be sold in virtually unlimited quantities to several manufacturers of audio equipment. The other model is the Custom, a small, inexpensive cabinet in a novel design that a single buyer will purchase on an exclusive basis. Under the tentative terms of this agreement, the buyer will purchase as many Customs as Sherwood produces, up to 32 units. The Standard requires 4 hours in the Assembly Department and 8 hours in the Finishing Department, and each unit contributes $20 to profit. The Custom requires 3 hours in Assembly and 2 hours in Finishing, and each unit contributes $10 to profit. Current plans call for 120 hours to be available next month in Assembly and 160 hours in Finishing for cabinet production, and Sherwood desires to allocate this capacity in the most economical way.
MT 235 8
Sherwood Furniture Company – Linear Equations
21 1020 xx Maximize
Subject to12034 21 xx
16028 21 xx
322 x02,1 xx
MT 235 9
Sherwood Furniture Company – Graph Solution
0
10
20
30
40
50
60
70
80
90
0 5 10 15 20 25 30 35
x1
x2
MT 235 10
Sherwood Furniture Company – Graph Solution Constraint 1
Set
then
4 3 120
0 40
0 30
1 2
1 2
2 1
x x
x x
x x
MT 235 11
Sherwood Furniture Company – Graph Solution Constraint 1
0
10
20
30
40
50
60
70
80
90
0 5 10 15 20 25 30 35
x1
x2
MT 235 12
Sherwood Furniture Company – Graph Solution Constraint 2
Set
then
8 2 160
0 80
0 20
1 2
1 2
2 1
x x
x x
x x
MT 235 13
Sherwood Furniture Company – Graph Solution Constraint 1 & 2
0
10
20
30
40
50
60
70
80
90
0 5 10 15 20 25 30 35
x1
x2
MT 235 14
Sherwood Furniture Company – Graph Solution Constraint 3
32
Set
2 x
MT 235 15
Sherwood Furniture Company – Graph Solution Constraint 1, 2 & 3
0
10
20
30
40
50
60
70
80
90
0 5 10 15 20 25 30 35
x1
x2
MT 235 16
Sherwood Furniture Company – Graph Solution
Set
then
20 10 400
0 40
0 20
1 2
1 2
2 1
x x
x x
x x
MT 235 17
Sherwood Furniture Company – Graph Solution
0
10
20
30
40
50
60
70
80
90
0 5 10 15 20 25 30 35
x1
x2
MT 235 18
Sherwood Furniture Company – Solve Linear Equations
Set
4 3 120
8 2 160
1 2
1 2
x x
x x
MT 235 19
Sherwood Furniture Company – Solve Linear Equations
20
804
)16028(
)12034(2
Set
2
2
21
21
x
x
xx
xx
MT 235 20
Sherwood Furniture Company – Solve Linear Equations
500)20(10)15(20
function objectiveThen
15
120)20(34
1
1
x
x
MT 235 21
Sherwood Furniture Company – Graph Solution
0
10
20
30
40
50
60
70
80
90
0 5 10 15 20 25 30 35
x1
x2
Optimal Point(15, 20)
MT 235 22
Sherwood Furniture Company – Slack Calculation
20,15 21 xx
0
120 120
120 3(20) 4(15)
hours;assembly for slack calulateThen
slack
0
160 160
160 2(20) 8(15)
hours; finishingfor slack calculateThen
slack
12
32 20
Contract; Customfor slack calculateThen
slack
MT 235 23
Sherwood Furniture Company - Slack Variables
Max
20x1 + 10x2 + 0S1 + 0S2 + 0S3
s.t.
4x1 + 3x2 + 1S1 = 120
8x1 + 2x2 + 1S2 = 160
x2 + 1S3 = 32
x1, x2, S1 ,S2 ,S3 >= 0
MT 235 24
Sherwood Furniture Company – Graph Solution
0
10
20
30
40
50
60
70
80
90
0 5 10 15 20 25 30 35
x1
x2
2
3
1
MT 235 25
Sherwood Furniture Company – Slack Calculation Point 1
32
160
120
0
0
2
2
1
2
1
s
s
s
Then
x
x
If
Point 1
MT 235 26
Sherwood Furniture Company – Graph Solution
0
10
20
30
40
50
60
70
80
90
0 5 10 15 20 25 30 35
x1
x2
2
3
1
MT 235 27
Sherwood Furniture Company – Slack Calculation Point 2
12
0
40
0
20
2
2
1
2
1
s
s
s
Then
x
x
If
Point 2
MT 235 28
Sherwood Furniture Company – Graph Solution
0
10
20
30
40
50
60
70
80
90
0 5 10 15 20 25 30 35
x1
x2
2
3
1
MT 235 29
Sherwood Furniture Company – Slack Calculation Point 3
12
0
0
20
15
2
2
1
2
1
s
s
s
Then
x
x
If
Point 3
MT 235 30
Sherwood Furniture Company – Slack Calculation Points 1, 2 & 3
12
0
40
0
20
2
2
1
2
1
s
s
s
Then
x
x
If
12
0
0
20
15
2
2
1
2
1
s
s
s
Then
x
x
If
32
160
120
0
0
2
2
1
2
1
s
s
s
Then
x
x
If
Point 1 Point 2 Point 3
MT 235 31
Sherwood Furniture Company – Slack Variables
For each ≤ constraint the difference between the RHS and LHS (RHS-LHS). It is the amount of resource left over. Constraint 1; S1 = 0 hrs.
Constraint 2; S2 = 0 hrs.
Constraint 3; S3 = 12 Custom
MT 235 32
MT 235 33
MT 235 34
MT 235 35
MT 235 36
MT 235 37
MT 235 38
Pet Food CompanyA pet food company wants to find the optimal mix of ingredients, which will minimize the cost of a batch of food, subject to constraints on nutritional content. There are two ingredients, P1 and P2. P1 costs $5/lb. and P2 costs $8/lb. A batch of food must contain no more than 400 lbs. of P1 and must contain at least 200 lbs. of P2. A batch must contain a total of at least 500 lbs. What is the optimal (minimal cost) mix for a single batch of food?
MT 235 39
Pet Food Company – Linear Equations
21 8P 5P
Minimize,
To,Subject
40001 21 PP
20010 21 PP50011 21 PP
02,1 PP
MT 235 40
Pet Food Company – Graph Solution
0
100
200
300
400
500
600
0 100 200 300 400 500 600 700
P1
P2
MT 235 41
Pet Food Company – Graph Solution Constraint 1
400
then
4001
Set
1
1
P
P
MT 235 42
Pet Food Company – Graph Solution Constraint 1
0
100
200
300
400
500
600
0 100 200 300 400 500 600 700
P1
P2
MT 235 43
Pet Food Company – Graph Solution Constraint 2
200
then
2001
Set
2
2
P
P
MT 235 44
Pet Food Company – Graph Solution Constraint 1 & 2
0
100
200
300
400
500
600
0 100 200 300 400 500 600 700
P1
P2
MT 235 45
Pet Food Company – Graph Solution Constraint 3
50011
Set
21 PP
MT 235 46
Pet Food Company – Graph Solution Constraint 1, 2 & 3
0
100
200
300
400
500
600
0 100 200 300 400 500 600 700
P1
P2
MT 235 47
Pet Food Company – Solve Linear Equations
8000
5000
then
400085
Set
12
21
21
PP
PP
PP
MT 235 48
Pet Food Company – Graph Solution
0
100
200
300
400
500
600
0 100 200 300 400 500 600 700
P1
P2
MT 235 49
Pet Food Company – Solve Linear Equations
300
3001
500)200(11
50011
200
Set
1
1
1
21
2
P
P
P
Then
PP
P
MT 235 50
Pet Food Company – Solve Linear Equations
3100)200(8)300(5
85
function objectiveThen
200,300
21
21
PP
PP
MT 235 51
Pet Food Company – Graph Solution
0
100
200
300
400
500
600
0 100 200 300 400 500 600 700
P1
P2
Optimal Point(300, 200)
MT 235 52
Pet Food Company – Slack/ Surplus Calculation
200 P 300; P 2 1
100
400 300
;Pfor slack calculateThen 1
slack
0
200 200
;Pfor surplus calculateThen 2
surplus
0
500 200 300
Batch;for surplus calculateThen
surplus
MT 235 53
Pet Food Co. – Linear Equations Slack/ Surplus Variables
Min
5P1 + 8P2 + 0S1 + 0S2 + 0S3
s.t.
1P1 + 1S1 = 400
1P2 - 1S2 = 200
1P1 + 1P2 - 1S3 = 500
P1, P2, S1 ,S2 ,S3 >= 0
MT 235 54
Pet Food Co. – Slack Variables For each ≤ constraint the difference
between the RHS and LHS (RHS-LHS). It is the amount of resource left over. Constraint 1; S1 = 100 lbs.
MT 235 55
Pet Food Co. – Surplus Variables For each ≥ constraint the difference
between the LHS and RHS (LHS-RHS). It is the amount bt which a minimum requirement is exceeded. Constraint 2; S2 = 0 lbs.
Constraint 3; S3 = 0 lbs.
MT 235 56
MT 235 57
MT 235 58
MT 235 59
MT 235 60
MT 235 61
Special Cases Alternate Optimal Solutions No Feasible Solution Unbounded Solutions
MT 235 62
Alternate Optimal Solutions
0,
186
142
204
S.T.
24Min
21
21
21
21
21
xx
xx
xx
xx
xx
MT 235 63
Alternate Optimal Solutions
0
5
10
15
20
25
0 5 10 15 20
x1
x2
MT 235 64
Alternate Optimal Solutions
50
200
Then
204
Set
12
21
21
xx
xx
xx
MT 235 65
Alternate Optimal Solutions
0
5
10
15
20
25
0 5 10 15 20
x1
x2
MT 235 66
Alternate Optimal Solutions
70
140
Then
142
Set
12
21
21
xx
xx
xx
MT 235 67
Alternate Optimal Solutions
0
5
10
15
20
25
0 5 10 15 20
x1
x2
MT 235 68
Alternate Optimal Solutions
180
30
Then
186
Set
12
21
21
xx
xx
xx
MT 235 69
Alternate Optimal Solutions
0
5
10
15
20
25
0 5 10 15 20
x1
x2
MT 235 70
Alternate Optimal Solutions
100
200
Then
4024
Set
12
21
21
xx
xx
xx
MT 235 71
Alternate Optimal Solutions
0
5
10
15
20
25
0 5 10 15 20
x1
x2
A
B
MT 235 72
Alternate Optimal Solutions
28)8(2)3(4
Then
8 and 20=x+4(3)
3 and 62
)142(
204
SetA Point At
22
11
21
21
x
xx
xx
xx
MT 235 73
Alternate Optimal Solutions
28)2(2)6(4
Then
2 and 14)6(2
6 and 6611
)186(
)142(6
Set BPoint At
22
11
21
21
xx
xx
xx
xx
MT 235 74
MT 235 75
MT 235 76
MT 235 77
MT 235 78
MT 235 79
Special Cases Alternate Optimal Solutions No Feasible Solution Unbounded Solutions
MT 235 80
No Feasible Solution
0,
1243
22
S.T.
23Max
21
21
21
21
xx
xx
xx
xx
MT 235 81
No Feasible Solution
0
1
2
3
4
0 1 2 3 4 5
x1
x2
MT 235 82
No Feasible Solution
0
1
2
3
4
0 1 2 3 4 5
x1
x2
MT 235 83
MT 235 84
MT 235 85
MT 235 86
Special Cases Alternate Optimal Solutions No Feasible Solution Unbounded Solutions
MT 235 87
Unbounded Solutions
0,
402
10
S.T.
2Max
21
21
21
21
xx
xx
xx
xx
MT 235 88
Unbounded Solutions
-50
-40
-30
-20
-10
0
10
20
30
40
50
0 5 10 15 20 25
x1
x2
MT 235 89
Unbounded Solutions
200
100
Then
202
Set
12
21
21
xx
xx
xx
MT 235 90
Unbounded Solutions
-50
-40
-30
-20
-10
0
10
20
30
40
50
0 5 10 15 20 25
x1
x2
MT 235 91
MT 235 92
MT 235 93
MT 235 94
MT 235 95