lecture 6: algorithm approach to lp soln agec 352 fall 2012 – sep 12 r. keeney

19
Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

Upload: melissa-ellis

Post on 27-Dec-2015

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

Lecture 6: Algorithm Approach to LP Soln

AGEC 352Fall 2012 – Sep 12

R. Keeney

Page 2: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

Lab Discussion Questions

Opportunity cost of specialization

2200 – 2025 = 175 = Op cost chair spec2200/45 = ? <- GM/chair required for spec to

be equally profitable

Corner Point

Chairs

Tables

Total Gross

Margin1 45 0 20252 0 20 16003 24 14 2200

GM/unit 45 80  

Page 3: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

Linear ProgrammingCorner Point Identification

◦Solution must occur at a corner point◦Solve for all corners and find the

best solutionWhat if there were many

(thousands) of corner points?◦Want a way to intelligently identify

candidate corner points and check when we have found the best

Simplex Algorithm does this…

Page 4: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

Assigned Reading5 page handout posted on the

class website◦Spreadsheet that goes with the

handout

Lecture today will point out the most important items from that handout

Page 5: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

Problem SetupLet:

C = corn production (measured in acres)B = soybean production (measured in

acres) The decision maker has the following limited resources:

320 acres of land20,000 dollars in cash19,200 bushels of storage

 The decision maker wants to maximize profits and estimates the following per acre net returns:

C = $60 per acreB = $90 per acre

Page 6: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

Problem Setup (cont)

The two crops the decision maker produces use limited resources at the following per acre rates: 

Resource Corn SoybeansLand 1 1Cash 50 100Storage 100 40

Page 7: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

Algebraic Form of Problem

0;0:

200,1940100:

000,2010050:

320:

..

9060max

BCnegnon

BCstorage

BCcash

BCland

ts

BC

Page 8: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

Problem Setup in SimplexNote the correspondence

between algebraic form and rows/columns

Initial TableauC B s1 s2 s3 P RHS

land 1 1 1 0 0 0 320cash 50 100 0 1 0 0 20000stor 100 40 0 0 1 0 19200obj -60 -90 0 0 0 1 0

Page 9: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

SimplexProcedure: Perform some algebra that is

consistent with equation manipulation◦Multiply by a constant◦Add/subtract a value from both sides of an

equation

Goal: Each activity column to have one cell with a 1 and the rest of its cells with 0

Result: A solution to the LP can be read from the manipulated tableau

Page 10: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

Simplex Steps

The simplex conversion steps are as follows:1)Identify the pivot column: the column

with the most negative element in the objective row.

2)Identify the pivot cell in that column: the cell with the smallest RHS/column value.

3)Convert the pivot cell to a value of 1 by dividing the entire row by the coefficient in the pivot cell.

4)Convert all other elements of the pivot column to 0 by adding a multiple of the pivot row to that row.

Page 11: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

Step 1B has the most negative ‘obj’

coefficient◦Most profitable activity

Initial TableauC B s1 s2 s3 P RHS

land 1 1 1 0 0 0 320cash 50 100 0 1 0 0 20000stor 100 40 0 0 1 0 19200obj -60 -90 0 0 0 1 0

Page 12: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

Step 2ID pivot cell: Divide RHS by

elements in B columnMost limiting resource

identifcationInitial TableauC B s1 s2 s3 P RHS

land 1 1 1 0 0 0 320cash 50 100 0 1 0 0 20000stor 100 40 0 0 1 0 19200obj -60 -90 0 0 0 1 0

320/1

20K/100

19200/40

Page 13: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

Step 3Convert pivot cell to value of 1

(*1/100)Initial Tableau

C B s1 s2 s3 P RHSland 1 1 1 0 0 0 320cash 50 100 0 1 0 0 20000stor 100 40 0 0 1 0 19200obj -60 -90 0 0 0 1 0

C B s1 s2 s3 P RHSnew cash row 0.5 1 0 0.01 0 0 200

Page 14: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

Step 4Convert other elements of pivot

col to 0, by multiplying the new cash row and adding to the other rows

Multiplying factor for land row◦-1 (-1*1 + 1 = 0)

Multiplying factor for stor row◦-40 (-40*1 + 40 = 0)

Page 15: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

ExampleC B s1 s2 s3 P RHS

New cash row

0.5 1 0 0.01 0 0 200

New cash row *-1

-0.5 -1 0 -0.01 0 0 -200

Old land row

1 1 1 0 0 0 320

New land row

0.5 0 1 -0.01 0 0 120

Explanation of rows:New Cash Row: Multiply all elements by 1/100New Cash Row *-1: Multiply new cash row by -1Old Land Row: From initial tableauNew Land Row: Add New cash row*-1 to old land row

Page 16: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

Tableau after 1st iteration

C B s1 s2 s3 P RHSland 0.5 0 1 -0.01 0 0 120cash 0.5 1 0 0.01 0 0 200stor 80 0 0 -0.4 1 0 11200obj -15 0 0 0.9 0 1 18000

IF all negative values are eliminated from obj row, we are doneIf negative values remain, repeat the four Simplex steps1) New pivot column is C, …(see handout)

Page 17: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

Tableau after 2nd iteration of Simplex

Final TableauC B s1 s2 s3 P RHS

land 0 0 1 -0.008 -0.00625 0 50cash 0 1 0 0.013 -0.00625 0 130stor 1 0 0 -0.005 0.0125 0 140obj 0 0 0 0.825 0.1875 1 20100

No negatives in obj row, so we are done.Solution values: Look under the activity column, find the one and read the corresponding RHS value: C = 140, B = 130, Slack Land = 50; P=Profit=20,100

Page 18: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

SimplexProgrammed into Excel as one of

the solution optionsWhen we begin LP, we will make

sure that we are choosing the simplex method

Time consuming by hand but we need to understand how solutions are generated by the computer

Key points for exam:◦Steps, reading a solution

Page 19: Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney

Next weekSolving LP in Excel

◦Standard problem setup◦Solution elements◦Interpretation of plan and evaluation

of how sensitive the best plan is to changed assumptions