ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

64
ENGM 631 Optimization Ch. 3: Introduction to Linear Programming

Transcript of ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Page 1: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

ENGM 631 Optimization

Ch. 3: Introduction to Linear Programming

Page 2: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.1Alt. Prototype• K-Corp manufactures two primary products: a

small tractor suitable for an orchard and a tree shaker. K-Corp can make $3,000 per tractor and $5,000 per shaker. Currently, the demand for tractors is 8,000 per year and the demand for shakers is 6,000 per year. Currently, K-Corp is unable to meet total demand for both due to limitations in the assembly area. The assembly area has a capacity of 36,000 hours available. Each tractor takes 3 hours to assemble. Each shaker takes 4 hours.

Page 3: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.1Alt. Prototype

• Problem

Determine the appropriate number of tractors and shakers to make so as to maximize total profit.

• ConstraintsDo not exceed demand for either product

Do not exceed capacity of assembly area

Page 4: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.1Alt. Model

• VariablesX1 = number of tractors to manufacture

X2 = number of shakers to manufacture

• ProfitZ = 3X1 + 5X2 (in $1,000’s)

Page 5: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.1Alt. Model• Constraints

Demand for tractors

X1 < 8,000

Demand for shakers

X2 < 6,000

Capacity of Assembly

3X1 + 4X2 < 36,000

Non-negativity

X1 > 0 , X2 > 0

Page 6: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.1Alt. Model

Max Z = 3X1 + 5X2

s.t.

X1 < 8,000

X2 < 6,000

3X1 + 4X2 < 36,000

X1 > 0

X2 > 0

Page 7: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.1Alt. Rescale

• Let’s letX1 = number of tractors in 1,000’s

X2 = number of shakers in 1,000’s

Page 8: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.1Alt. ModelMax Z = 3X1 + 5X2

s.t.

X1 < 8

X2 < 6

3X1 + 4X2 < 36

X1 > 0

X2 > 0

where Z = profit (in $1,000,000’s)

Page 9: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.1Alt. Graphical Technique

2 4 6 8 10

8

6

4

2

Do not exceeddemand for tractors

X1 < 8

Page 10: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.1Alt. Graphical Technique

2 4 6 8 10

8

6

4

2

Do not exceeddemand for tractors, shakers

X2 < 6

X1 < 8

Page 11: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.1Alt. Graphical Technique

2 4 6 8 10 12

8

6

4

2

Do not exceeddemand for tractors, shakers, assembly capacity

3X1 + 4X2 < 36

X2 < 6

X1 < 8

Page 12: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.1Alt. Graphical Technique

2 4 6 8 10 12

8

6

4

2

Do not exceeddemand for tractors, shakers, assembly capacity,can’t make less thanzero

3X1 + 4X2 < 36

X2 < 6

X1 < 8

X1, X2 > 0

Page 13: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.1Alt. Feasible Region

2 4 6 8 10 12

8

6

4

2

3X1 + 4X2 < 36

X2 < 6

X1 < 8

X1, X2 > 0

Feasible Region

Page 14: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.1Alt. Problem

Out of the large (infinite)number of solutions available, which maximizesprofit?

2 4 6 8 10 12

8

6

4

2

Page 15: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.1Alt. Iso-Value Lines

2 4 6 8 10 12

8

6

4

2

Z = 3X1 + 5X2

Z = 15

Page 16: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.1Alt. Optimal Solution

2 4 6 8 10 12

8

6

4

2

Z = 3X1 + 5X2

= 3(4) + 5(6) = 42

(4,6)

Page 17: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.2 Some Terminology

2 4 6 8 10 12

8

6

4

2

FeasibleSolutions

Page 18: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.2 Some Terminology

2 4 6 8 10 12

8

6

4

2

Feasible Region

Page 19: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.2 Some Terminology

2 4 6 8 10 12

8

6

4

2

Boundary

Page 20: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Some Terminology

2 4 6 8 10 12

8

6

4

2

InfeasibleSolutions

Page 21: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.2 Aside

2 4 6 8 10 12

8

6

4

2

X1 < 8

X2 < 6

3X1 + 4X2 < 36 5X1 + 3X2 > 60

No Feasible Solutions

Page 22: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.2 Some Terminology

2 4 6 8 10 12

8

6

4

2

Corner PointFeasible Sol.(CPF)(0,6) (4,6)

(8,3)

(8,0)

(0,0)

Page 23: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.2 Relation: CPF & Optimal

