Presentation is loading. Please wait.

Presentation is loading. Please wait.

Solver and modelling support for stochastic programming H.I. Gassmann, Dalhousie University Happy Birthday András, November 2009.

Similar presentations

Presentation on theme: "Solver and modelling support for stochastic programming H.I. Gassmann, Dalhousie University Happy Birthday András, November 2009."— Presentation transcript:

1 Solver and modelling support for stochastic programming H.I. Gassmann, Dalhousie University Happy Birthday András, November 2009

2 © 2009 H.I. Gassmann Agenda Stochastic programs An Example Algebraic modelling languages –GAMS –MPL –AMPL Frontline Systems SMI (Stochastic modelling interface) Optimization Services Other software

3 © 2009 H.I. Gassmann Stochastic programs Two-stage recourse problems Multistage recourse problems Chance-constrained problems Continuous distributions

4 © 2009 H.I. Gassmann An Example (Ferguson & Dantzig) x ij = # aircraft of type i assigned to route j y j = # empty seats on route j z j = # lost sales on route j In the original formulation, d is defined by marginals

5 © 2009 H.I. Gassmann Words to ponder… “Simple recourse is so previous millennium” “Always build your scenario tree prior to calling the solver” “No need to bother with special algorithms ― Cplex on the deterministic equivalent is best” “Robust optimization is irrelevant”

6 © 2009 H.I. Gassmann GAMS SET equip := (E1, E2, E3, E4); route := (R1, R2, R3, R4, R5); scen := (S1*S720); DATA avail[equip] := (E1,10, E2,19, E3,25, E4,15); price[route] := (R1,13, R2,13, R3, 7, R4, 7, R5, 1); capac[equip,route] := (...); cost [equip,route] := (...); demand[route,scen] := (...); prob[scen] := (...); DECISION VARIABLES Assign[equip,route]; Empty[route,scen]; LostSales[route,scen]; MODEL MIN totalcost = SUM(equip,route: cost*Assign) + SUM(route,scen: prob*price*LostSales); SUBJECT TO availability[equip]: SUM(route: Assign) <= avail; passengers[route,scen]: SUM(equip: capac*Assign) – Empty + LostSales = demand;

7 © 2009 H.I. Gassmann GAMS Solve deterministic equivalent Two-stage problems can use DECIS Discrete scenarios only

8 © 2009 H.I. Gassmann MPL INDEX aircraft : = (A,B,C,D); STOCHASTIC INDEP route := (NL1, NL2, ND0, ND1, NB0) -> (r1,r2,r3,r4,r45); OUTCOME out5 := 1..5; EVENT RouteOut[route,out5] := (NL1, 1..5, NL2, 1..2, ND0, 1..5, ND1, 1..5, NB0, 1..3); PROBABILITIES p[route, out5 in RouteOut] := [NL1, 1, 0.2, NL1, 2, 0.05,... ];

9 © 2009 H.I. Gassmann MPL (continued) RANDOM DATA Demand[route, out5 in RouteOut] :=... DATA AircraftAvail[aircraft] :=...; TicketPrice[route] :=...; PotentialPass[aircraft,route] :=...; MonthlyCost [aircraft,route] :=...; DECISION VARIABLES Assign[aircraft,route] -> x WHERE (PotentialPass > 0); STAGE2 VARIABLES EmptySeats[route] -> y1; TurnedAway[route] -> y2; MODEL MIN TotalCost = SUM(aircraft,route: MonthlyCost * Assign) + SUM(route: TicketPrice * TurnedAway); SUBJECT TO AircraftCap[aircraft]: SUM(route: Assign) <= AircraftAvail; PassengerBal[route]: SUM(aircraft: PotentialPass * Assign) + TurnedAway[route] – EmptySeats[route] = Demand[route];

10 © 2009 H.I. Gassmann MPL capabilities Solve deterministic equivalent (any MPL solver) Built-in decomposition solver (two-stage - Cplex) Communication with SMI Planned extensions: nested decomposition

