Linear Programming Hierarchy of Models Define Linear Models

  • Slides: 36
Download presentation
Linear Programming Hierarchy of Models Define Linear Models Modeling Examples in Excel and AMPL

Linear Programming Hierarchy of Models Define Linear Models Modeling Examples in Excel and AMPL 15. 057 Spring 03 Vande Vate

Hierarchy of Models Network Flows Linear Programs Mixed Integer Linear Programs 15. 057 Spring

Hierarchy of Models Network Flows Linear Programs Mixed Integer Linear Programs 15. 057 Spring 03 Vande Vate

A More Academic View Mixed Integer Linear Programs Non-Convex Optimization Network Flows Linear Programs

A More Academic View Mixed Integer Linear Programs Non-Convex Optimization Network Flows Linear Programs Convex Optimization 15. 057 Spring 03 Vande Vate

The Differences Objective Function Variables Constraints Network Flows Linear Continuous Special Linear Forms Linear

The Differences Objective Function Variables Constraints Network Flows Linear Continuous Special Linear Forms Linear Programs Linear Continuous Linear Forms Convex Optimization Convex Continuous Convex Mixed Integer Linear Programs Linear Discete or Continuous Linear Forms General Continuous General Non-linear Optimization Our Focus: • Linear Programs (LP), • Mixed Integer Linear Programs (MIP) • Heuristics

Agenda for LP ■ First Example ■ What is Linear? ■ Several Illustrative Examples

Agenda for LP ■ First Example ■ What is Linear? ■ Several Illustrative Examples ◆ Excel and AMPL ■ Revenue Optimization Application ■ Portfolio Optimization 15. 057 Spring 03 Vande Vate

A First Example Simplified Oak Products Model Chair Style Captain Mate Profit/Chair Poduction Qty.

A First Example Simplified Oak Products Model Chair Style Captain Mate Profit/Chair Poduction Qty. Chair Component Total Usage Start Inventory End Inv. Long Dowels Short Dowels Legs Heavy Seats Light Seats Chairs Min. Production Slack Chair Production 15. 057 Spring 03 Vande Vate

Challenge ■ Build a Solver Model 15. 057 Spring 03 Vande Vate

Challenge ■ Build a Solver Model 15. 057 Spring 03 Vande Vate

A First Example Simplified Oak Products Model Chair Style Captain Mate Profit/Chair Poduction Qty.

A First Example Simplified Oak Products Model Chair Style Captain Mate Profit/Chair Poduction Qty. Chair Component Total Usage Start Inventory End Inv. Long Dowels Short Dowels Legs Heavy Seats Light Seats Chairs Min. Production Slack Chair Production 15. 057 Spring 03 Vande Vate

The Model ■ Objective: Maximize Profit ◆ =SUMPRODUCT(Unit. Profit, Production) ◆ =$56*Production of Captains

The Model ■ Objective: Maximize Profit ◆ =SUMPRODUCT(Unit. Profit, Production) ◆ =$56*Production of Captains + $40*Production of Mates ■ Variables: Production ◆ $B$4: $C$4 ◆ Production of Captains ◆ Production of Mates 15. 057 Spring 03 Vande Vate

