You are on page 1of 82

Models and Algorithms for Stochastic Programming

Jeff Linderoth
Dept. of Industrial and Systems Engineering Univ. of Wisconsin-Madison linderoth@wisc.edu Enterprise-Wide Optimization Meeting Carnegie-Mellon University March 10th, 2009

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

1 / 82

Mission Impossible

Explaining Stochastic Programming in 90 mins I will try to give an overview please interrupt with questions!

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

2 / 82

What Ill Ramble On


Models How to deal with uncertainty Why modeling uncertainty is important Who has used stochastic programming? Why more people dont use stochastic programming

Algorithms Extensive Form Benders Decomposition (2-stage) Sampling Nested Benders Decomposition (multistage)

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

3 / 82

Dealing with Uncertainty

Denition of Stochastic Programming

Etymology

program:
(3) An ordered list of events to take place or procedures to be followed; a schedule
Late Latin programma, public notice, from Greek programma, programmat-, from prographein, to write publicly

stochastic:
(1b) Involving chance or probability
Greek stokhastikos, from stokhasts, diviner, from stokhazesthai, to guess at, from stokhos, aim, goal.

Source: The American Heritage Dictionary of the English Language, Fourth Edition.

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

4 / 82

Dealing with Uncertainty

Sources of Uncertainty

Sources of Uncertainty
Houston, we have uncertainty! What we anticipate seldom occurs; what we least expected generally happens. Benjamin Disraeli (1804 - 1881) Financial
Market price movements Defaults by a business partner

Market Related
Shifts in tastes

Competition
What will your competitors strategy be next year?

Operational
Customer demands, Travel times

Technology related
Will a new technology be ready in time

Acts of God: Jes travel experience yesterday!!!


Weather Equipment failure Birds ying into planes
CMU-EWO 5 / 82

Je Linderoth (UW-Madison)

Models & Algs. for SP

Dealing with Uncertainty

Sources of Uncertainty

Stochastic Programming
A tool used in planning under uncertainty More specically: Mathematical Programming, or Optimization, in which some of the parameters dening a problem instance are random, or uncertain Optimization min f(x)
xX

Stochastic Optimization min F(x, )


xX()

x: Variables you control

: Variables you dont control

Stochastic Optimization is UNDEFINED You cant possibly choose an x that optimizes for all More speciation is required
Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 6 / 82

Dealing with Uncertainty

Sources of Uncertainty

Jes Stochastic Programming Assumptions


In stochastic programming, we assume that a probability distribution for the uncertainty is known or can be approximated. We also assume that probabilities are independent of the decisions that are taken. Decision-dependent uncertainty Decisions inuence probability distributions Decisions inuence knowledge discovery Talk to Ignacio! Want to know about stochastic programming with decision-dependent uncertainty?
Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 7 / 82

Dealing with Uncertainty

Sources of Uncertainty

Probability Theory(?)

This notion of having to know a probability distribution for the randomness is troubling, since in reality, very few people exactly know that
Their customer demands follow a log-normal distribution with mean 17.26 and variance 2.88726 Their plant will have forced shutdowns following a Weibull distribution with parameters (100.25, 73.7916)

Instead, you might be able to


Estimate distributions from historial data (be careful!) Have qualitative probability measures (low/medium/high) Create your own scenarios of interest

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

8 / 82

Dealing with Uncertainty

Sources of Uncertainty

The Journey is the Reward?


Business process people can argue/discuss amongst themselves what the various scenarios might be and the outcomes of those scenarios. This process by itself can be very useful There is a good amount of frightening-looking mathematical theory and computational evidence that solutions obtained from stochastic programs are often quite stable with respect to changes in the input probability distribution The Upshot It doesnt matter too much if your numbers arent quite right The insights you gain from considering the uncertainty can still be valuable
Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 9 / 82

Dealing with Uncertainty

Related Decision Making Technologies

A Concrete Example: An Uncertain LP


min cx s.t. Ax b T ()x h() x0 T () and h() are uncertain: X() = {x | Ax b, T ()x h()} We must choose x despite this uncertainty Examples:
Decide production quantities before knowing demands Constraint data includes imprecise measurements

Three Approaches
1 2 3

Robust optimization Chance-constrained programming Recourse-based stochastic programming


Models & Algs. for SP CMU-EWO 10 / 82

