1 / 27

Solver and modelling support for stochastic programming

Solver and modelling support for stochastic programming. H.I. Gassmann, Dalhousie University. Happy Birthday Andr á s, November 2009. Agenda. Stochastic programs An Example Algebraic modelling languages GAMS MPL AMPL Frontline Systems SMI (Stochastic modelling interface)

scot
Télécharger la présentation

Solver and modelling support for stochastic programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Agenda • Stochastic programs • An Example • Algebraic modelling languages • GAMS • MPL • AMPL • Frontline Systems • SMI (Stochastic modelling interface) • Optimization Services • Other software

  3. Stochastic programs • Two-stage recourse problems • Multistage recourse problems • Chance-constrained problems • Continuous distributions

  4. An Example (Ferguson & Dantzig) xij = # aircraft of type i assigned to route j yj = # empty seats on route j zj = # lost sales on route j In the original formulation, d is defined by marginals

  5. 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. 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. GAMS • Solve deterministic equivalent • Two-stage problems can use DECIS • Discrete scenarios only

  8. 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. 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. MPL capabilities • Solve deterministic equivalent (any MPL solver) • Built-in decomposition solver (two-stage - Cplex) • Communication with SMI • Planned extensions: nested decomposition

  11. 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. 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. SMI (Stochastic Modeling Interface) • Coin-OR project • API for interaction with stochastic models • Scenario-based • Discrete distributions

  14. 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. Data inter-change AML User interface Corporate databases Solvers

  16. 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. . . . . . . . . . . . . Solvers Solvers Modelling systems Modelling systems Why a standard interface? n*m hook-ups n+m hook-ups

  18. 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. OSiL Schema – Deterministic data

  20. 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. 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. OSoL – OS option language • Solver options • Initializations of variables • System requirements • Job parameters • In-memory representation: OSOption • API: get(), set(), add() methods

  23. OSrL and OSResult • Result of the optimization • Solution status • Statistics • Value of primal and dual variables • Can be displayed in a browser

  24. Solver support • All versions of OS download with COIN-OR solvers • Clp • Cbc • Ipopt • Bonmin • Couenne • Symphony • Additiona solver support • Cplex • GLPK • Lindo

  25. Future developments • Stochastic programming • Cone programming • Instance modification • Solution analysis

  26. Other software • SLP-IOR • SPInE/SAMPL/SMPL • Fort-SP • DECIS • MSLiP • …

  27. Conclusions • Slow but steady progress • Stochastic programming is more than scenario trees and deterministic equivalents • SP-aware modeling systems

More Related