Constraints ■ Constraints: ◆ Total. Usage <= Start. Inventory ● =SUMPRODUCT(Long. Dowels. Per. Chair,

Constraints ■ Constraints: ◆ Total. Usage <= Start. Inventory ● =SUMPRODUCT(Long. Dowels. Per. Chair, Production) <= 1280 ● =SUMPRODUCT(Short. Dowels. Per. Chair, Production) <= 1600 ●. . . ◆ Total. Production >= Min. Production ● =SUM(Production) >= 100 ■ Options ◆ Assume Non-negative ◆ Assume Linear Model 15. 057 Spring 03 Vande Vate

What’s a Linear Model ■ What is a linear function? ◆ Sum of known

What’s a Linear Model ■ What is a linear function? ◆ Sum of known constants * variables ◆ NOTHING ELSE IS LINEAR ◆ Examples: ● Sum across a row of variables ● Sum down a column of variables ● $56*Production of Captains + $40*Production of Mates ◆ In Excel ● SUMPRODUCT(CONSTANTS, VARIABLES) ◆ In AMPL ● sum {index in Index Set}parameter[index]*variable[index] ● Index Set cannot depend on values of variables 15. 057 Spring 03 Vande Vate

A Test ■ Variables: x and y ■ Which are linear? 15. 057 Spring

A Test ■ Variables: x and y ■ Which are linear? 15. 057 Spring 03 Vande Vate

Linear Programs ■ Objective: ◆ A linear function of the variables ■ Variables: ◆

Linear Programs ■ Objective: ◆ A linear function of the variables ■ Variables: ◆ May be restricted to lie between a lower bound an upper bound ◆ In AMPL ● var x >= 1, <= 200; ■ Constraints: ≤ ◆ Linear Function of the variables ≥ Constant = 15. 057 Spring 03 Vande Vate

Why These Limitations! ■ Can anything real be expressed with such limited tools? ■

Why These Limitations! ■ Can anything real be expressed with such limited tools? ■ What do we get for all the effort? 15. 057 Spring 03 Vande Vate

Power of Expression ■ The Marketing Hype: ◆ LOTS ◆ You will be amazed…

Power of Expression ■ The Marketing Hype: ◆ LOTS ◆ You will be amazed… ◆ Call before midnight tonight and get. . . ■ Experience: ◆ Most of Almost Everything ◆ All of Almost Nothing 15. 057 Spring 03 Vande Vate

My Own Perspective ■ Linear Programming ◆ Large portions of most real applications ◆

My Own Perspective ■ Linear Programming ◆ Large portions of most real applications ◆ Basis for understanding ◆ Background for MIP (Mixed Integer Programming) ● Everything can be modeled with MIP, but. . . 15. 057 Spring 03 Vande Vate

What do we get for playing? ■ Guarantees! ◆ Readily available algorithms that ●

What do we get for playing? ■ Guarantees! ◆ Readily available algorithms that ● Find a provably best solution ● Quite fast even for large problems ◆ Less compelling generally ● Sensitivity Analysis (not available with MIP) 15. 057 Spring 03 Vande Vate

Review of Sensitivity Simplified Oak Products Model Chair Style Captain Mate Profit/Chair Poduction Qty.

Review of Sensitivity Simplified Oak Products Model Chair Style Captain Mate Profit/Chair Poduction Qty. Chair Component Total Usage Start Inventory End Inv. Long Dowels Short Dowels Legs Heavy Seats Light Seats Chairs Min. Production Slack Chair Production 15. 057 Spring 03 Vande Vate

Review of Sensitivity Analysis Microsoft Excel 8. 0 a Sensitivity Report Worksheet: [07 Oak.

Review of Sensitivity Analysis Microsoft Excel 8. 0 a Sensitivity Report Worksheet: [07 Oak. Products. LP. xls]Sheet 1 Report Created: 12/19/01 4: 52 PM Adjustable Cells Constraints If the unit profit on the Mate were to drop, how much could it drop before we would quit making it?

More Examples ■ Illustrate “tricks” ■ Build experience ■ AMPL Examples 15. 057 Spring

More Examples ■ Illustrate “tricks” ■ Build experience ■ AMPL Examples 15. 057 Spring 03 Vande Vate

Blending Example Eastern Steel Blending Example (Described in Moore et al. Page 105 and

Blending Example Eastern Steel Blending Example (Described in Moore et al. Page 105 and following) 15. 057 Spring 03 Vande Vate

Challenge ■ Build a Solver Model 15. 057 Spring 03 Vande Vate

Challenge ■ Build a Solver Model 15. 057 Spring 03 Vande Vate

Blending Example Eastern Steel Blending Example (Described in Moore et al. Page 105 and

Blending Example Eastern Steel Blending Example (Described in Moore et al. Page 105 and following) 15. 057 Spring 03 Vande Vate

AMPL Model set MINES; set ELEMENTS; param Min. Lbs{ELEMENTS}; param Cost. Per. Ton{MINES}; param

AMPL Model set MINES; set ELEMENTS; param Min. Lbs{ELEMENTS}; param Cost. Per. Ton{MINES}; param Lbs. Per. Ton{MINES, ELEMENTS}; var Tons{MINES} >= 0; minimize Total. Cost: sum{mine in MINES} Cost. Per. Ton[mine]*Tons[mine]; s. t. Composition. Consts {elem in ELEMENTS}: sum{mine in MINES} Lbs. Per. Ton[mine, elem]*Tons[mine] >= Min. Lbs[elem]; s. t. Total. Weight: sum{mine in MINES} Tons[mine] = 1; 15. 057 Spring 03 Vande Vate

A Fixed Income Example Investment Example B o n d Yield Quality Maximize Yield

A Fixed Income Example Investment Example B o n d Yield Quality Maximize Yield Years to Maturity Conditions: at most 10 million to invest 4 million total in C, D, and E 1. 4 average quality 5 years average years to maturity 15. 057 Spring 03 Vande Vate

Challenge ■ Build a Solver Model 15. 057 Spring 03 Vande Vate

Challenge ■ Build a Solver Model 15. 057 Spring 03 Vande Vate

A Fixed Income Example Investment Example B o n d Yield Quality Maximize Yield

A Fixed Income Example Investment Example B o n d Yield Quality Maximize Yield Years to Maturity Conditions: at most 10 million to invest 4 million total in C, D, and E 1. 4 average quality 5 years average years to maturity 15. 057 Spring 03 Vande Vate

Diseconomies of Scale ■ If we are minimizing cost ◆ Unit cost increases with

Diseconomies of Scale ■ If we are minimizing cost ◆ Unit cost increases with volume ■ If we are maximizing profit ◆ Unit profit decreases with volume ■ Inherent incentive towards small volumes 15. 057 Spring 03 Vande Vate

Example: Marketing Total Volume = Segment 1 + Segment 2 Segment 1 ≤ 10

Example: Marketing Total Volume = Segment 1 + Segment 2 Segment 1 ≤ 10 First exposures drive sales Revenue = 60*Segment 1 Then the novelty fades + 15. 057 Spring 03 Vande Vate 20*Segment 2

What about…. 15. 057 Spring 03 Vande Vate

What about…. 15. 057 Spring 03 Vande Vate

A Financial Application ■ Financial Analysis �� ◆ Define goals �� ◆ Assess Risk

A Financial Application ■ Financial Analysis �� ◆ Define goals �� ◆ Assess Risk vs. Return �� ■ Asset Allocation �� ◆ Allocate assets among classes of investments �� ◆ Track and forecast market swings ■ Fund Selection �� ◆ No-Load Funds �� ◆ Established Performance 15. 057 Spring 03 Vande Vate

Asset Allocation ■ Asset Classes ØTreasury Bills ØEurope ØSmall Value Funds ØEmerging Markets ØLarge

Asset Allocation ■ Asset Classes ØTreasury Bills ØEurope ØSmall Value Funds ØEmerging Markets ØLarge Growth Funds ØHigh Yield ■ Asset Allocation ØEach Investor has target for each asset class 15. 057 Spring 03 Vande Vate

Fund Selection ■ Screen Funds ■ Rank in each Class for each fund ØFidelity

Fund Selection ■ Screen Funds ■ Rank in each Class for each fund ØFidelity Equity Income II > LV LG SV JA EU GV HY > 66 4 16 2 1 6 5 > Roughly speaking, the rank is the % of each funds investments that is in the asset class, e. g. , Fidelity Equity Income II has 4% of its assets in Large Growth. ■ Select Funds that meet the target allocation ØMinimize the total “deviation” from the targets ØDeviation is l Actual – Target l 15. 057 Spring 03 Vande Vate

Example Data Fund Ratings 15. 057 Spring 03 Vande Vate

Example Data Fund Ratings 15. 057 Spring 03 Vande Vate

Example ■ If we allocate 50% to the two funds… 15. 057 Spring 03

Example ■ If we allocate 50% to the two funds… 15. 057 Spring 03 Vande Vate

Challenge #2 ■ Build a linear model to find a best portfolio. ■ First

Challenge #2 ■ Build a linear model to find a best portfolio. ■ First build your model in Excel (Use the file Portfolio. xls) ■ Then build your model in AMPL (Use the file Portfolio. mdb) ■ Deliverables ◆ Models (Self documenting) ◆ Solutions (Self documenting) ■ Due: Beginning of Lecture #7 15. 057 Spring 03 Vande Vate