An XMLbased schema for stochastic programs H I
An XML-based schema for stochastic programs H. I. Gassmann, R. Fourer, J. Ma, R. K. Martin EURO XXI, June 2006, Reykjavik
Outline • • • Motivation and review Dynamic and stochastic structure A four-stage investment problem Instance representations OSi. L format Conclusions and future work © 2006 H. I. Gassmann
Why a standard? • • • Benchmarking Archiving Algorithm development Distributed computing Sharing of problem instances © 2006 H. I. Gassmann
Why XML? • • Easy to accommodate new features Existing parsers to check syntax Easy to generate automatically Trade-off between verbosity and human readability • Arbitrary precision and name space • Stochastic extensions for dynamic and stochastic structure © 2006 H. I. Gassmann
Stochastic programs “ ” Any data item with nonzero subscript may be random (including dimensions where mathematically sensible) ~ stands for arbitrary relation ( , =, ) © 2006 H. I. Gassmann
Constraints involving random elements D means ~ or or or with probability 1 with probability at least b with expected violation at most v … © 2006 H. I. Gassmann
Problem classes • Recourse problems – All constraints hold with probability 1 • Chance-constrained problems – Typically single stage • Hybrid problems – Recourse problems including features such as chance constraints or integrated chance constraints • Distribution problems – Determine distribution of optimum objective and/or decisions © 2006 H. I. Gassmann
Example (Birge) S 0 S 1 S 2 I = 2, T = 3, B = 55, R = 80, at 1 = {1. 25, 1. 06}, … at 2 = {1. 14, 1. 12} © 2006 H. I. Gassmann
What is an instance? • Role and number of constraints, objectives, parameters and variables must be known • Every parameter’s value(s) must be known • Continuous entities vs. discretization – Decision variables – Objective and constraints – Distribution of random variables – Time domain © 2006 H. I. Gassmann
Instance representation • Internal representations • SMPS format – Limited precision – Limited to linear problems • Algebraic modelling languages – Discrete distributions only – Limited consistency checks • OSi. L format © 2006 H. I. Gassmann
Example (SMPS) I = 2, T = 3, B = 55, R = 80, at 1 = {1. 25, 1. 06}, at 2 = {1. 14, 1. 12} Core file Stoch file ROWS BLOCKS BL Block 1 X 01 X 02 BL Block 2 X 11 X 12. . . ENDATA Budget 0 Object Budget 1 Budget 2 Budget 3 COLS X 01. . . Budget 0 Budget 1 1. 0 1. 25 Budget 0 Budget 3 55. 80. RHS rhs 1 ENDATA © 2006 H. I. Gassmann DISCRETE Budget 1 Budget 2 0. 5 1. 25 1. 14 0. 5 1. 06 1. 12 0. 5 1. 25 1. 14
AMPL model param T; param penalty; param budget; param target; set instruments; set scenarios; param prob{scenarios}; set slice{t in 0. . T} within scenarios; param ancestor {t in 1. . T, s in slice[t]}; var over {slice[T]}; var under{slice[T]}; param return {t in 1. . T, i in instruments, s in slice[t]}; var invest {t in 0. . T-1, i in instruments, s in slice[t]}; maximize net_profit: sum{s in scenarios} prob[s]*(over[s] - penalty*under[s]); subject to wealth{t in 0. . T, s in slice[t]}: (if t < T then sum{i in instruments} invest[t, i, s]) = (if t = 0 then budget else sum {i in instruments} return[t, i, s]*invest[t-1, i, ancestor[t, s]] + if t = T then under[s] - over[s] + target); © 2006 H. I. Gassmann
OSi. L Schema • Written in XML • Very flexible • Intended to handle as many types of mathematical programs as possible – Linear and integer – Nonlinear – Stochastic –… © 2006 H. I. Gassmann
OSi. L Schema – Header information © 2006 H. I. Gassmann
Header information – Example <? xmlversion="1. 0"encoding="UTF 8"? > <osil xmlns="os. optimizationservices. org“ xmlns: xsi=http: //www. w 3. org/2001/XMLSchemainstance xsi: schema. Location="OSi. L. xsd"> <instance. Header> <name>Financial. Plan_John. Birge</name> <source> Birge and Louveaux, Stochastic Programming </source> <description> Three-stage stochastic investment problem </description> </instance. Header > <instance. Data>. . . </instance. Data> </osil> © 2006 H. I. Gassmann
OSi. L Schema – Deterministic data … © 2006 H. I. Gassmann
Instance data – Constraints, objectives, variables <variables number. Of. Variables="8"> <var name="invest 01" type="C" lb="0. 0"/> <var name="invest 02"/> <var name="invest 11"/> <var name="invest 12"/> <var name="invest 21"/> <var name="invest 22"/> <var name="w"/> <var name="u"/> </variables> <objectives number. Of. Objectives="1"> <obj max. Or. Min="max" number. Of. Obj. Coef= "2" lb="0. 0"> <coef idx="6"/>1. </coef> <coef idx="7"/>-4. </coef> </objectives> <constraints number. Of. Constraints="4"> <con name="budget 0" lb="55" ub="55"/> <con name="budget 1" lb="0" ub="0"/> <con name="budget 2" lb="0" ub="0"/> <con name="budget 3" lb="80" ub="80"/> </constraints> © 2006 H. I. Gassmann
Instance data – Core matrix (sparse matrix form) <linear. Constraint. Coefficients number. Of. Values=“ 14"> <start> <el>0</el> <el>2</el> <el>4</el> <el>6</el> <el>8</el> <el>10</el> <el>12</el> <el>13</el> <el>14</el> </start> <row. Idx> <el>0</el> <el>1</el> <el>2</el> <el>3</el> </row. Idx> © 2006 H. I. Gassmann <value> <el>1</el> <el>1. 25</el> <el>1</el> <el>1. 14</el> <el>1</el> <el>1. 25</el> <el>1. 14</el> <el>1</el> <el>-1</el> </value>
OSi. L Schema – Dynamic structure © 2006 H. I. Gassmann
Dynamic information – Example <stages number. Of. Stages="4"> <stage> <variables number. Of. Variables="2" start. Idx="0" end. Idx="1"/> <constraints number. Of. Constraints="1" start. Idx="0"/> </stage> <variables number. Of. Variables="2" start. Idx="2" end. Idx="3"/> <constraints number. Of. Constraints="1" start. Idx="1"/> </stage> <variables number. Of. Variables="2" start. Idx="4" end. Idx="5"/> <constraints number. Of. Constraints="1" start. Idx="2"/> </stage> <variables number. Of. Variables="2"> <var idx="6"> <var idx="7"> </variables> <constraints number. Of. Constraints="1" start. Idx="3"/> </stages> © 2006 H. I. Gassmann
Explicit and implicit event trees © 2006 H. I. Gassmann
Scenario trees © 2006 H. I. Gassmann
Scenario tree – Example <stochastic. Information decision. Even. Sequence="Decision. After. Event"> <event. Tree> <scenario. Tree number. Of. Scenarios="8"> <root. Scenario prob="1" stage="0"/> <scenario prob="0. 5" stage="3" parent="0"> <linear. Constraint. Coefficients> <el row. Idx="3" col. Idx="4">1. 06</el> <el row. Idx="3" col. Idx="5">1. 12</el> </linear. Constraint. Coefficients> </scenario> <scenario prob="0. 5" stage="2" parent="0"> … © 2006 H. I. Gassmann
Node-by-node representation for stochastic problem dimensions © 2006 H. I. Gassmann
Node-by-node – Example <stochastic. Information decision. Even. Sequence="Decision. After. Event"> <event. Tree > <nodal. Tree> <s. Node prob="1" base="core. Program"> <s. Node prob="0. 5" base="core. Program"/> <s. Node prob="0. 5" base="first. Sibling"> <changes> <el row. Idx=“ 3" col. Idx="4">1. 06</el> <el row. Idx="3" col. Idx="5">1. 12</el> </changes> </s. Node> … © 2006 H. I. Gassmann
Distributions (implicit tree) © 2006 H. I. Gassmann
Discrete random vector <distributions> <multivariate> <distr stage="1"> <multi. Dimensional. Distribution. Group> <multivariate. Discrete> <scenario> <prob>0. 5</prob> <el>1. 25</el> <el>1. 14</el> </scenario> <prob>0. 5</prob> <el>1. 06</el> <el>1. 12</el> </scenario> </multivariate. Discrete> </multi. Dimensional. Distribution. Group> </distr> … </multivariate> </distributions> © 2006 H. I. Gassmann
Transformations – p = f(v) © 2006 H. I. Gassmann
Linear transformation – Example <stochastic. Transformation> <linear. Transformation> <stochastic. Elements number. Of. Elements="6"> <el row. Idx="1" col. Idx="0"/> <el row. Idx="1" col. Idx="1"/> <el row. Idx="2" col. Idx="2"/> <el row. Idx="2" col. Idx="3"/> <el row. Idx="3" col. Idx="4"/> <el row. Idx="3" col. Idx="5"/> </stochastic. Elements> <matrix. Coefficients number. Of. Elements="6"> <start> <el>0</el> <el>1</el> <el>2</el> <el>3</el> <el>4</el> <el>5</el> <el>6</el> </start> <row. Idx> <el>0</el> <el>1</el> <el>2</el> <el>3</el> <el>4</el> <el>1</el> </row. Idx> <value> <el mult=“ 6">1. 0</el> </value> </matrix. Coefficients> </linear. Transformation> </stochastic. Transformation> © 2006 H. I. Gassmann
Penalties and probabilistic constraints © 2006 H. I. Gassmann
Capabilities • • Arbitrary nonlinear expressions Arbitrary distributions Scenario trees Stochastic problem dimensions Simple recourse Soft constraints with arbitrary penalties Probabilistic constraints Arbitrary moment constraints © 2006 H. I. Gassmann
Nonlinear expression – (x 0 – x 12)2 + (1 – x 0)2 <plus> <power> <minus> <var coef="1. 0" idx="0"/> <power> <var coef="1. 0" idx="1"/> <number value="2"/> </power> </minus> <number value="2"/> </power> <minus> <number value="1"/> <var coef="1. 0" idx="0"/> </minus> <number value="2"/> </power> </plus> © 2006 H. I. Gassmann
Further work • • • Readers Internal data structures Solver interfaces Library of problems Buy-in © 2006 H. I. Gassmann
QUESTIONS? http: //www. optimizationservices. org http: //myweb. dal. ca/gassmann © 2006 H. I. Gassmann
- Slides: 34