lessons from project phase-i zgood modeling practices yextensive model documentation ygenerality of...

20
Lessons from Project Phase-I Good modeling practices Extensive model documentation Generality of the model Writing constraints Good reporting practices To a manager, not a professor ! Executive Summary - about the business Clarity, brevity, …………

Upload: arthur-cook

Post on 17-Jan-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

Lessons from Project Phase-I

Good modeling practices Extensive model documentation Generality of the model Writing constraints

Good reporting practices To a manager, not a professor ! Executive Summary - about the business Clarity, brevity, …………

Page 2: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

Model documentation

Includes defining meaningful variable namesDoesn’t hurt in any wayWhat if somebody has to continue the work

you started ?What if you have to take over somebody

else’s work ?

Ever debugged somebody’s code ? That should be a good lesson !

Page 3: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

Model generality

EXTREMELY IMPORTANT

What do you do when (not “IF” !) the world changes ? Addition/deletion of ports, DCs, etc. Prices, duties, etc. change frequently …………

Page 4: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

Model generality

Integrating model and data is a very, very bad idea.

We won’t deduct too many points for that this time, but from Phase-II onwards, if you have data in your model………

Page 5: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

A word of caution on writing constraints

5x1 + x2 10

x1 + 5x2 10

against

6x1 + 6x2 20

Which is better ?

Page 6: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

Reporting

Whenever, you make or solve a model in the real world, you will present it to higher management (senior managers, VPs, etc.)

They’re NOT interested in methodology, or your math, unless…………

You show them the impacton business !!

Page 7: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

Reporting

Make sure your solution makes sense Logically follows from the data (at least

some major decisions) Includes all relevant components, e.g.

PurchasingTransportationInventoryCapitalDuties and taxes…………………

Page 8: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

Executive summary

Solution overview (“Best” strategy)“Take the solution back through your

calculations”…………Where is the money going ?

Cost breakdowns by logical categories Types, Segments, Regions, etc.

What are other key issues to consider ?Any alternatives ? With what

tradeoffs ?At most 1-2 pages with charts, tables, etc.

Page 9: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

Main report and appendices

Detailed solution and discussion, along with methodology, assumptions, etc. +

Your VALUE ADDITION !!! Can you suggest something beyond the

solution of the problem given to you ?

Appendices - for the “nerds” !

Page 10: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

Project Phase-I Model: Sets

set SOURCES;set PORTS;set DCS;

set EDGES := (SOURCES cross PORTS) union (PORTS cross

DCS);

Page 11: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

Project Phase-I Model: Variables

/*-------------------------------------------------- The Variables in the model are the no. of containers shipped each year on each edge

---------------------------------------------------*/var Shipments{EDGES} integer >= 0;

This is a network flow problem, so integral data implies integral solutions.

Page 12: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

Project Phase-I Model: Constraints

Do not exceed supply at any source s.t. ObserveCapacity {source in SOURCES}:

sum{(source, t) in EDGES} Shipments[source, t] <= SourceCap[source];

Conserve Flow at Portss.t. ConserveFlow {port in PORTS}:

sum{(f, port) in EDGES} Shipments[f, port]= sum{(port, t) in EDGES} Shipments[port, t];

Meet Demand at DCSs.t. MeetDemand {dc in DCS}:

sum{(t, dc) in EDGES} Shipments[t,dc] >= Demand[dc];

Page 13: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

Project Phase-I Model: Objective function

minimize TotalCost:Purchase Price + DutiesFreight CostsMoving Inventory Costs (pipeline)Waiting Inventory Costs (Note: these

should include the waiting time at the sources, but we forgot to tell you how often ships are scheduled to sail)

Page 14: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

A not so good way for variables, but it works too

If you don’t want to work with EDGES, you may define variables by segment, like :

ShipSourcePort {SOURCES, PORTS};ShipPortDC {PORTS, DCS};

Not the best way, but it’s acceptable too.Using EDGES is much more elegant.

Page 15: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

A caution on number of variables and constraints

Student versions of Xpress and AMPL support 300 variables and 300 constraints.

To see how many you’ve used, use the AMPL command :

option show_stats 1;

Page 16: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

Project Phase-I Answer

18000 containers/year - Brazil to Norfolk2000 containers/year - Brazil to Long

Beach10000 containers/year - China to Long

Beach18000 containers/year - Norfolk to NY12000 containers/year - Long Beach to LA

Obvious solution ! Why ?

Page 17: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

Project Phase-I Answer

Total cost : $1.3-1.4 billion, depending on your assumptions $1.2 billion purchase cost $72 million duties …………………

In this phase, purchase cost (excluding duties) doesn’t affect the decision, so we can remove it from the objective function

However, still need to report it !

Page 18: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

Project Phase-II

Something close to the real thingMuch more detailed model than Phase-I,

so get on it ASAP ! Multiple products Multiple modes of transport Weight and cube constraints …………………

Use “option solver cplex;” before “solve;”

Page 19: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

Project Phase-II

Recall this ?

/* ------------------------------------------------------------------- set………… param……… var………… s.t…………… Solve the problem You may need a command like option solver cplex; -------------------------------------------------------------------*/ solve;

Why ?

Page 20: Lessons from Project Phase-I zGood modeling practices yExtensive model documentation yGenerality of the model yWriting constraints zGood reporting practices

Project Phase-II

Not a network flow problem anymore, so…

Integral data does not imply integral solutions !

AMPL solvers MINOS - default, doesn’t solve IPs CPLEX