Je Linderoth (UW-Madison)

Dealing with Uncertainty

Related Decision Making Technologies

Robust Optimization
Uncertain data is assumed to lie in an uncertainty set (T (), h()) U Guarantee that constraints be satised for all possible realizations min cx s.t. Ax b Tx h (T, h) U x0 Tractability depends on structure of U

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

11 / 82

Dealing with Uncertainty

Related Decision Making Technologies

Robust Optimization

To control conservatism, uncertainty set can be parameterized by a budget of uncertainty Example 1: Tij () [lij , uij ] (Bertsimas and Sim)
At most K of the components in each row can dier from the nominal value Nature can choose which K will dier K large highly conservative (Soyster) K = 0 No robustness Can formulate this problem as a linear program

Example 2: U is ellipsoidal (Ben-Tal and Nemirovski)

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

12 / 82

Dealing with Uncertainty

Related Decision Making Technologies

Robust Optimization

Advantages: Computationally tractable Can yield extremely reliable solutions Does not require stochastic model Disadvantages: Does not use a stochastic model Although conservatism can be controlled, the control parameter doesnt have meaning to decision makers

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

13 / 82

Dealing with Uncertainty

Related Decision Making Technologies

Stochastic Programming
Assume uncertain data are random variables with known distributions Two approaches to uncertain constraints:
1

Require constraint to be satised with high probability min {cx : x X, P{T ()x h()} 1 } is a parameter, e.g. = 0.05 or = 0.01 Linear program with probabilistic (chance) constraints

Penalize violations of constraints min cx + E[(h() T ()x)+ ] : x X Special case of a Two stage stochastic program

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

14 / 82

Dealing with Uncertainty

Related Decision Making Technologies

Linear Programs with Probabilistic Constraints

Individual constraints: min cx : x X, P{T ()i x h()i } 1 Joint constraints: min {cx : x X, P{T ()x h()} 1 } Bad news: calculating probability is hard Worse news: probabilistic constraints are generally non-convex!
i

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

15 / 82

Dealing with Uncertainty

Related Decision Making Technologies

Non-convexity of the feasible region


Consider: P{x1 1 , x2 2 } 0.6 Each dot: a realization of which occurs with probability 1/10 x2

x1

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

16 / 82

Dealing with Uncertainty

Related Decision Making Technologies

Two Stage Stochastic Programming


(SP) min cx + E[(h() T ()x)+ ] : x X

Choose x Observe (T (), h()) Pay penalty Good news: (SP) is convex Bad news: Calculating expectation is hard Successful Approach: Sample Average Approximation Generate (T ()1 , h()1 ), . . . , (T ()N , h()N ) and solve
N

(SPN )

min cx +
i=1

1 (h()i T ()i x)+ : x X N

x is a often a good approximation to true optimal solution N Well see (a lot) more later!
Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 17 / 82

Dealing with Uncertainty

Related Decision Making Technologies

Stochastic Programming vs. Simulation


Simulation
(Pro): Very exibleSystem need not be mathematically dened (Pro): Fast (Con): If I run 100 what-ifs and get 100 dierent solutions, how does simulation help me plan for the future?

Stochastic Programming
(Con): More challenging to build and solve models (Pro): SP helps you optimize over your what-ifs.

The Upshot! Use simulation to generate scenarios. Input the scenarios to a stochastic program to show how to decide how to best hedge against this uncertainty

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

18 / 82

Dealing with Uncertainty

Related Decision Making Technologies

Multistage Decision Making


1 x1 2 x2 3 xT 1 T xT Random vectors 1 Rn1 , 2 Rn2 , . . . , T RnT Make sequence of decisions x1 X1 , x2 X2 , . . . , xT XT .

The evolution of information is of fundamental importance to the decision-making progress. We make a decision now (x1 ) Nature makes a random decision 2 : (stu happens) We make a second period decision x2 that attempts to repair the havoc wrought by nature in (recourse). Repeat as necessary... We make decisions in stages, in between which uncertainty is revealed to us
Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 19 / 82

Why use Stochastic Programming

The Newsvendor

Hot O the Presses


A paperboy (newsvendor) needs to decide how many papers to buy in order to maximize his prot. He doesnt know at the beginning of the day how many papers he can sell (his demand).
Each newspaper costs c. He can sell each newspaper for a price of q. He can return each unsold newspaper at the end of the day for r. (Obviously r < c < q).

