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

Post on 18-Jan-2016

238 views 0 download

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

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.

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

Sec. 3.1Alt. Model

• VariablesX1 = number of tractors to manufacture

X2 = number of shakers to manufacture

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

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

Sec. 3.1Alt. Model

Max Z = 3X1 + 5X2

s.t.

X1 < 8,000

X2 < 6,000

3X1 + 4X2 < 36,000

X1 > 0

X2 > 0

Sec. 3.1Alt. Rescale

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

X2 = number of shakers in 1,000’s

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)

Sec. 3.1Alt. Graphical Technique

2 4 6 8 10

8

6

4

2

Do not exceeddemand for tractors

X1 < 8

Sec. 3.1Alt. Graphical Technique

2 4 6 8 10

8

6

4

2

Do not exceeddemand for tractors, shakers

X2 < 6

X1 < 8

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

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

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

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

Sec. 3.1Alt. Iso-Value Lines

2 4 6 8 10 12

8

6

4

2

Z = 3X1 + 5X2

Z = 15

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)

Sec. 3.2 Some Terminology

2 4 6 8 10 12

8

6

4

2

FeasibleSolutions

Sec. 3.2 Some Terminology

2 4 6 8 10 12

8

6

4

2

Feasible Region

Sec. 3.2 Some Terminology

2 4 6 8 10 12

8

6

4

2

Boundary

Some Terminology

2 4 6 8 10 12

8

6

4

2

InfeasibleSolutions

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

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)

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.

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.

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.

Sec. 3.2 Optimal Solution

2 4 6 8 10 12

8

6

4

2

Recall,

Z = 3X1 + 5X2

(4,6)

3X1 + 4X2 < 36

Sec. 3.2 Optimal Solution

2 4 6 8 10 12

8

6

4

2

Suppose,

Z = 3X1 + 54X2

(4,6)

3X1 + 4X2 < 36

Sec. 3.2 Optimal Solution

2 4 6 8 10 12

8

6

4

2

Suppose,

Z = 3X1 + 54X2

(4,6)

3X1 + 4X2 < 36

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

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

. . .

. .

. . .

. . .

. . .

, , . . . ,

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

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

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

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

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

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

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'

Sec. 3.3 Assumptions

• Proportionality

Now Suppose we have a decreasing marginal rate of return

Profit = R - TC

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

.

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

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.

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 ?

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?

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.

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.

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!

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

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

Sec. 3.4Alt Power Generation Model

• Do not Exceed Capacity

XAX + XAZ < 100

XBY + XBZ < 75

XCX + XCY < 200

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

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

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)

3.5 Spreadsheet Solution

• Range name

• Data cells

• Target cell

• Output cells

• Changing cells

• Solver

3.5 Spreadsheet Fig. 3.14 Old

3.5 Spreadsheet Fig. 3.15

3.5 Spreadsheet Fig. 3.16

3.5 Spreadsheet Fig. 3.17 Old

3.5 Spreadsheet Fig. 3.18 Old

3.5 Spreadsheet Fig. 3.19 Old

3.5 Spreadsheet Fig. 3.20 Old

3.5 Spreadsheet Fig. 3.21 Old

3.5 Spreadsheet Fig. 3.22 Old

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)

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

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