2 4 6 8 10 12

8

6

4

2

(0,6) (4,6)

(8,3)

(8,0)

(0,0)

The best CPF solutionmust be an optimal solution.

Page 24: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.2 Relation: CPF & Optimal

2 4 6 8 10 12

8

6

4

2

(0,6) (4,6)

(8,3)

(8,0)

(0,0)

Z = 30 Z = 42

Z = 39

Z = 24Z = 0

The best CPF solutionmust be an optimal solution.

If a problem has multiple optimal solutions, at least twomust be CPF solutions.

Page 25: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.2 Relation: CPF & Optimal

2 4 6 8 10 12

8

6

4

2

(0,6) (4,6)

(8,3)

(8,0)

(0,0)

If a problem has multiple optimal solutions, at least twomust be CPF solutions.

Page 26: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.2 Optimal Solution

2 4 6 8 10 12

8

6

4

2

Recall,

Z = 3X1 + 5X2

(4,6)

3X1 + 4X2 < 36

Page 27: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.2 Optimal Solution

2 4 6 8 10 12

8

6

4

2

Suppose,

Z = 3X1 + 54X2

(4,6)

3X1 + 4X2 < 36

Page 28: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.2 Optimal Solution

2 4 6 8 10 12

8

6

4

2

Suppose,

Z = 3X1 + 54X2

(4,6)

3X1 + 4X2 < 36

Page 29: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.2 Optimal Solution

2 4 6 8 10 12

8

6

4

2

Suppose,

Z = 3X1 + 54X2

(4,6)

3X1 + 4X2 < 36

Multiple Optima

Page 30: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Standard Form for LP

Max Z c X c X c X

s t

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 20 0 0

. . .

. .

. . .

. . .

. . .

, , . . . ,

Page 31: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.2 Standard Form for LP

Max Z c X c X c X

s t

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 20 0 0

. . .

. .

. . .

. . .

. . .

, , . . . ,

DecisionVariables

Page 32: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.2 Standard Form for LP

Max Z c X c X c X

s t

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 20 0 0

. . .

. .

. . .

. . .

. . .

, , . . . ,

Objective

Page 33: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.2 Standard Form for LP

Max Z c X c X c X

s t

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 20 0 0

. . .

. .

. . .

. . .

. . .

, , . . . ,

Functional Constraints

Page 34: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.2 Standard Form for LP

Max Z c X c X c X

s t

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 20 0 0

. . .

. .

. . .

. . .

. . .

, , . . . , NonnegativityConstraints

Page 35: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.3 Assumptions

• Proportionality

The contribution of each activity to the value of the objective function is proportional to the level of activity.

Consider Z = 3X1 + . . .

Profit = R - C

= 8X1 - 5X1 = 3X1

Page 36: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.3 Assumptions• Proportionality

The contribution of each activity to the value of the objective function is proportional to the level of activity.

Consider Z = 3X1 + . . . X1 Z

0 01 32 63 94 125 15

Z

02468

10121416

0 1 2 3 4 5 6

X1

Co

ntr

ibu

tio

n t

o Z

Page 37: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.3 Assumptions• Proportionality

Now Suppose fixed costs = 3. Then

Profit = R - TC

= 8X1 - (3 + 5X1)

= 3X1 - 3

. X1 Z Z'

0 0 -31 3 02 6 33 9 64 12 95 15 12

Z

-5

0

5

10

15

20

0 1 2 3 4 5 6

X1

Co

ntr

ibu

tio

n t

o Z

Z

Z'

Page 38: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.3 Assumptions

• Proportionality

Now Suppose we have a decreasing marginal rate of return

Profit = R - TC

= (8-.025X1)X1 - 5X1

.

Page 39: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.3 Assumptions

• Additivity

Every function in the LP model is the sum of the individual contributions of the respective activities

Z = 3X1 + 5X2 + 2X1X2

Interaction terms not allowed

Page 40: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.3 Assumptions

• Divisibility

Decision variables, Xi i=1,2, . . . n, are allowed to have any values, including non-integer values, that satisfy the functional and nonnegativity constraints.

Page 41: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.3 Divisibility

2 4 6 8 10 12

8

6

4

2

2 4 6 8 10 12

8

6

4

2

For K-Corp, is it

This or this ?

Page 42: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.3 Assumptions• Certainty

The value assigned to each parameter of a linear programming model is assumed to be a known constant.Max Z = 3X1 + 5X2