11 © 2009 H.I. Gassmann AMPL set aircraft := {A1, A2, A3, A4}; set routes := {r1, r2, r3, r4, r5}; param avail{aircraft} >= 0; param ticketPrice{routes} > 0; param potentialPassenger{aircraft, routes} default 0; param MonthlyCost {a in aircraft, r in routes: potentialPassenger[a,r] > 0}; var demand{route} random; var Assign{a in aircraft, r in routes: potentialPassenger[a,r] > 0} >= 0; var EmptySeats{route} suffix stage 2; var TurnedAway{route} suffix stage 2; minimize totalCost: sum{a in aircraft, r in routes: potentialPassenger[a,r] > 0} MonthlyCost[a,r]*Assign[a,r] + sum{r in routes} TicketPrice[r]*TurnedAway[r]; subject to AircraftCap{a in aircraft}: sum{r in routes: potentialPassenger[a,r] > 0} Assign[a,r] <= avail[a]; subject to PassengerBalance{r in routes}: sum{a in aircraft: potentialPassenger[a,r] > 0} potentialPassenger[a,r] * Assign[a,r] + TurnedAway[r] - EmptySeats[r] = demand[r];

12 © 2009 H.I. Gassmann Frontline systems Robust optimization Chance constraints Recourse models Expected value, VaR, CVar objectives One or two stages Continuous distributions (automatic sampling) Deterministic equivalent or simulation Example

13 © 2009 H.I. Gassmann SMI (Stochastic Modeling Interface) Coin-OR project API for interaction with stochastic models Scenario-based Discrete distributions

14 © 2009 H.I. Gassmann Optimization Services The Optimization Services project aims to provide A set of standards to facilitate communication between modeling languages, solvers, problem analyzers, simulation engines, and registry and discovery services in a distributed computing environment.

15 © 2009 H.I. Gassmann Solvers AML Corporate databases User interface Data inter- change

16 © 2009 H.I. Gassmann What Is Optimization Services (OS)? A set of XML-based standards for representing, among others, –optimization instances (OSiL, also OSgL, OSnL and OSsL) –optimization results (OSrL and OSaL) –optimization solver options (OSoL) –communication between clients and solvers (OSpL) Open source libraries to work with these standards A robust API for solver algorithms and modeling systems Support for linear, integer, nonlinear and stochastic programs A command line executable OSSolverService Executables OSAmplClient and GAMSLinks for AMPL and GAMS Utilities to convert MPS files and AMPL nl files into OSiL Server software that works with Apache Tomcat and Apache Axis

17 © 2009 H.I. Gassmann Why a standard interface?............ Modelling systems Solvers............ Modelling systems Solvers n*m hook-upsn+m hook-ups

18 © 2009 H.I. Gassmann Why XML? Existing parsers to check syntax Easy to generate automatically Tree structure naturally mirrors expression trees for nonlinear functions Arbitrary precision and name space Automatic attribute checking (e.g., nonnegativity) Querying capabilities via XQuery Encryption standards being developed Easy integration into broader IT infrastructure

19 © 2009 H.I. Gassmann OSiL Schema – Deterministic data …

20 © 2009 H.I. Gassmann Representation of uncertainty Explicit event trees –Scenario formulation –Only record data items that differ from parent scenario Implicit trees (distribution-based formulation) –Assume independence between stages –Distributions within stage discrete or continuous Probabilistic constraints –Simple chance constraints –Joint chance constraints

21 © 2009 H.I. Gassmann OSInstance: In-memory representation XML elements correspond to C++ classes Child elements mapped as member classes set(), get() and calculate() methods class OSInstance{ public: OSInstance(); InstanceHeader *instanceHeader; InstanceData *instanceData; }; // class OSInstance

22 © 2009 H.I. Gassmann OSoL – OS option language Solver options Initializations of variables System requirements Job parameters In-memory representation: OSOption API: get(), set(), add() methods

23 © 2009 H.I. Gassmann OSrL and OSResult Result of the optimization –Solution status –Statistics –Value of primal and dual variables Can be displayed in a browser

24 © 2009 H.I. Gassmann Solver support All versions of OS download with COIN-OR solvers –Clp –Cbc –Ipopt –Bonmin –Couenne –Symphony Additiona solver support –Cplex –GLPK –Lindo

25 © 2009 H.I. Gassmann Future developments Stochastic programming Cone programming Instance modification Solution analysis

26 © 2009 H.I. Gassmann Other software SLP-IOR SPInE/SAMPL/SMPL Fort-SP DECIS MSLiP …

27 © 2009 H.I. Gassmann Conclusions Slow but steady progress Stochastic programming is more than scenario trees and deterministic equivalents SP-aware modeling systems

Download ppt "Solver and modelling support for stochastic programming H.I. Gassmann, Dalhousie University Happy Birthday András, November 2009."

Similar presentations

Ads by Google