Você está na página 1de 17

Formulations of two-stage and multistage

Stochastic Programming

Yi Fang, Yuping Huang

Department of Industrial and Management Systems Engineering


West Virginia University

Yi Fang, Yuping Huang (IMSE@WVU) Intro. to Stochastic Programming 11/01/2012 1 / 17


Stochastic Programming

Contents
I Two-stage stochastic programming
• The farmer’s problem example
• General model formulation
I Multistage stochastic programming
• Financial planning problem example
• Node based formulation
• Scenario based formulation

Yi Fang, Yuping Huang (IMSE@WVU) Intro. to Stochastic Programming 11/01/2012 2 / 17


The farmer’s problem

• A farmer has 500 acres of land


• he should decide how many acres to use for growing wheat, corn,
and/or sugar beet
• planting an acre costs $150/acre, $230/acre, and $260/acre
respectively
• at least 200 tons of wheat and 240 tons of corn are needed to
feed cattle
• excess production is sold at $170/t and $150/t
• if less is produced, it is purchased at $238/t and $210/t
• sugar beet sells at $36/t up to 6,000t, and $10/t above that quota
• the average yield of crop are: 2.5t/acre for wheat, 3t/acre for corn,
and 20t/acre for beet
• depending on how good the weather, the yields may decrease or
increase by 20%
Yi Fang, Yuping Huang (IMSE@WVU) Intro. to Stochastic Programming 11/01/2012 3 / 17
Model

Decision Variables
• xW , xC , xB : acres of wheat, corn and sugar beet
• wWs , wCs , wBs tons of wheat, corn and beet (at favorable price) to
be sold in scenario s
• eBs tons of beets sold at lower price in scenario s
• yWs , yCs tons of wheat, corn purchased in scenario s

Yi Fang, Yuping Huang (IMSE@WVU) Intro. to Stochastic Programming 11/01/2012 4 / 17


Formulation

The objective function is to maximize the expected profit:


max −150xW − 230xC − 260xB Total acre costs
+1/3(−238yW 1 + 170wW 1 − 210yC1 + 150wC1 + 36wB1 + 10eB1 ) Scenario 1
+1/3(−238yW 2 + 170wW 2 − 210yC2 + 150wC2 + 36wB2 + 10eB2 ) Scenario 2
+1/3(−238yW 3 + 170wW 3 − 210yC3 + 150wC3 + 36wB3 + 10eB3 ) Scenario 3 (1)

Yi Fang, Yuping Huang (IMSE@WVU) Intro. to Stochastic Programming 11/01/2012 5 / 17


Formulation
First Stage (Land area limit):
xW + xC + xB 6 500 (2)

Second Stage
• Scenario 1(highest yield)

Wheat: 3xW + yW 1 − wW 1 = 200 (3)


Corn: 3.6xC + yC1 − wC1 = 240 (4)
Beet: 24xB − wB1 − eB1 = 0 (5)

• Scenario 2(neutral yield)

Wheat: 2.5xW + yW 2 − wW 2 = 200 (6)


Corn: 3xC + yC2 − wC2 = 240 (7)
Beet: 20xB − wB2 − eB2 = 0 (8)

Yi Fang, Yuping Huang (IMSE@WVU) Intro. to Stochastic Programming 11/01/2012 6 / 17


Formulation

• Scenario 3(lowest yield)

Wheat: 2xW + yW 3 − wW 3 = 200 (9)


Corn: 2.4xC + yC3 − wC3 = 240 (10)
Beet: 16xB − wB3 − eB3 = 0 (11)

• Higher-priced Beet Limit:

wB1 , wB2 , wB3 6 6000 (12)

• Variable Restriction:
All variables > 0 (13)

Yi Fang, Yuping Huang (IMSE@WVU) Intro. to Stochastic Programming 11/01/2012 7 / 17


General formulation of two-stage stochastic program

There is a set of decisions to be taken without full information on some


random events. These decisions are called first-stage decisions and
are usually represented by a vector x. Later full information is received
on the realization of some random vector ξ. Then second-stage or
corrective actions y are taken.

min cT x + Eξ Q(x, ξ)
s.t. Ax = b
x≥0

where Q(x, ξ) = min{qT yξ |Wyξ = hξ − Tξ x, yξ ≥ 0}, Eξ denotes


expectation with respect to ξ.

Yi Fang, Yuping Huang (IMSE@WVU) Intro. to Stochastic Programming 11/01/2012 8 / 17


A Three-stage Financial Investment problem
• We currently have $B for investment.
• There are three types of investment: stock,bond and saving.
• After a period, the income will vary depending on the market.

, ,

, , neutral , ,
( , , )
B

, ,

Yi Fang, Yuping Huang (IMSE@WVU) Intro. to Stochastic Programming 11/01/2012 9 / 17


