MT 2351 Chapter 2 An Introduction to Linear Programming.

95
MT 235 1 Chapter 2 An Introduction to Linear Programming

Transcript of MT 2351 Chapter 2 An Introduction to Linear Programming.

Page 1: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 1

Chapter 2

An Introduction to Linear Programming

Page 2: MT 2351 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

Page 3: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

( , , )

( , , )

( , , )

, , ,

Page 4: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 5: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 5

Components of Linear Programming

An objective Decision variables Constraints Parameters

Page 6: MT 2351 Chapter 2 An Introduction to Linear Programming.

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)

Page 7: MT 2351 Chapter 2 An Introduction to Linear Programming.

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.

Page 8: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 8

Sherwood Furniture Company – Linear Equations

21 1020 xx Maximize

Subject to12034 21 xx

16028 21 xx

322 x02,1 xx

Page 9: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 10: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 11: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 12: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 13: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 14: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 14

Sherwood Furniture Company – Graph Solution Constraint 3

32

Set

2 x

Page 15: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 16: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 17: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 18: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 18

Sherwood Furniture Company – Solve Linear Equations

Set

4 3 120

8 2 160

1 2

1 2

x x

x x

Page 19: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 19

Sherwood Furniture Company – Solve Linear Equations

20

804

)16028(

)12034(2

Set

2

2

21

21

x

x

xx

xx

Page 20: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 20

Sherwood Furniture Company – Solve Linear Equations

500)20(10)15(20

function objectiveThen

15

120)20(34

1

1

x

x

Page 21: MT 2351 Chapter 2 An Introduction to Linear Programming.

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)

Page 22: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 23: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 24: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 25: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 26: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 27: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 28: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 29: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 30: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 31: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 32: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 32

Page 33: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 33

Page 34: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 34

Page 35: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 35

Page 36: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 36

Page 37: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 37

Page 38: MT 2351 Chapter 2 An Introduction to Linear Programming.

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?

Page 39: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 40: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 41: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 41

Pet Food Company – Graph Solution Constraint 1

400

then

4001

Set

1

1

P

P

Page 42: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 43: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 43

Pet Food Company – Graph Solution Constraint 2

200

then

2001

Set

2

2

P

P

Page 44: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 45: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 45

Pet Food Company – Graph Solution Constraint 3

50011

Set

21 PP

Page 46: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 47: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 47

Pet Food Company – Solve Linear Equations

8000

5000

then

400085

Set

12

21

21

PP

PP

PP

Page 48: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 49: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 50: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 50

Pet Food Company – Solve Linear Equations

3100)200(8)300(5

85

function objectiveThen

200,300

21

21

PP

PP

Page 51: MT 2351 Chapter 2 An Introduction to Linear Programming.

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)

Page 52: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 53: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 54: MT 2351 Chapter 2 An Introduction to Linear Programming.

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.

Page 55: MT 2351 Chapter 2 An Introduction to Linear Programming.

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.

Page 56: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 56

Page 57: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 57

Page 58: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 58

Page 59: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 59

Page 60: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 60

Page 61: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 61

Special Cases Alternate Optimal Solutions No Feasible Solution Unbounded Solutions

Page 62: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 62

Alternate Optimal Solutions

0,

186

142

204

S.T.

24Min

21

21

21

21

21

xx

xx

xx

xx

xx

Page 63: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 63

Alternate Optimal Solutions

0

5

10

15

20

25

0 5 10 15 20

x1

x2

Page 64: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 64

Alternate Optimal Solutions

50

200

Then

204

Set

12

21

21

xx

xx

xx

Page 65: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 65

Alternate Optimal Solutions

0

5

10

15

20

25

0 5 10 15 20

x1

x2

Page 66: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 66

Alternate Optimal Solutions

70

140

Then

142

Set

12

21

21

xx

xx

xx

Page 67: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 67

Alternate Optimal Solutions

0

5

10

15

20

25

0 5 10 15 20

x1

x2

Page 68: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 68

Alternate Optimal Solutions

180

30

Then

186

Set

12

21

21

xx

xx

xx

Page 69: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 69

Alternate Optimal Solutions

0

5

10

15

20

25

0 5 10 15 20

x1

x2

Page 70: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 70

Alternate Optimal Solutions

100

200

Then

4024

Set

12

21

21

xx

xx

xx

Page 71: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 71

Alternate Optimal Solutions

0

5

10

15

20

25

0 5 10 15 20

x1

x2

A

B

Page 72: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 73: MT 2351 Chapter 2 An Introduction to Linear Programming.

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

Page 74: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 74

Page 75: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 75

Page 76: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 76

Page 77: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 77

Page 78: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 78

Page 79: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 79

Special Cases Alternate Optimal Solutions No Feasible Solution Unbounded Solutions

Page 80: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 80

No Feasible Solution

0,

1243

22

S.T.

23Max

21

21

21

21

xx

xx

xx

xx

Page 81: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 81

No Feasible Solution

0

1

2

3

4

0 1 2 3 4 5

x1

x2

Page 82: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 82

No Feasible Solution

0

1

2

3

4

0 1 2 3 4 5

x1

x2

Page 83: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 83

Page 84: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 84

Page 85: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 85

Page 86: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 86

Special Cases Alternate Optimal Solutions No Feasible Solution Unbounded Solutions

Page 87: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 87

Unbounded Solutions

0,

402

10

S.T.

2Max

21

21

21

21

xx

xx

xx

xx

Page 88: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 88

Unbounded Solutions

-50

-40

-30

-20

-10

0

10

20

30

40

50

0 5 10 15 20 25

x1

x2

Page 89: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 89

Unbounded Solutions

200

100

Then

202

Set

12

21

21

xx

xx

xx

Page 90: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 90

Unbounded Solutions

-50

-40

-30

-20

-10

0

10

20

30

40

50

0 5 10 15 20 25

x1

x2

Page 91: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 91

Page 92: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 92

Page 93: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 93

Page 94: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 94

Page 95: MT 2351 Chapter 2 An Introduction to Linear Programming.

MT 235 95