3. A stochastic programming approach for sawmill production planning 3
The goal of this work is to address Multi-Period, Multi-Product (MPMP) production
planning in sawmills, where possible combinations of log classes and cutting patterns can
produce simultaneously different mixes of lumbers with random yields. Raw material
(logs) in sawmills is classified based on some attributes, namely: diameter class, species,
length, taper, etc. Logs are broken down into different pieces of lumber (products)
by means of different cutting patterns. We define a production process in a sawmill as
a combination of a log class and a cutting pattern. Due to non-homogeneity in the quality
of logs, each cutting pattern yields a random quantity of corresponding products after
processing a known quantity of each log class. In the production line, whenever a log
from a special class enters into a cutting pattern, it passes though an X-ray scanner after
some preliminary activities. The result of scanning is transferred into a log sawing
optimiser, which determines the optimal mix of lumber with the quantity that should
be produced by that cutting pattern. The objective of the optimiser is to maximise the
value/volume of yielded products for each log. Production planning in a sawmill is to
determine the optimal quantities of log consumption from different classes and the
selection of best cutting patterns in each period of the planning horizon, given machine
capacities and log inventory, to fulfil demand. The objective is to minimise log
consumption, as well as products inventory/backorder costs.
Two different approaches have been already proposed in the literature to address
sawmill production planning. In the first approach, the randomness of process yields
is simplified and their expected value is considered in a MPMP Linear Programming
(LP) model (Gaudreault et al., 2004). However, the production plans issued by these
models result usually in extra inventory of products with lower quality and price, while
backorders for products with higher quality and price build up. The second approach is
focused on combined optimisation type solutions linked to real-time simulation
sub-systems (Mendoza et al., 1991; Maness and Adams, 1991; Maness and Norton,
2002). In this approach, the stochastic characteristics of logs are taken into account
by assuming that all the input logs are scanned through an X-ray scanner before planning.
Maness and Norton (2002) developed an integrated multi-period production planning
model which is the combination of an LP model and a log sawing optimiser (simulator).
The LP model acts as a coordinating problem that allocates limited resources. A series
of dynamic programming sub-problems, titled in the literature as ālog sawing
optimisation modelsā are used to generate activities (columns) for the coordinating LP,
based on the productsā shadow prices. Although the stochastic characteristics of logs are
considered in the second approach, they include the following limitations to be
implemented in many sawmills: logs, needed for the next planning horizon, are not
always available in sawmills to be scanned before planning. Furthermore, to implement
this method, the logs should be processed in the production line in the same order they
have been simulated, which is not an easy practice.
Sawmill production planning problems can be considered as the combination
of several classical production planning problems in the literature, which have been
modelled by LP. Most of the works in the literature for including uncertainty in
production planning models are focused on considering random demand. In Escudero
et al. (1993), a multi-stage stochastic programming approach was proposed for solving a
MPMP production planning model with random demand. In Bakir and Byrne (1998),
demand uncertainty in a MPMP production planning model was studied. They developed
a demand stochastic LP model based on the two-stage deterministic equivalent problem.
Leung and Wu (2004) proposed a robust optimisation model for stochastic aggregate
4. 4 M. Kazemi Zanjani et al.
production planning. Huang (2005) proposed multi-stage stochastic programming models
for production and capacity planning under uncertainty. Alfieri and Brandimarte (2005)
reviewed multi-stage stochastic models applied in multi-period production and capacity
planning in the manufacturing systems. Brandimarte (2006) proposed a multi-stage
programming approach for multi-item capacitated lot-sizing with uncertain demand. In
Leung et al. (2006) a robust optimisation model was developed to address a multi-site
aggregate production planning problem in an uncertain environment. Khor et al. (2007)
proposed a two-stage stochastic programming model as well as robust optimisation
models for capacity expansion planning in a petroleum refinery under uncertainty.
Aghezzaf et al. (2009) proposed two-stage stochastic planning, a robust stochastic
optimisation planning, and an equivalent deterministic planning model for robust tactical
planning in multi-stage production systems with uncertain demand. Three approaches can
be used to address MPMP production planning in a manufacturing environment with
random yield (Kazemi et al., 2007). These approaches include stochastic programming
(Kazemi et al., 2009a, 2009b), robust optimisation (Kazemi et al., 2009c) and fuzzy LP.
In this paper, a two-stage stochastic programme with recourse (Kall and Wallace,
1994; Birge and Louveaux, 1997; Kall and Mayer, 2005) is proposed for sawmill
production planning, while considering random characteristics of logs and consequently,
random process yields. The random yields are modelled as scenarios with discrete
probability distributions. Due to the astronomic number of scenarios for random yields in
the two-stage stochastic model, a Monte-Carlo sampling strategy, the Sample Average
Approximation (SAA) method (Shapiro and Homem-de-Mello, 1998; Mak et al, 1999;
Shapiro and Homem-de-Mello, 2000), is implemented to solve the stochastic model.
The confidence intervals on the optimality gap for the candidate solutions are constructed
based on Common Random Number (CRN) streams (Mak et al., 1999). Our
computational results involving a prototype sawmill indicate that the proposed approach
serves as a viable tool for production planning in sawmills.
The remainder of this paper is organised as follows. In the next section, we provide a
theoretical framework for two-stage stochastic LP. In Section 3, we describe a two-stage
stochastic linear programme for sawmill production planning under uncertainty of
process yields. In Section 4, a scenario generation approach for random process yields
in the two-stage stochastic model is proposed. In Section 5, we develop a solution
strategy for the stochastic model; we also explain the SAA technique with the sampling
technique based on CRNs. In Section 6, we present the implementation results of the
stochastic model and a solution methodology for a prototype sawmill. We also compare
the quality of solutions resulted from the new approach with those of the mean-value
deterministic LP model. Our concluding remarks are given in Section 7.
2 A theoretical framework for two-stage stochastic LP
To deal with optimisation problems involving random variables in their right-hand-side,
their technological coefficients or their objectives coefficients, stochastic programming
(Dantzig, 1955; Kall and Wallace, 1994; Birge and Louveaux 1997; Kall and Mayer,
2005) was proposed. Models (1)-(3) are examples of stochastic LPs.
min ,
T
c x (1)
5. A stochastic programming approach for sawmill production planning 5
Subject to
,
Ax b
= (2)
( ) ( ), 0,
T
T x h x
Ī¾ Ī¾
ā„ ā„ (3)
where ( )
T Ī¾ and ( )
h Ī¾ are the random parameters. In the above model, constraints (2)
and (3) represent the set of deterministic and stochastic constraints, respectively.
In two-stage stochastic models, we explicitly classify the decision variables according
to whether they are implemented before or after an outcome of the random variable is
observed. In other words, we have a set of decisions to be taken without full information
on the random parameters. These decisions are called first-stage decisions, and are
usually represented by a vector (x). Later, full information is received on realisations
(scenarios) of some random vector Ī¾ . Then, second-stage or recourse actions (y) are
taken. These second-stage decisions allow us to model a response to each of the observed
outcomes (scenarios) of the random variable, which constitutes our recourse. In general,
this response will also depend upon the first-stage decisions. In mathematical
programming terms, this defines the so-called two-stage stochastic programme with
recourse of the form:
min ( , ),
T
c x E Q x
Ī¾ Ī¾
+ (4)
Subject to
, 0
Ax b x
= ā„ (5)
where { }
( , ) min ( ) | ( ) ( ) ,
T T
Q x q y Wy h T x
Ī¾ Ī¾ Ī¾ Ī¾
= = ā W is the recourse matrix, ( )
T
q Ī¾ is
the vector of penalty cost of second-stage (recourse) variables, Ī¾ is the random vector
formed by the components of ( ), ( ), ( ),
T T
q h T
Ī¾ Ī¾ Ī¾ and EĪ¾ denotes mathematical
expectation with respect to Ī¾ .
In the case of continuous distribution for random variables in Models (4)-(5), the
calculation of the expected value ( , )
E Q x
Ī¾ Ī¾ requires the calculation of multiple integrals
with respect to the measure describing the distribution of Ī¾ . However, the computational
effort increases with the dimension of the stochastic variables vector, and this leads to
a tremendous amount of work. On the other hand, if Ī¾ has a finite discrete distribution
{ }
( , ), 1, , ,
i i
p i n
Ī¾ = ā¦ then (4)ā(5) can be transformed into its deterministic equivalent,
which is an ordinary linear programme as follows.
1
min ( , ),
n
T i i
i
c x p Q x Ī¾
=
+ ā (6)
,
0.
Ax b
x
=
ā„
(7)
where, { }
( , ) min ( ) | ( ) ( ) , , ( ), ( )
T
i iT i i i i i iT i
Q x q y Wy h T x y q h
Ī¾ Ī¾ Ī¾ Ī¾ Ī¾ Ī¾
= = ā and ( )
i
T Ī¾
represent the ith scenarios for , ( ), ( )
T T
y q h
Ī¾ Ī¾ and ( ),
T Ī¾ respectively. Models (6)-(7)
can be solved by the LP solvers.
6. 6 M. Kazemi Zanjani et al.
3 Problem formulation by mathematical programming
In this section we first describe the deterministic LP formulation for sawmill production
planning. Then we develop the proposed stochastic model to address the problem
by considering the uncertainty of process yields.
3.1 The deterministic LP model for sawmill production planning
Consider a sawmill with a set of products āPā, a set of classes of logs āCā, a set
of production processes āAā, a set of resources (machines) āRā, and a planning horizon
consisting of āTā periods. For modelling simplicity, we define a production process in a
sawmill as a combination of a log class and a cutting pattern. As was mentioned before,
each process produces a mix of lumber with different dimensions. However, due to
random quality of input logs, the quantity of products (yield of the processes) is a random
variable. Figure 1 is a schematic illustration of the sawing process in sawmills.
Figure 1 Sawing process in sawmills
To state the deterministic LP model for the sawmill production planning problem, the
following notations are used.
3.1.1 Notations
Indexes
p Product
t Period
c Log class
a Production process
r Resource (machine)
Parameters
pt
h Inventory cost per unit of product p in period t
pt
b Backorder cost per unit of product p in period t
ct
m Log cost per unit of log class c in period t
0
c
I The inventory of log class c at the beginning of the planning horizon
7. A stochastic programming approach for sawmill production planning 7
0
p
I The inventory of product p at the beginning of the planning horizon
ct
s The quantity of logs of class c supplied at the beginning of period t
pt
d Demand of product p in period t
ac
Ļ The units of log class c consumed by process a (consumption factor)
ap
Ļ The units of product p produced by process a (yield of process a)
ar
Ī“ The capacity consumption of resource r by process a
rt
M The capacity of resource r in period t
Decision variables
at
X The number of times each production process a should be run in each
period t
ct
I Inventory size of log class c by the end of period t
pt
I Inventory size of product p by the end of period t
pt
B Backorder size of product p by the end of period t
3.1.2 The LP model
P 1 C 1
min [ ] ,
T T
pt pt pt pt ct ac at
p t c t a A
Z h I b B m X
Ļ
ā = ā = ā
= + +
āā āāā (8)
Subject to
Material inventory constraint
1 , 1, , , C.
ct ct ct ac at
a A
I I s X t T c
Ļ
ā
ā
= + ā = ā
ā ā¦ (9)
Product inventory constraint
1 1 0 1 1
A
1 1
A
,
, 2, , , P.
p p p ap a p
a
pt pt pt pt ap at pt
a
I B I X d
I B I B X d t T p
Ļ
Ļ
ā
ā ā
ā
ā = + ā
ā = ā + ā = ā
ā
ā ā¦
(10)
Production capacity constraint
A
, 1, , , R.
ar at rt
a
X M t T r
Ī“
ā
ā¤ = ā
ā ā¦ (11)
Non-negative of all variables
0, 0, 0, 0, 1, , , P, C, A.
at ct pt pt
X I I B t T p c a
ā„ ā„ ā„ ā„ = ā ā ā
ā¦ (12)
The objective function (8) is a linear cost minimisation equation. It consists of total
inventory and backorder cost for all products and log consumption cost for all classes in
the planning horizon. Constraint (9) ensures that the total inventory of log of class c at the
end of period t is equal to its inventory in the previous period plus the quantity of log of
class c supplied at the beginning of that period ( )
ct
s minus its total consumption in that
8. 8 M. Kazemi Zanjani et al.
period. It should be noted that the total consumption of each class of log in each period is
calculated by multiplying the log consumption factor of each process ( )
ac
Ļ by the
number of times that process is executed in that period. Constraint (10) ensures that the
sum of inventory (or backorder) of product p at the end of period t is equal to its
inventory (or backorder) in the previous period plus the total production of that product in
that period minus the product demand for that period. Total quantity of production for
each product in each period is calculated as the sum of the quantities yielded by each
of the corresponding processes, regarding the yield ( )
ap
Ļ of each process. Finally,
constraint (11) requires that the total production does not exceed the available production
capacity. In other words, the sum of capacity consumption of a machine r by
corresponding processes in each period should not be greater than the capacity of that
machine in that period.
3.2 The Two-stage stochastic model for sawmill production planning
To include the random nature of process yields in sawmill production planning,
we expand Model (8)-(12) to a two-stage stochastic linear programme with recourse. It is
assumed that the probability distributions of random yields are known. We represent the
random yield vector by Ī¾ , where { | A, P}
ap a p
Ī¾ Ļ
= ā ā . We also represent each
realisation (scenario) of random process yields by ( )
ap
Ļ Ī¾ . It should be emphasised that
the stages of the two-stage recourse problem do not refer to time units. They correspond
to steps in the decision making. In other words, in the first stage (planning stage), the
decision maker does not have any information on the process yields, due to a lack of
complete information on the characteristics of the logs. However, the production plan
should be determined before the complete information is available. In the second stage
(plan implementation stage), when the realised yields are available based on the
first-stage decision, the recourse actions (inventory or backorder sizes) can be computed.
The objective of the second-stage problem is to minimise the inventory and backorder
costs (recourse action costs) for each scenario of random yield. The resulting formulation
is as follows.
First-stage model
C 1
min [ ( , )].
T
ct ac at at
c t a A
Z m X E Q X
Ī¾
Ļ Ī¾
ā = ā
= +
āāā (13)
Subject to
1 , 1,..., , C,
ct ct ct ac at
a A
I I s X t T c
Ļ
ā
ā
= + ā = ā
ā (14)
A
, 1,..., , R,
ar at rt
a
X M t T r
Ī“
ā
ā¤ = ā
ā (15)
0, 0, A, C, 1,..., .
at ct
X I a c t T
ā„ ā„ ā ā = (16)
where ( , )
at
Q X Ī¾ is the optimal value of the following problem:
9. A stochastic programming approach for sawmill production planning 9
Second-stage model
P 1
min ( , ) [ ].
T
at pt pt pt pt
p t
Q X h I b B
Ī¾
ā =
= +
āā (17)
Subject to
1 1 0 1 1
A
( ) ,
p p p ap a p
a
I B I X d
Ļ Ī¾
ā
ā = + ā
ā
1 1
A
( ) , 2,..., , P,
pt pt pt pt ap at pt
a
I B I B X d t T p
Ļ Ī¾
ā ā
ā
ā = ā + ā = ā
ā (18)
0, 0, P, 1,..., .
pt pt
I B p t T
ā„ ā„ ā = (19)
Note again that Ī¾ is a random vector corresponding to different scenarios for the
uncertain process yields, and the optimal value ( , )
Q x Ī¾ of the second-stage problem
(17)ā(19) is the function of the first-stage decision variable at
X and a realisation (or a
scenario) of the uncertain yield ( ( ))
ap
Ļ Ī¾ . The expectation in (13) is taken with respect
to the probability distribution of ,
Ī¾ which is supposed to be known.
Model (13)ā(19) is a two-stage stochastic programme. The first stage consists of
deciding the number of times each process should be run in each period ( )
at
X and the
second stage consists of finding the optimal recourse action (i.e., inventory or backorder
size of different products in each period) based on the first stage decision and the yield
scenarios. The objective is to minimise raw material consumption cost and the expected
future inventory and backorder costs.
Before explaining how the stochastic model should be solved, in the next section we
will first illustrate how the random yields should be modelled to be incorporated into the
stochastic model.
4 Scenario generation
In this section, we explain how different scenarios for random yields can be generated
in the stochastic model. We define a global scenario in the two-stage model as the
combinations of scenarios for yields of individual processes. We suppose that the yields
of different processes are independent. Therefore as the first step, all possible scenarios
for yields of each process should be determined and then these scenarios should be
aggregated to generate the global scenarios for the stochastic model.
A scenario for the yield of each process is defined as the quantities of products that
are yielded by that process. For example, consider a process that can produce potentially
4 products (P1, P2, P3, P4). Table 1 represents two scenarios among all possible
scenarios for yields of this process. Regarding the limited volume of logs and dimensions
of different products, it is evident we need to consider a discrete distribution for random
yields of processes. However, due to the variety of logs in each class, a huge number
of scenarios can be expected for process yields in sawmill.
10. 10 M. Kazemi Zanjani et al.
Table 1 Two scenarios for yields of a process
Scenario Products Quantity (yield)
1 P1 2
P2 3
P3 1
P4 0
2 P1 1
P2 0
P3 3
P4 2
According to the above scenario definition approach for process yields, the only
questions that remain to be answered are how the real scenarios in industry can be
determined and also how their probability distribution can be estimated. Such scenarios
and their probability distribution can be determined as follows.
ā¢ Take a sample of logs in each class (e.g., 300 logs in each class) and let them be
processed by each process.
ā¢ Register the yield of the process (the corresponding lumbers with their quantity) for
each individual log and consider the result as a scenario.
ā¢ After finding all the resulted scenarios, calculate their probabilities as their
proportion in the population of scenarios.
5 Solution methodology
In this section, we give the details of the proposed methodology to solve the two-stage
stochastic production planning model. We use the SAA scheme to solve this problem.
First, the deterministic equivalent of the stochastic model is presented and the challenges
in solving this model are discussed. The SAA scheme is explained next.
5.1 The deterministic equivalent model
As we have mentioned in the previous section, process yields have discrete distributions
and the yields of different processes are independent. Consequently, the global scenarios
for the two-stage Model (13)-(19) have also discrete distributions. Therefore, the
expected value [ ( , )]
at
E Q X
Ī¾ Ī¾ in (13) can be written as
1
( , )
N
i i
at
i
p Q X Ī¾
=
ā , where N denotes
the total number of scenarios,
i
Ī¾ denotes the ith scenario, and
i
p denotes the
probability of scenario i. Finally, the first and second-stage problems (13)-(19) can be
summed up in a single large LP model, which is also called in the literature the
ādeterministic equivalent modelā. This model is presented as follows.
11. A stochastic programming approach for sawmill production planning 11
Minimise
C 1 1 P 1
.
T N T
i i i
ct ac at pt pt pt pt
c t a A i p t
Z m X p h I b B
Ļ
ā = ā = ā =
ļ£® ļ£¹
= + +
ļ£° ļ£»
āāā āāā (20)
Subject to
1 , 1, , , C,
ct ct ct ac at
a A
I I s X t T c
Ļ
ā
ā
= + ā = ā
ā ā¦ (21)
A
, 1,2, , , R,
ar at rt
a
X M t T r
Ī“
ā
ā¤ = ā
ā ā¦ (22)
1 1 0 1 1
A
1 1
A
( ) ,
( ) ,
2, , , P, 1, , ,
i i i
p p p ap a p
a
i i i i i
pt pt pt pt ap at pt
a
I B I X d
I B I B X d
t T p i N
Ļ Ī¾
Ļ Ī¾
ā
ā ā
ā
ā = + ā
ā = ā + ā
= ā =
ā
ā
ā¦ ā¦
(23)
0, 0, 0, 0, , , 1, , ,
, 1, , ,
i i
at ct pt pt
X I I B c C p P t T
a A i N
ā„ ā„ ā„ ā„ ā ā =
ā =
ā¦
ā¦
(24)
where, i
pt
I and i
pt
B denote the inventory and backorder sizes of product p in period t
under scenario i, respectively. It is evident that the LP model (20)-(24) can be solved
by the LP solvers. However, in the case of a huge number of scenarios, solving this
model would be far beyond the present computational capacities. In such situations, it is
not practical to solve the two-stage model or its deterministic equivalent, directly.
We can, however, use Monte Carlo sampling techniques, which consider only randomly
selected subsets of the set { }
1 2
, ,..., N
Ī¾ Ī¾ Ī¾ to obtain approximate solutions. Monte Carlo
solution procedures for solving stochastic programmes can use āinternal samplingā or
āexternal samplingā. The āinternal samplingā procedures include sampling-based cutting
plane methods (e.g., Higle and Sen, 1996) and stochastic quasi-gradient algorithms (e.g.,
Ermoliev, 1993). In the āexternal samplingā procedures, sampling is performed external
to (prior to) the solution procedure. The SAA scheme (cf. Shapiro and Homem-de-Mello,
1998; Mak et al, 1999; Shapiro and Homem-de-Mello, 2000) which is selected as the
solution approach in this work is an āexternal samplingā procedure.
5.2 The Sample Average Approximation (SAA) scheme
In the SAA scheme, a random sample of n realisations (scenarios) of the random vector
Ī¾ is generated and the expectation [ ( , )]
at
E Q X
Ī¾ Ī¾ is approximated by the sample average
function 1
1
( , )
n i
at
i
Q X
n
Ī¾
=
ā . In other words, the ātrueā problem (20)-(24) is approximated
by the SAA problem (25).
C 1 1 P 1
1
Ė
min [ ]
T n T
i i
ct ac at pt pt pt pt
c t a A i p t
Z m X h I b B
n
Ļ
ā = ā = ā =
= + +
āāā āāā (25)
subject to
constraints (21)ā(24).
12. 12 M. Kazemi Zanjani et al.
It is possible to show that under mild regularity conditions, as the sample size n increases,
the optimal solution vector Ė
n
X and optimal value Ė
n
Z of the SAA problem (25) converge
with probability one to their true counterparts, and moreover, Ė
n
X converges to an optimal
solution of the true problem, with probability approaching one exponentially fast
(Shapiro and Homem-de-Mello, 1998 and 2000). This convergence analysis suggests that
a fairly good approximate solution to the true problem (20)-(24) can be obtained
by solving an SAA problem (25) with a modest sample size. The mentioned regularity
conditions include:
ā¢ the objective function of the stochastic model has finite mean and variance
ā¢ the independent identically distributed (i.i.d.) observations of vector Ī¾ can be
generated
ā¢ instances of SAA problem can be solved for sufficiently large n to generate āgoodā
bounding information
ā¢ the objective function of the stochastic model can be evaluated exactly for specific
values of at
X and realisations of vector Ī¾ . It can be easily verified that the
mentioned regularity conditions are satisfied for our problem.
In practice, the SAA scheme involves repeated solutions of the SAA problem (25) with
independent samples. Statistical confidence intervals are then derived on the quality of
the approximate solutions (Mak et al., 1999). According to the work of Mak et al. (1999),
an obvious approach to testing solution quality for a candidate solution ( )
X is to bound
the optimality gap, defined as *
( , ) ,
Ef X z
Ī¾ ā using standard statistical procedures, where
( , )
f X Ī¾ and *
z are the true objective values for X and the true optimal solution to the
problem (20)-(24), respectively, and ( , )
Ef X Ī¾ is the expected value of ( , )
f X Ī¾ . In our
work, a sampling procedure based on CRNs is used to construct the optimality gap
confidence intervals that provide significant variance reduction over naive sampling, as
has been proposed in Mak et al., (1999). This approach is described in the following.
The SAA algorithm (with Common Random Number streams)
Step 1: Generate g
n i.i.d. batches of samples, each of size n, from the distribution of ,
Ī¾
i.e., { }
1 2
, ,...,
n
j j j
Ī¾ Ī¾ Ī¾ for j = 1, ā¦, .
g
n For each sample, solve the corresponding SAA
problem (25). Let Ė j
n
Z and Ė ,
j
n
X j =1, ā¦, ,
g
n be the corresponding optimal objective
value and an optimal solution, respectively.
Step 2: Compute
,
1
1 Ė .
g
g
n
j
n n n
j
g
Z Z
n =
= ā (26)
,
2 2
,
1
1 Ė
( ) .
( 1)
g
g g
n ng
n
j
n n n
Z
j
g g
s Z Z
n n =
= ā
ā
ā (27)
It is well known that the expected value of Ė
n
Z is less than or equal to the optimal value
*
z of the true problem (see e.g., Mak et al., 1999). Since , g
n n
Z is an unbiased estimator
of Ė
[ ],
n
E Z we obtain that *
, .
g
n n
E Z z
ļ£® ļ£¹ ā¤
ļ£° ļ£» Thus , g
n n
Z provides a lower statistical bound
13. A stochastic programming approach for sawmill production planning 13
for the optimal value *
z of the true problem and ,
2
n ng
Z
s is an estimate of the variance of
this estimator.
Step 3: Choose a candidate feasible solution at
X of the true problem, for example,
a computed Ė j
n
X ā² by using a sample size ( )
nā² larger than used for lower bound estimation
(n). Estimate the true objective function value ( )
at
f X for all batches of samples
(j =1, ā¦, ng) as follows.
( )
C 1 1
1
( ) , .
T n
j i
n ct ac at at j
c t a A i
f X m X Q X
n
Ļ Ī¾
ā = ā =
= +
āāā ā
(28)
Step 4: Compute the observations of the optimality gap j
n
G for the candidate solution X
for all j = 1, ā¦, ng as follows.
Ė
( ) .
j j j
n
n n
G f X Z
= ā
(29)
It has been shown in Mak et al., (1999) that
*
Ė
( ) [ ( , )] ,
n
n n
G
E f X Z E f X z
Ī¾
ļ£® ļ£¹
ā ā„ ā
ļ£° ļ£»
where ( , )
f X Ī¾ and *
z are the true objective value for at
X and the true optimal solution
to the problem (20)-(24), respectively and ( )
*
[ ( , )]
E f X z
Ī¾ ā is the true optimality gap
for the candidate solution .
at
X We also have:
( )
2
2
N 0, as
where =var .
g
g n n g g
g n
n G EG n
G
Ļ
Ļ
ļ£® ļ£¹
ā ā ā ā
ļ£° ļ£»
Step 5: Compute the sample mean and sample variance for the optimality gap j
n
G as
follows.
1
1 g
g
n
j
n n
j
g
G G
n =
= ā (30)
( )
2
2
1
1
.
( 1)
g
j
g
n
n
j
n n
G
j
g g
s G G
n n =
= ā
ā
ā (31)
Step 6: Compute the approximate (1 )
Ī±
ā -level confidence interval for the optimality gap
for at
X as 0, ,
g
n g
G Īµ
ļ£® ļ£¹
+
ļ£° ļ£»
where
1,
.
j
g n
n G
g
g
t s
n
Ī±
Īµ
ā
=
6 Computational results
In this section, we describe the numerical experiments using the proposed approach to
solve a prototype sawmill production planning problem. We first describe the
characteristics of the test industrial problem and some implementation details, and then
we comment on the quality of the stochastic model solution in comparison to that the
quality obtained by using the mean-value deterministic model.
14. 14 M. Kazemi Zanjani et al.
6.1 Data and implementation
Our test problem is that of production planning for a prototype sawmill in Quebec
(Canada), where 3 classes of logs with 10 feet length can be processed by 5 cutting
patterns for producing 27 products (lumbers with different dimensions). Therefore, we
have 15 processes, all able to produce 27 products with random yields. Two bottleneck
machines are considered: Trimmer and Bull. The planning horizon consists of 30 periods
(days). Products demands in each period are supposed to be deterministic and are
calculated based on the received orders.
The number of scenarios for random yields in this example can be estimated as
405 283
5 1.2 10 .
ā Ć In this example, we used a log sawing simulator named āOptitekā
(Forintek Canada Corp.) to generate randomly different batches of samples for random
yields. āOptitekā was developed to simulate the sawing process in Quebec sawmills.
The inputs to this simulator consist of log class, cutting pattern and the number of logs to
be processed. The simulator considers the logs in the requested class with random
physical and internal characteristics, and based on sawing rules which are similar to those
of a real sawmill, generates different yields for each log. Afterwards, the yields of each
log can be considered as a scenario for the yields of corresponding processes. Finally, the
combinations of such scenarios for all processes construct the global scenarios for the
stochastic model.
Recall from Section 5 that the SAA method calls for the solution of ng instances of
the approximating stochastic programme (25), each involving n sampled scenarios.
Statistical validation of a candidate solution is then carried out by evaluating the
objective function using the same n sampled scenarios in each batch. In our
implementation, we used n = 60, 100, and 150; and ng = 30. Our candidate solutions are
computed by solving the SAA problem (25) with nā² = 100, 150 and 250. To illustrate the
complexity of solving (25) within the SAA scheme, we present the sizes of the
deterministic equivalents of the SAA problems corresponding to the different values of n
in Table 2.
The SAA scheme was implemented in OPL Studio 3.7.1. CPLEX 9 was used to solve
the deterministic equivalents for different instances of SAA problems. The OPL Script is
used for calculating the true objective function value for the candidate solutions.
All computations were carried out on a Pentium (R) IV 1.8 GHz PC with 512 MB RAM
running Windows XP.
Table 2 Deterministic equivalent size of the SAA problems
n Constraints Variables
1 960 2160
100 81150 162540
150 121650 243540
250 202650 405540
6.2 Quality of stochastic solutions
In this section, we first present the results of applying the SAA scheme for our test
problem, as well as the evaluation of quality of several candidate solutions; afterwards we
15. A stochastic programming approach for sawmill production planning 15
compare the solution of the stochastic programming model to that of the deterministic
model involving the mean-values of the uncertain yields. The point estimates of the lower
statistical bound for the optimal value of the problem are reported in Table 3. They are
computed based on 30 batches of sampled scenarios with 3 different batch sizes. Table 4
displays the quality of 3 candidate solutions and contains the 95% confidence intervals on
their optimality gaps based on CRN method (see Section 5). The candidate solutions
100 150 250
, ,
X X X for the CRN strategy are computed by solving the approximating
problem (25) with 100, 150 and 250 scenarios. The CPU times for computing each
candidate solution are also reported in Table 4.
Table 3 Lower bound estimation results for the optimal value (30 batches)
Batch size (n) 60 100 150
Average ( )
, g
n n
Z 515829 527981 519226
SD ( )
,
n ng
Z
s 35582 25562 22590
As it can be observed from Table 4, by increasing the sample size, the quality
of approximate solutions improves monotonically and tighter confidence intervals for the
optimality gaps of candidate solutions are constructed.
Table 4 Optimality gaps for candidate solutions
Candidate solution 100
X 150
X 250
X
Batch size (n) 60 100 150
No. of batches (ng) 30 30 30
Point estimate ( )
g
n
G 13253 9284 4783
Error estimate (Ī± = 95%) ( )
g
Īµ
1555 1268 393
Confidence interval (95%) [0, 14808] [0, 10552] [0, 5176]
CPU time (sec.) 45 80 198
To compare the stochastic model solution with the mean-value model solution, we
calculated the Value of the Stochastic Solution (VSS) (Birge and Louveaux, 1997) for the
three candidate solutions. The VSS indicates the difference between the expected cost
of the mean-value model solution and the stochastic model one and is computed as
follows.
Step 1: Solve the deterministic problem (mean-value problem) (8)-(12) by considering
the expected value of process yields and find the optimal solution .
MVP
X
Step 2: Compute the real objective function value (the expected cost) for
( )
( )
MVP MVP
n
X f X
by (28) (see Section 5).
Step 3: The value of the stochastic solution (VSS) for each candidate solution ( )
X is
calculated by:
16. 16 M. Kazemi Zanjani et al.
VSS ( ) ( ),
MVP
n n
f X f X
= ā
where, ( )
n
f X
is the objective value of the SAA problem for the solution .
X
The comparison between three candidate solutions 100 150 250
, ,
X X X and MVP
X is
reported in Table 5.
Table 5 Comparison of the solutions of the stochastic model and mean-value deterministic
model
Solution
MVP
X
100
X (n = 60) 150
X (n = 100) 250
X (n = 150)
n = 60 n = 100 n = 150
Objective function
value ( )
( )
n
f X
1735702 17135702 1704186 509108 504536 502162
VSS 1226594 1215266 1202024
It is clear that the estimated total average cost for all three candidate stochastic model
solutions are significantly smaller than that of the mean-value model solution. In this
example, by considering a moderate number of scenarios (250) among the potential
enormous number of scenarios for random yields, we have obtained an approximate
solution in a short amount of time with an optimality gap of [0, 5176], which is less than
1% of the lower bound of the real optimal value (see Tables 3 and 4). This solution can
be accepted as a relatively good approximation to the optimal solution regarding the high
expected cost of mean-value model solution (see Table 5).
6.3 Managerial implications
A comparison between the stochastic and deterministic sawmill production planning
models in 6.2 indicates that the stochastic model proposes a plan with a lower backorder
size, and as a consequence, a better customer service level. In other words, the stochastic
model can be considered as a more reliable sawmill production planning tool in the
presence of random yields, compared to the deterministic model. On the other hand,
the plan proposed by the deterministic model is quite optimistic, which results in higher
realised backorder sizes (lower service level). In fact, the average values of process
yields, which are considered in the deterministic model, are almost never realised while
implementing the plan. It would be worth mentioning that the precision of the plan
proposed by the stochastic model depends mainly on the precision of scenarios defined
for random yields. Thus, to implement the stochastic production planning model
successfully in industry, great effort must be accomplished to model the random process
yields.
7 Conclusion
In this paper, we developed a two-stage stochastic programming model for sawmill
production planning by considering random characteristics of logs. The SAA method was
implemented to solve the stochastic model, which provided us with an efficient