The Newsvendor Problem Given only knowledge of the probability distribution F of demand, how may papers should the newsvendor buy?

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

20 / 82

Why use Stochastic Programming

The Newsvendor

Newsvendor Problem

Suppose that the newsvendors goal is to maximize the prots in the long run. (In expectation)... Intuitively, it seems that the newsvendors best strategy is to every purchase the average demand Take Away Message! The optimal solution is NOT to use the mean demand. In fact, the two solution can be far apart. (Depending on the distribution, and parameters r, c, q

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

21 / 82

Why use Stochastic Programming

The Newsvendor

ExampleThe Newsvendor
c = 50, q = 70, r = 5 Demand: (Truncated) Normal distributed. = 100, = 50 Mean Value Solution
Buy 100. Expect to prot: 2000 TRUE long run prot 650 (Duh!)

Stochastic Solution
Buy 75. Expect to prot: 1500 TRUE long run prot 880

The dierence between the two solutions (880 650) is called the value of the stochastic solution.
How much is it worth to you to plan using full uncertainty information as opposed to mean-values for the uncertain parameters
Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 22 / 82

Why use Stochastic Programming

The Newsvendor

A Take Away Message


The Flaw of Averages The aw of averages occurs when uncertainties are replaced by single average numbers planning.
Did you hear the one about the statistician who drowned fording a river with an average depth of three feet.

Point Estimates If you are planning with point estimates for demands, then you are planning sub-optimally It doesnt matter how carefully you choose the point estimate it is impossible to hedge against future uncertainty by considering one realization of the uncertainty in your planning process

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

23 / 82

Stochastic Programming Success Stories

Financial Optimization

Russell-Yasuda Kasai

Yasuda Kasai: Seventh largest (worldwide) property and casualty insurer. Assets of > 3.47 trillion Liability structure is complex, but want a tool that will allow them to maximize the revenue from these assets in the face of asset management restrictions Frank Russell Company hired to develop Asset-Liability Management Model based on (multistage) stochastic programming Carino, Myers, Ziemba, Second place in Edelman prize competition of INFORMS.

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

24 / 82

Stochastic Programming Success Stories

Financial Optimization

Asset Allocation Model


Decisions:
Investment amounts for various assets

Random Events:
Return on investment for each asset. Liability payouts

Constraints:
Asset Allocation Constraints (Complex) Loan Model Liability Model

Compared to a performance benchmark established at Yasuda Kasai at the beginning of the Fiscal Year to measure the value added by their use of the model, the new model increased annual income by 9.5 billion.
Mr. Kunihiko Sasamoto, Director and Deputy President, Yasuda Kasai.
Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 25 / 82

Stochastic Programming Success Stories

Financial Optimization

But Wait Theres More!

Ease of Use
Risk is well dened, not using some abstract measure like standard deviation

Improved other systems


Other models and IT systems upgraded to support new system

Improved Human Judgement


How to think about and incorporate uncertainty into the planning process

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

26 / 82

Stochastic Programming Success Stories

Financial Optimization

Product Portfolio Planning

Decisions:
Invest in various projects (All or nothing investment). Complicated project prerequisite structure

Random Events:
Design-win from customers Technology failures Market forces

(HUGE

impact)

Constraints:
Resources Hire-re costs

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

27 / 82

Stochastic Programming Success Stories

Financial Optimization

Product Portfolio Management at Agere

We implemented a decision support tool for Agere


1 2

Optimization Model Simulator of future conditions (random events were correlated!)

The muckety-mucks loved it! They like the ability to talk about the dierent scenarios. Focuses discussion in business planning meetings Gives unbiased simulator view of potential outcomes of decisions

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

28 / 82

Stochastic Programming Success Stories

Logistics

SP in the Supply Chain

Decisions:
Regular supply chain decision: How much? where? and when?

Random Elements:
Demands, prices, resource capacity. Supply chains going global imply that companies are now more exposed to risky factors such as exchange rates and reliability of transfer channels.

Constraints:
Regular supply chain constraints: Flow balance, material availability, etc.

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

29 / 82

Stochastic Programming Success Stories

Logistics

A Case Study
T. Santoso, S. Ahmed, M. Goetschalckx, and A. Shapiro. A Stochastic Programming Approach for Supply Chain Network Design under Uncertainty, European Journal of Operational Research, vol.167, pp.96-115, 2005.

Two real supply chains


One Domestic (Cardboard packages to breweries and soft drink manufacturers...) One global

Sizes: Around 100 facilities. Around 100 customers, In general, the (sampled) stochastic model was roughly 5% better than using the mean value of demand, translating into millions of dollars in potential savings.

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

30 / 82

Stochastic Programming Success Stories

Logistics

Supply Chain Projects


Bulk Gas Production and Distribution
Uncertainty in customer demands, competitor drain Built (prototype) optimization model and simulator. They are now(?) doing a real implementation

Lesson Learned Having a (static) simulation of the production-disribution process is a key component to the project

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

31 / 82

Stochastic Programming Success Stories

Other Industries

Other Industrial Applications of SP


Energy Industry
Unit Commitment Problem: Schedule production from power generation units

Telecommunication
Capacity/bandwidth planning: Invest in capacity for the network before you know the true bandwidth demands

Military
Network Interdiction Problem: Where to place agent on a network to interrupt evil-doers

It aint that rosy As far as I know, mot implementations are built on a case-by-case basis and are fairly ad-hoc.

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

32 / 82

Why More People Dont Use SP

Stochastic Programming ObjectivesRisk Prole


What is your goal?
1

I want to do well on average


Expected Value

I want to limit my exposure in the worst case or cases


Value at Risk/Conditional Value at Risk

I want the probability that I achieve a goal to be suciently high?


Chance constraints

I want to achieve a steady return?


Dispersion-based objectives

Each of these imply a dierent notion of risk, and lead to dierent stochastic optimization problems Stochastic Programming isnt about getting a number, its about getting a distribution that looks good to you
Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 33 / 82

Why More People Dont Use SP

Some SP Objectives

min F(x, ) min E F(x, ) min E F(x, ) (F(x, ))


(F(x, )) = VarF(x, ) (F(x, )) = E [(EF(x, ) F(x, ))+ ]

Mean-Value Problem Risk Neutral Risk Measures


Markowitz Semideviation

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

34 / 82

Why More People Dont Use SP

Things People Want

Conditio

l bl rob Pro knli rp N tworo nea ege r prInble Ne o t ms

s em

s em

S tochastic Con trol

J oint D istrib ut

(Jo

in

t)

Ch an c

Program m g in r tra rbi A ce ization astic Dominan Robust Optim Stoch

Co n

yD

uti trib is

tochastic Dyna mic

st ra in ts

ions

Je Linderoth (UW-Madison)

Models & Algs. for SP

V alue at Risk io e Beer Scenar re Trees F s on

nal)