A Two-stage Financial Investment problem

Variables
• xξi : the amount of money to invest i investment when the market
situation is ξ
• y : the income at the end of each period
• α, β, γ: interest rates based on three types of investment,
respectively

Example : in the period 1,


y1 = (1 + α1 )x1 + (1 + β1 )x2 + (1 + γ1 )x3
y1 = x11 + x12 + x13
in the period 2,
y11 = (1 + α11 )x11 + (1 + β11 )x12 + (1 + γ11 )x13

Yi Fang, Yuping Huang (IMSE@WVU) Intro. to Stochastic Programming 11/01/2012 10 / 17


A Two-stage Financial Investment problem

Path-based Scenario tree

Scenario 1

Scenario 2
 
1 1 1
x01 x02 x03
S1 1
x11 1
x12 1
x13
Scenario 3

Scenario 4
 
v 2
x01 2
x02 2
x03
neutral S2 2
x11 2
x12 2
x13
Scenario 5
 
Scenario 6 3 3 3
x01 x02 x03
Scenario 7
S3 3
x11 3
x12 3
x13
v
Scenario 8

Scenario 9

Yi Fang, Yuping Huang (IMSE@WVU) Intro. to Stochastic Programming 11/01/2012 11 / 17


Multistage Stochastic Programming

Financial Planning Problem


• We wish to provide for a child’s college education M years from
now
• we currently have $B to invest in any of I investments
• after M years we would like to have exceed a tuition goal of $G
• we can change investment every v years, so we have T = M/v
investment periods
• after M years, there will be an income of q% of the excess if
exceed the goal
• after M years, there will be a cost of r % of the amount short

Yi Fang, Yuping Huang (IMSE@WVU) Intro. to Stochastic Programming 11/01/2012 12 / 17


Financial Planning Problem

Variables
• xit : the amount of money to invest in investment i during period t
• y : the excess money at the end of horizon
• w: the shortage in money at the end of the horizon

Yi Fang, Yuping Huang (IMSE@WVU) Intro. to Stochastic Programming 11/01/2012 13 / 17


Scenario Tree

S3 = 1 Scenario 1

S2 = 1 S3 = 2 Scenario 2

S3 = 1 Scenario 3
S1 = 1
S2 = 2

S3 = 2 Scenario 4

S3 = 1 Scenario 5

S1 = 2 S2 = 1
S3 = 2 Scenario 6

S3 = 1 Scenario 7
S2 = 2

S3 = 2
Scenario 8

Decision Tree for three stage stochastic programming

Yi Fang, Yuping Huang (IMSE@WVU) Intro. to Stochastic Programming 11/01/2012 14 / 17


Node based formulation

• We have a vector of variables for each node in the tree


• This vector corresponds to what our decision would be given the
realization of the random variables we have seen so far
• Index the nodes l = 1, 2, . . . , L.
• We will need to know the parent of any node
• Let A(l) be the ancestor of node l ∈ L in the scenario tree

Yi Fang, Yuping Huang (IMSE@WVU) Intro. to Stochastic Programming 11/01/2012 15 / 17


Node Based Formulation
• We need to enforce nonanticipativity
• Define Sst as the set of scenarios that are equivalent to scenario s
at time t
X
max Probs (Qys − Rws )
s∈S
X
s.t. xi1 = B (1)
i∈N
X X
Cil xiA(l) = xil , ∀l ∈ L \ 1 (2)
i∈N i∈N
X
CiA(s) xiA(s) − ys + ws = G, ∀s ∈ S (3)
i∈N
xil ≥ 0, ∀i ∈ N, l ∈ L (4)
ys , ws ≥ 0, ∀s ∈ S (5)

where l is a node within a set of nodes L. A(s) and A(l) represent ancestor
nodes. S = (s1 , s2 , . . . , st ).
Yi Fang, Yuping Huang (IMSE@WVU) Intro. to Stochastic Programming 11/01/2012 16 / 17
Scenario Based Formulation

X
max Probs (Qys − Rws )
s∈S
X
s.t. xit = B, for t = 1 (6)
i∈N
X X
Cits xi,t−1,s = xits , for t = 2, . . . , T − 1, ∀s ∈ S (7)
i∈N i∈N
X
Cits xits − ys + ws = G, for t = T (8)
i∈N

xits = xits0 , ∀i ∈ N, t ∈ T, s ∈ S, s0 ∈ Sts (9)


xits ≥ 0, ∀i ∈ N, t ∈ T, s ∈ S (10)
ys , ws ≥ 0, ∀s ∈ S (11)

where s is a scenario within a set of scenarios S.


There exists S scenarios at stage T .

Yi Fang, Yuping Huang (IMSE@WVU) Intro. to Stochastic Programming 11/01/2012 17 / 17

Você também pode gostar