Lessons from Project PhaseI z Good modeling practices

  • Slides: 20
Download presentation
Lessons from Project Phase-I z. Good modeling practices y. Extensive model documentation y. Generality

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

Model documentation z Includes defining meaningful variable names z Doesn’t hurt in any way

Model documentation z Includes defining meaningful variable names z Doesn’t hurt in any way z What if somebody has to continue the work you started ? z What if you have to take over somebody else’s work ? z Ever debugged somebody’s code ? That should be a good lesson !

Model generality z. EXTREMELY IMPORTANT z. What do you do when (not “IF” !)

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

Model generality z. Integrating model and data is a very, very bad idea. z.

Model generality z. Integrating model and data is a very, very bad idea. z. We won’t deduct too many points for that this time, but from Phase-II onwards, if you have data in your model………

A word of caution on writing constraints z 5 x 1 + x 2

A word of caution on writing constraints z 5 x 1 + x 2 10 z x 1 + 5 x 2 10 against z 6 x 1 + 6 x 2 20 z. Which is better ?

Reporting z. Whenever, you make or solve a model in the real world, you

Reporting z. Whenever, you make or solve a model in the real world, you will present it to higher management (senior managers, VPs, etc. ) z. They’re NOT interested in methodology, or your math, unless………… z. You show them the impact on business !!

Reporting z. Make sure your solution makes sense y. Logically follows from the data

Reporting z. Make sure your solution makes sense y. Logically follows from the data (at least some major decisions) y. Includes all relevant components, e. g. x. Purchasing x. Transportation x. Inventory x. Capital x. Duties and taxes x…………………

Executive summary z. Solution overview (“Best” strategy) z“Take the solution back through your calculations”…………

Executive summary z. Solution overview (“Best” strategy) z“Take the solution back through your calculations”………… z. Where is the money going ? y. Cost breakdowns by logical categories x. Types, Segments, Regions, etc. z. What are other key issues to consider ? z. Any alternatives ? With what tradeoffs ? z. At most 1 -2 pages with charts, tables, etc.

Main report and appendices z. Detailed solution and discussion, along with methodology, assumptions, etc.

Main report and appendices z. Detailed solution and discussion, along with methodology, assumptions, etc. + z. Your VALUE ADDITION !!! y. Can you suggest something beyond the solution of the problem given to you ? z. Appendices - for the “nerds” !

Project Phase-I Model: Sets zset SOURCES; zset PORTS; zset DCS; zset EDGES : =

Project Phase-I Model: Sets zset SOURCES; zset PORTS; zset DCS; zset EDGES : = (SOURCES cross PORTS) union (PORTS cross DCS);

Project Phase-I Model: Variables /*-------------------------The Variables in the model are the no. of containers

Project Phase-I Model: Variables /*-------------------------The Variables in the model are the no. of containers shipped each year on each edge --------------------------*/ zvar Shipments{EDGES} integer >= 0; z. This is a network flow problem, so integral data implies integral solutions.

Project Phase-I Model: Constraints z. Do not exceed supply at any source s. t.

Project Phase-I Model: Constraints z. Do not exceed supply at any source s. t. Observe. Capacity {source in SOURCES}: sum{(source, t) in EDGES} Shipments[source, t] <= Source. Cap[source]; z. Conserve Flow at Ports s. t. Conserve. Flow {port in PORTS}: sum{(f, port) in EDGES} Shipments[f, port] = sum{(port, t) in EDGES} Shipments[port, t]; z. Meet Demand at DCS s. t. Meet. Demand {dc in DCS}: sum{(t, dc) in EDGES} Shipments[t, dc] >= Demand[dc];

Project Phase-I Model: Objective function minimize Total. Cost: z. Purchase Price + Duties z.

Project Phase-I Model: Objective function minimize Total. Cost: z. Purchase Price + Duties z. Freight Costs z. Moving Inventory Costs (pipeline) z. 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)

A not so good way for variables, but it works too z. If you

A not so good way for variables, but it works too z. If you don’t want to work with EDGES, you may define variables by segment, like : Ship. Source. Port {SOURCES, PORTS}; Ship. Port. DC {PORTS, DCS}; z. Not the best way, but it’s acceptable too. z. Using EDGES is much more elegant.

A caution on number of variables and constraints z. Student versions of Xpress and

A caution on number of variables and constraints z. Student versions of Xpress and AMPL support 300 variables and 300 constraints. z. To see how many you’ve used, use the AMPL command : option show_stats 1;

Project Phase-I Answer z 18000 containers/year - Brazil to Norfolk z 2000 containers/year -

Project Phase-I Answer z 18000 containers/year - Brazil to Norfolk z 2000 containers/year - Brazil to Long Beach z 10000 containers/year - China to Long Beach z 18000 containers/year - Norfolk to NY z 12000 containers/year - Long Beach to LA z. Obvious solution ! Why ?

Project Phase-I Answer z. Total cost : $1. 3 -1. 4 billion, depending on

Project Phase-I Answer z. Total cost : $1. 3 -1. 4 billion, depending on your assumptions y$1. 2 billion purchase cost y$72 million duties y………………… z. In this phase, purchase cost (excluding duties) doesn’t affect the decision, so we can remove it from the objective function z. However, still need to report it !

Project Phase-II z. Something close to the real thing z. Much more detailed model

Project Phase-II z. Something close to the real thing z. Much more detailed model than Phase-I, so get on it ASAP ! y. Multiple products y. Multiple modes of transport y. Weight and cube constraints y………………… z. Use “option solver cplex; ” before “solve; ”

Project Phase-II z. Recall this ? /* ---------------------------------set………… param……… var………… s. t…………… Solve the

Project Phase-II z. Recall this ? /* ---------------------------------set………… param……… var………… s. t…………… Solve the problem You may need a command like option solver cplex; ----------------------------------*/ solve; z. Why ?

Project Phase-II z. Not a network flow problem anymore, so… z. Integral data does

Project Phase-II z. Not a network flow problem anymore, so… z. Integral data does not imply integral solutions ! z. AMPL solvers y. MINOS - default, doesn’t solve IPs y. CPLEX