CMU-EWO

35 / 82

Why More People Dont Use SP

Supporting Stochastic Programs

I point out all these dierent avors of SP to highlight what I think has been one of the hinderances of having a modeling laguage for SP. I dont know the key to success, but the key to failure is trying to please everybody. Bill Cosby (1937 - ) I believe the fact that a stochastic program is not a well-dened concept is one of the fundamental reasons why more people dont use stochastic programming Other reasons people dont use stochastic programming?

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

36 / 82

Why More People Dont Use SP

Why Dont More People Use Stochastic Programming


They dont start their training early enough!

Jacob Linderoth, age 4 months, reading Introduction to Stochastic Programming


Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 37 / 82

Why More People Dont Use SP

Barriers to Stochastic Programming

Why Dont More People Use Stochastic Programming

Because they dont know the probability distribution?


Even crude approximations can help

Because they cant solve them?


Linderoth and Wright solve a 10-million scenario problem Recent theory suggests that you dont need to include many scenarios to get an accurate solution to the true problem

Because they cant model them?


Modeling tools are on the way (more later)

Because it is hard to verify that the solution is better


The same could be said of Deterministic Optimization Use simulation to verify that the solution is better

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

38 / 82

Why More People Dont Use SP

Barriers to Stochastic Programming

Probability Management
A true believer is Sam Savage (consulting professor at at Stanford). He believes companies should have a comprehensive probability management plan. Probability Management Simulations to generate distributions Information systems to hold distributions of key uncertain inputs A Chief probability ocer responsible for signing o on the distributions You can start small... 1 What are your scenarios and distributions?
2

