linear programming ii

27
Linear Programming II HSPM J716

Upload: tocho

Post on 15-Feb-2016

34 views

Category:

Documents


0 download

DESCRIPTION

Linear Programming II. HSPM J716. Crawling along the simplex. The simplex method moves from one corner to the next until the amount to be maximized stops rising. Learning Objectives Competencies for linear programming. Competency 1: Recognize problems that linear programming can handle: - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Linear Programming II

Linear Programming II

HSPM J716

Page 2: Linear Programming II

0 2 4 6 8 10 12 14 16 18 200

5

10

15

20

25

2x+6y=36

5x+3y=30

8x+2y=40

400x+500y=3700

Coarse Stones (tons)

Fine

Sto

nes (

tons

)

Optimum

Isoprofit Line

Page 3: Linear Programming II

Crawling along the simplex

• The simplex method moves from one corner to the next until the amount to be maximized stops rising.

Page 4: Linear Programming II

Learning Objectives Competencies for linear programming

• Competency 1: Recognize problems that linear programming can handle:

• Linear programming lets you optimize an objective function subject to some constraints. The objective function and constraints are all linear.

Page 5: Linear Programming II

Linear Programming Competencies

• Competency 2: Know the elements of a linear programming problem:

• an objective function that shows the cost or profit depending on what choices you make,

• constraint inequalities that show the limits of what you can do, and

• non-negativity restrictions, because you cannot turn outputs back into inputs.

Page 6: Linear Programming II

Linear Programming Competencies

• Competency 2: Know the elements of a linear programming problem:

• an objective function that shows the cost or profit depending on what choices you make,

• constraint inequalities that show the limits of what you can do, and

• non-negativity restrictions, because you cannot turn outputs back into inputs.

Page 7: Linear Programming II

Linear Programming Competencies

• Competency 3: Understand the principles that the computer uses to solve a linear programming problem.

• The computer uses the simplex method to systematically move along the edges of the feasible area (the simplex). It goes from one corner to the next and stops when the objective function stops getting better.

Page 8: Linear Programming II

Linear Programming Competencies

• Competency 3: Understand the principles that the computer uses to solve a linear programming problem.

• The computer uses the simplex method to systematically move along the edges of the feasible area (the simplex). It goes from one corner to the next and stops when the objective function stops getting better.

Page 9: Linear Programming II

Linear Programming Competencies

• Competency 4a: What linear programming problems have no solution?

• Those that have no feasible area. This means it's impossible to satisfy all the constraints at once.

Page 10: Linear Programming II

Linear Programming Competencies

• Competency 4b: What difference does linearity make?

• If the constraints are not linear, the feasible area has curved edges. The simplex method doesn't work because you can't be sure that the solution is at a corner. The solution may be in the middle of a curved edge. If the objective function is not linear, the solution may not even be on an edge. It may be in the interior of the feasible area.

Page 11: Linear Programming II

Minimization problem• Animals need:– 14 units of nutrient A,– 12 units of nutrient B, and– 18 units of nutrient C.

• A bag of X has 2 units of A, 1 unit of B, and 1 unit of C.

• A bag of Y has 1 unit of A, 1 unit of B, and 3 units of C.

• A bag of X costs $2. A bag of Y costs $4.

Page 12: Linear Programming II

Minimization problem

• Constraints:• 2X + 1Y >= 14 nutrient A requirement• 1X + 1Y >= 12 nutrient B requirement• 1X + 3Y >= 18 nutrient C requirement– Read vertically to see how much of each nutrient

is in each grain.• Cost = 2X + 4Y – objective function to be minimized

Page 13: Linear Programming II

Minimization problem

0 2 4 6 8 10 12 14 16 180

5

10

15

20

25

Series1Series3Series5Iso-cost

Page 14: Linear Programming II

Linear Programming Competencies

• Competency 5: Be able to solve small linear programming problems yourself.

• The tricky part is setting up the objective function and the constraints. Write them on paper. Then set up your spreadsheet and solve.

• Then comes the other tricky part – coaxing Excel to work!

Page 15: Linear Programming II

Rear Admiral Grace Hopper

• 1906-1992• Navy Reserve Lt.(J.G.)

1943 (age 36)• 3rd programmer of

Mark I computer at Harvard

• Invented the compiler• “Mother” of COBOL• First female Admiral

Page 16: Linear Programming II

Bug in Mark II (1947)

Page 17: Linear Programming II

Linear Programming Competencies

• Competency 6: Understand shadow prices.• Shadow Prices are what-it’s-worth-to-you-for-

another-unit-of-input prices.• Other names for shadow prices:

• Lagrange Multiplier (if you don’t check Assume Linear Model)

• Opportunity Cost (other spreadsheets use this)• Reduced Cost (if you check Assume Linear Model)• Reduced Gradient (if you don’t)

Page 18: Linear Programming II

Shadow prices for nutrient example

Page 19: Linear Programming II

Multiple optima ifIso-cost line and constraint are parallel

Page 20: Linear Programming II

Mixed constraintsif constraint is D9 >= E9

Shadow prices are below

Page 21: Linear Programming II

Mixed constraintsif constraint is B2 >= 5

its shadow price is “Reduced Cost”

Page 22: Linear Programming II

Primal and Dual

Primal Dual

Page 23: Linear Programming II

Primal and Dual SolutionsPrimal Dual

Page 24: Linear Programming II

Applications -- steps

• Identify the activities• Specify the constraints• Specify the objective function

• Solve! Get Sensitivity Report• Get results from spreadsheet• Get shadow prices from Sensitivity Report

Page 25: Linear Programming II

Scheduling Application

Day Need for StaffMon 180Tue 160Wed 150Thu 160Fri 190Sat 140Sun 120

• Staff work 5 days straight, then get 2 off.

• Objective is to minimize the total cost.– Which is roughly

proportional to the number of hires.

Page 26: Linear Programming II

Scheduling Application

• Identify the activities– Each hiring schedule is an activity

• Specify the constraints– How many people you need at different times

• Specify the objective function– Minimize the total number of people hired

Page 27: Linear Programming II

Transportation Application

• Identify the activities– Each route from a distribution center to a customer

is an activity• Specify the constraints– Each distribution center starts with a limited amount– Each customer has a requirement

• Specify the objective function– Minimize total cost of all product movements