s.t.

X1 < 8

X2 < 6

3X1 + 4X2 < 36

X1 > 0 , X2 > 0

How certain are we of this demand?

Page 43: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.4Alt Power Generation• A regional power system has three

generating stations: A, B, and C. Each station serves a local area. Three outlying areas are also served by the system: X, Y, and X. The power demand at areas X, Y, and Z is 25, 50, and 30 MW respectively. The maximum generating capacity beyond local requirements and the cost of generation at the three stations is shown below.

Page 44: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.4Alt Power Generation Station Excess Cap. Cost of Gen.

A 100 500

B 75 700

C 200 400

Power can be transmitted between any pair of generating stations, but 5% of the amount shipped will be lost. Power can be transmitted from some of the generating stations to outlying areas, but 10% of the amount shipped is lost.

Page 45: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.4Alt Power Generation Model

Lines exist from stations A & C to X, from B & C to Y, and from A & B to Z.

A

C

B

X

Z

Y

Formulate as a linear program!

Page 46: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.4Alt Power Generation Model

Problem:

Min Cost of satisfying outlying areas

s.t.

Do not exceed capacity at any plant

Exactly serve each outlying area

Page 47: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.4Alt Power Generation Model

• Decision VariablesXij = power shipped from plant i to outlying

area j

• Objective Function

Min Cost

Min Z = 500XAX + 500XAZ + 700XBY + 700XBZ

+ 400XCX + 400XCY

Page 48: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.4Alt Power Generation Model

• Do not Exceed Capacity

XAX + XAZ < 100

XBY + XBZ < 75

XCX + XCY < 200

Page 49: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.4Alt Power Generation Model• Shipped - Losses satisfy outlying areas

XAX - .1XAX + XCX - .1XCX = 25

XBY - .1XBY + XCY - .1XCY = 50

XAZ - .1XAZ + XBZ - .1XBZ = 30

or

.9XAX + .9XCX = 25

.9XBY + .9XCY = 50

.9XAZ + .9XBZ = 30

Page 50: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Sec. 3.4Alt Power Generation ModelMin Z = 500XAX + 500XAZ + 700XBY + 700XBZ

+ 400XCX + 400XCY

s.t.

XAX + XAZ < 100

XBY + XBZ < 75

XCX + XCY < 200

.9XAX + .9XCX = 25

.9XBY + .9XCY = 50

.9XAZ + .9XBZ = 30

Xi,j > 0 , i = A, B, C j = X, Y, Z

Page 51: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

3.4 Additional Examples

• Design of Radiation therapy

• Regional Planning of Kibbutzim

• Controlling Air Pollution

• Reclaiming Solid waste

• Personnel Scheduling at Union Airways (United Airlines 24/7 40? $6m/yr saved)

• Distributing Goods in a Network (Like our Power Example)

Page 52: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

3.5 Spreadsheet Solution

• Range name

• Data cells

• Target cell

• Output cells

• Changing cells

• Solver

Page 53: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

3.5 Spreadsheet Fig. 3.14 Old

Page 54: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

3.5 Spreadsheet Fig. 3.15

Page 55: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

3.5 Spreadsheet Fig. 3.16

Page 56: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

3.5 Spreadsheet Fig. 3.17 Old

Page 57: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

3.5 Spreadsheet Fig. 3.18 Old

Page 58: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

3.5 Spreadsheet Fig. 3.19 Old

Page 59: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

3.5 Spreadsheet Fig. 3.20 Old

Page 60: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

3.5 Spreadsheet Fig. 3.21 Old

Page 61: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

3.5 Spreadsheet Fig. 3.22 Old

Page 62: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

3.6 Large Models Modeling Languages

• Older edition Citgo (petroleum products distributor) had 3000 functional constraints and 15000 decision variables

• Need for a modeling language

• You can learn MPL and Lindo with links from the book’s website (not part of our course this year)

Page 63: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

3.7 Conclusions

• LP is powerful

• LP is “standard”

• For allocating resources in any social organization

• Sometimes LP is not applicable; instead do other things

Page 64: ENGM 631 Optimization Ch. 3: Introduction to Linear Programming.

Cases

• 3.1 Auto assembly (Crusier &Thrillseeker)

• 3.2 (Online) Cutting Cafeteria costs

• 3.3 (Online) Staffing a Call Center at California Children’s Hospital

• 3.4 (Online) Promoting a Breakfast Cereal