Do you have models that can use this information?


Models & Algs. for SP CMU-EWO 39 / 82

Je Linderoth (UW-Madison)

Algorithms

ALGORITHMS
I focus almost exclusively on two-stage recourse problems

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

40 / 82

Algorithms

Two-Stage Stochastic Programs with Recourse

Stochastic Programming
A Stochastic Program min{E F(x, )}
xX

2 Stage Stochastic LP w/Recourse F(x, ) = c x + Q(x, )


def T

The Recourse Problem Q(x, ) = min qT y


def

cT x: Pay me now Q(x, ): Pay me later Expected Recourse Function:

Wy = h() T ()x y 0

Q(x) = E [Q(x, )] Two-Stage Stochastic LP


Je Linderoth (UW-Madison) Models & Algs. T SP for CMU-EWO 41 / 82

def

Algorithms

Extensive Form

Extensive Form
Assume = {1 , 2 , . . . S } Rr , P( = s ) = ps , s = 1, 2, . . . , S Ts T (s ), hs = h(s ) Then can write extensive form:
cT x s.t. Ax T1 x T2 x . . . TS x xX + p1 qT y1 + p2 qT y2 + + ps qT ys = = = .. y2 Y . + y1 Y Wys ys Y = b h1 h2 . . . hs

Wy1 + + Wy2

The Upshot! This is just a larger linear program It is a larger linear program that also has special structure
Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 42 / 82

Algorithms

Extensive Form

Best-Known Solution Procedure

M E T H O D

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

43 / 82

Algorithms

Extensive Form

Small SPs are Easy!


70

60

Cplex/Extensive Form
50

Time

40

Lshaped
30

20

10

50

100

150

200

250

300

number of scenarios

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

44 / 82

Algorithms

The LShaped Method

Two-Stage Stochastic Linear Programming


We assume that the P has nite support, so has a nite number of possible realizations (scenarios):
N

Q(x) =
i=1

pi Q(x, i )

For a partition of the N scenarios into sets N1 , N2 , . . . Nt , let Q[j] (x) be the contribution of the jth set to Q(x): Q[j] (x) =
t j=1 Q[j] def iNj

pi Q(x, i )

so then Q(x) =

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

45 / 82

Algorithms

The LShaped Method

Important (and well-known) Facts


Q(x, i ), Q[] (x), and Q(x) are piecewise linear convex functions of x. If i is an optimal dual solution to the linear program corresponding to Q(^, i ), then TiT i Q(^, i ) x x
gj (^) = x
def iNj T pi Ti i Q[j] (^). x

Key Idea Represent Q[j] (x) by an articial variable j and nd supporting planes for j
j Q[j] (xk ) + gj (xk )T (x xk ) ()

Point of Decomposition Evaluation of Q(^) is separable x We can solve linear programs corresponding to each Q(^, i ) x independently in parallel!
Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 46 / 82

Algorithms

The LShaped Method

Worth 1000 Words?

Q(x)

x
Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 47 / 82

Algorithms

The LShaped Method

Worth 1000 Words

Q(x)

x
Je Linderoth (UW-Madison)

xk
Models & Algs. for SP CMU-EWO 48 / 82

Algorithms

The LShaped Method

Worth 1000 Words

Q(x)

x
Je Linderoth (UW-Madison)

x2

x1

Models & Algs. for SP

CMU-EWO

49 / 82

Algorithms

The LShaped Method

(Multicut) L-shaped method


M
1

s1

s2

s3

s4

s5
2

Solve the master problem M with the current approximation to Q(x) for xk . Solve the subproblems, (sj ) evaluating Q(xk ) and obtaining subgradient(s) to update master approximation M k = k+1. Goto 1.

M
3

Lets Get Parallel! Of course, solution of sj can be carried out independently.


Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 50 / 82

Algorithms

The LShaped Method

Warning!
If Q(x) is not convex, then this algorithm doesnt work If you have a integer recourse variables y Zp Rnp , the problem becomes signicantly more dicult. Your Options Give your favorite solver the full extensive form (and pray)
Weak relaxation

Decomposition method: Care and Schultz, Sen Spatial branch and bound: Talk to Nick! Want to know about stochastic integer programming/spatial branch and bound?
Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 51 / 82

Algorithms

The LShaped Method

Does it Work? The Worlds Largest LP


Linderoth and Wright built a fancy decomposition-based solver capable of running on the grid Storm A stochastic cargo-ight scheduling problem (Mulvey and Ruszczyski) n We aim to solve an instance with 10,000,000 scenarios x R121 , yk R1259 The deterministic equivalent LP is of size

A R985,032,88912,590,000,121

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

52 / 82

Algorithms

The LShaped Method

The Super Storm Computer


Number 184 254 36 265 88 239 124 90 13 9 10 33 1345 Type Intel/Linux Intel/Linux Intel/Linux Intel/Linux Intel/Solaris Sun/Solaris Intel/Linux Intel/Solaris Sun/Solaris Intel/Linux Sun/Solaris Intel/Linux Location Argonne New Mexico NCSA Wisconsin Wisconsin Wisconsin Georgia Tech Georgia Tech Georgia Tech Columbia U. Columbia U. Italy (INFN)

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

53 / 82

Algorithms

The LShaped Method

TA-DA!!!!!

Wall clock time CPU time Avg. # machines Max # machines Parallel Eciency Master iterations CPU Time solving the master problem Maximum number of rows in master problem

31:53:37 1.03 Years 433 556 67% 199 1:54:37 39647

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

54 / 82

Algorithms

The LShaped Method

Number of Workers
600

500

400 #workers

300

200

100

0 0 20000 40000 60000 Sec.


Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 55 / 82

80000

100000

120000

140000

Sampling

Why Sampling is Necessary


ys y(s ) is the recourse action to take if scenario s occurs. Pro: Its a linear program. Con: Its a BIG linear program. Imagine the following (real) problem. A Telecom company wants to expand its network in a way in which to meet an unknown (random) demand. There are 86 unknown demands. Each demand is independent and may take on one of ve values. S = || = 86 (5) = 586 = 4.77 1072 k=1
The number of subatomic particles in the universe.

How do we solve a problem that has more variables and more constraints than the number of subatomic particles in the universe?

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

56 / 82

Sampling

But Its Even Worse!


The answer is we cant! If is not a countable set say if it is made up of continuous-valued random variables, our deterministic equivalent would have variables and constraints. :-) We solve an approximating problem obtained through sampling. The Very Good News Using Monte-Carlo methods (Sample Average Approximation), we can obtain high-quality solutions Even Better: Can obtain (statistical) bounds on the quality of the solution

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

57 / 82

Sampling

Sample Average Approximation(SAA)

The Story Solving two-stage SP exactly is often impossible Solving two-stage SP approximately is often easy: Sample Average Approximation (SAA)

I view SAA as the Je Linderoth of solution methods


It aint smart It aint sexy But it generally does work!

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

58 / 82

Sampling

SAA for Dummies


Let v be the optimal solution to the true problem: v = min f(x) = E F(x, )
xX def def

Take a sample (1 , ..., N ) of N realizations of the vector , and form the sample average function
N

fN (x) = N1
j=1

def

F(x, j )

For Stochastic LP w/recourse, evaluate fN (x) solve one LP for each of N scenarios

Optimize sample average function: def def vN = min fN (x) = N1 xX


Je Linderoth (UW-Madison) Models & Algs. for SP

j=1

F(x, j )
CMU-EWO 59 / 82

Sampling

SAA for Dummies, Cont.

Note that vN is a random variable, as it depends on the (random) sample of size N From this information, we can get bounds on the optimal solution value v

All Good Talks Contain... Thm. E(vN ) v f(x) x

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

60 / 82

Sampling

Making SAA Work


Take a solution x from a SAA instance ^ We are mostly interested in estimating the quality of a given solution x. This is f(^) v . ^ x
1

Get upper bound on v from f(^). Estimate f(^) by solving N x x (completely independent) linear programsrecourse LPs with x xed. ^
N

fN (^) = (N )1 x
j=1
2

def

F(^, j ) x

Get a lower bound on v from E(vN ). Estimate E(vN ) by solving M independent stochastic LPs, giving optimal values v1 , v2 , . . . vM N N N
M

E(vN ) = M1
j=1

def

vj N

Independent no synchronization good for the Grid


Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 61 / 82

Sampling

More Theory
A very interesting result of Shapiro and Homem-de-Mello says the following: Suppose that x is the unique optimal solution to the true problem Let xN be the solution to the sampled approximating problem ^ Under certain conditions, the event (^N = x ) happens with x probability 1 for N large enough. The probability of this event approaches 1 exponentially fast as N !! There exists a constant such that
N

lim N1 log[1 P(^ = x )] . x

This is a qualitative result indicating that it might not be necessary to have a large sample size in order to solve the true problem exactly. For a problem with 51000 scenarios a sample of size N 400 is required in order to nd the true optimal solution with probability 95%!!!
Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 62 / 82

Sampling

Does SAA Work on Real Problems?


M = 10 times Solve a stochastic sampled approximation of size N. Compute condence interval on lower bound estimate E(vN ) Choose one x from solution to M SAA instances and compute ^ condence interval on upper bound estimate fN (^), with N = 10000 x Test Instances Name LandS gbd storm 20term ssn Application HydroPower Planning Aircraft Allocation Cargo Flight Scheduling Vehicle Assignment Telecom. Network Design || 106 6.46 105 6 1081 1.1 1012 1070

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

63 / 82

Sampling

20term Convergence
255500 255000 254500 254000 Value 253500 253000 252500 252000 251500 10 100 N 1000 10000 Lower Bound Upper Bound

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

64 / 82

Sampling

ssn Convergence
18 16 14 12 Value 10 8 6 4 2 10 100 N 1000 10000 Lower Bound Upper Bound

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

65 / 82

Sampling

storm Convergence
1.555e+06 1.554e+06 1.553e+06 1.552e+06 1.551e+06 Value 1.55e+06 1.549e+06 1.548e+06 1.547e+06 1.546e+06 1.545e+06 1.544e+06 10 100 N 1000 10000 Lower Bound Upper Bound

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

66 / 82

Sampling

gbd Convergence
1800 Lower Bound Upper Bound

1750

1700 Value

1650

1600

1550

1500 10 100 N 1000 10000

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

67 / 82

Multistage SPs

Multistage Stochastic LP
1 x1 2 x2 3 xT 1 T xT Random vectors 1 Rn1 , 2 Rn2 , . . . , T RnT Make sequence of decisions x1 X1 , x2 X2 , . . . , xT XT .

Risk Neutral: We always aim to optimize the expected value of our current decision xt Linear: Assume Xt are polyhedra Discrete: Assume t are drawn from a discrete distribution. The Hard Part Decisions made at period t (xt ) must only depend on events and decisions up to period t
Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 68 / 82

Multistage SPs

The Stickler. My Favorite Eight Syllable Word.


We need to enforce nonanticipativity. Other eight-syllable words...
autosuggestibility, incommensurability, electroencephalogram, unidirectionality

At any point in time, dierent scenarios look the same


We cant allow dierent decisions for these scenarios. We are not allowed to anticipate the outcome of future random events when making our decision now.

How to do it? 1 Use Tree Structure (Nested Decomposition)


2

Create (extra) variables for all possible scenarios, and enfroce equality between decisions that should be nonanticipative (Progressive Hedging)
Models & Algs. for SP CMU-EWO 69 / 82

Je Linderoth (UW-Madison)

Multistage SPs

Scenario Tree
N: Set of nodes in the tree (n): Unique predecessor of node n in the tree S(n): Set of successor nodes of n x0 ^ 1 ^ 2 x(n) Warning! Scenario Trees can get big There are some tools that try and prune the tree while keeping similar statistical properties in the stochastic process
Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 70 / 82

qn : Probability that the sequence of events leading to node n occurs xn xn : Decision taken at node n

Multistage SPs

Multistage Stochastic Programming


Entensive Form zSP = min
nN

qn cT xn n

Tn x(n) + Wn xn = hn n N

Value Function of node n


Qn (x(n) ) = min cT xn + n xn
def

qmn Qm (xn ) | Wn xn = hn Tn x(n) ^

mS(n)

qmn : conditional probability of node n given node m ^

Tree structure encodes nonanticipativity


Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 71 / 82

Multistage SPs

Algorithm

Nested Decomposition
0: Root node of the scenario tree x0 : Initial state of the system Recursive Formulation zSP = Q0 (x0 ) Cost to go: Gn (x) = Mk (x): n
def

^ mS(n) qmn Qm (x)

Lower bound on Gn (x) in iteration k

Qn (x(n) ) min cT xn + Mk (xn ) n n


xn

Wn xn = hn Tn x(n)

((MLPn ))

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

72 / 82

Multistage SPs

Algorithm

Building Mk (x) n
Create a partition (or clustering Cn ) of S(n) A lower bound mk for each element of the partition (each cluster) n[j] is created independently Mk (x) = n
def def jCn

mk (x) n[j]

mk (x) = inf j n[j]

j e Fk x + fk n[j] n[j]

Fk , fn[j] obtained from dual solutions (to form subgradients) of n[j] linear programs of nodes within cluster [j] Mk (x ) Gn (x ) n
Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 73 / 82

Multistage SPs

Algorithm

Action Pictures

x0

1 x0

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

74 / 82

Multistage SPs

Algorithm

small

Multistage Telecom Problem

A B C E D F

Set of stages T Set J of links Sets It of demands Random demand dt () R|It | Budget each period Install capacity on links each period to minimize the total expected unserved demand

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

75 / 82

Multistage SPs

Algorithm

Some

(Limited)

Computational Results

T =5 K: Realizations/Period N: Number of scenarios DE: Size of deterministic equivalent

K 30 50 60

N 0.81M 6.25M 12.9M

DE Size 18M * 31M 140M * 236M 290M * 488M

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

76 / 82

Multistage SPs

Algorithm

Computational Results

It: Number of iterations (Times MLP0 was solved) E: Parallel eciency. Time machines solving MLPn Time machines available
K 30 50 60 It 9 7 11 Avg Workers 62 75 162 Wall Time 2:34:21 1:12:49:27 3:16:51:00 CPU Time 6:15:15:10 85:20:24:15 431:12:15:37 E 67 77 73

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

77 / 82

Multistage SPs

Modeling Tools

Existing Modeling Tools


Many stochastic programming implementations Im aware of have been built from scratch But there are some modeling tools on the way

Name AIMMS Gams MPL XPRESS-SP SPiNE STRUMS SUTIL SLPLib COIN-Smi, SP/OSL

Author(s) AIMMS Team Gams Team Kristjensen Verma, Dash Opt. Valente, CARISMA Fourer and Lopes Czyzyk and Linderoth Felt, Sarich, Ariyawansa COIN, IBM

Comment Commercial Commercial Commercial Commercial, Beta Prototype(?) C++ classes Open Source C Routines C++ methods

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

78 / 82

Multistage SPs

Modeling Tools

Existing Solution Tools

Most stochastic programming implementations of which Im aware, merely form and solve extensive form Other software:

Name AIMMS SLP-IOR MSLiP SPInE BNBS ATR

Author(s) AIMMS Team Kall, Mayer Gassmann Valente, CARISMA Altenstedt Linderoth, Wright

Comment Commercial, LShaped method LShaped, Stochastic Decomposition, others Nested LShaped Commercial, LShaped method, may not exist anymore Nested LShaped method, Open source Design to run in parallel. Not simple to build and run

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

79 / 82

Multistage SPs

Modeling Tools

Conclusions
Stochastic Programming A tool for decision making under uncertainty
Considers the impact of recourse decisions It may not be the answer, but it does help you hedge against upcoming uncertainty More importantly, it gets people talking about the impact of uncertainty in the decision making process

Planning with mean-value estimates will not lead to an optimal policy Used with some success in industry
Financial Services (Many successes) Logistics and Supply Chain (Fewer successes, but coming!)

Tools and algorithms are on the way


Je Linderoth (UW-Madison) Models & Algs. for SP CMU-EWO 80 / 82

Multistage SPs

Modeling Tools

We Want YOU!

To consider using Stochastic Programming as a decision support tool to help manage in turbulent times!

Thanks! I am happy to help. email: http://www.stoprog.org/


Je Linderoth (UW-Madison)

linderoth@wisc.edu

Models & Algs. for SP

CMU-EWO

81 / 82

Multistage SPs

Modeling Tools

Some Take Away Quotes


If a man will begin with certainty, he shall end in doubts, but if he will be content to beign with doubts, he shall end in certainties Francis Bacon

It is a good thing for the uneducated person to read books of quotations Winston Churchill

Je Linderoth (UW-Madison)

Models & Algs. for SP

CMU-EWO

82 / 82

You might also like