17
Computers & Operations Research 33 (2006) 3583 – 3599 www.elsevier.com/locate/cor An efficient dynamic programming algorithm for a special case of the capacitated lot-sizing problem Wilco van den Heuvel , Albert P.M. Wagelmans Econometric Institute and Erasmus Research Institute of Management, Erasmus University Rotterdam, P.O. Box 1738, 3000 DR Rotterdam, The Netherlands Available online 9 June 2005 Abstract In this paper we consider the capacitated lot-sizing problem (CLSP) with linear costs. It is known that this problem is NP-hard, but there exist special cases that can be solved in polynomial time. We derive a new O(T 2 ) algorithm for the CLSP with non-increasing setup costs, general holding costs, non-increasing production costs and non-decreasing capacities over time, where T is the length of the model horizon. We show that in every iteration we do not consider more candidate solutions than the O(T 2 ) algorithm proposed by [Chung and Lin, 1988. Management Science 34, 420–6].We also develop a variant of our algorithm that is more efficient in the case of relatively large capacities. Numerical tests show the superior performance of our algorithms compared to the algorithm of [Chung and Lin, 1988. Management Science 34, 420–6]. 2005 Elsevier Ltd. All rights reserved. Keywords: Capacitated lot-sizing; Production; Inventory 1. Introduction In this paper we consider the capacitated lot-sizing problem (CLSP). The problem can be described as follows. For a finite time horizon, there is a known demand for a single product. This demand has to be satisfied each period by producing in this period or in previous periods, i.e., back-logging is not allowed. When production occurs in a period, setup cost and marginal production cost per unit production are incurred. In contrast to the uncapacitated lot-sizing problem, production in each period is limited to a Corresponding author. Tel.: +31 10 4081321; fax: +31 10 4089162. E-mail address: [email protected] (W. van den Heuvel). 0305-0548/$ - see front matter 2005 Elsevier Ltd. All rights reserved. doi:10.1016/j.cor.2005.02.046

An efficient dynamic programming algorithm for a special case of the capacitated lot-sizing problem

Embed Size (px)

Citation preview

Computers & Operations Research 33 (2006) 3583–3599www.elsevier.com/locate/cor

An efficient dynamic programming algorithm for a special case ofthe capacitated lot-sizing problem

Wilco van den Heuvel∗, Albert P.M. Wagelmans

Econometric Institute and Erasmus Research Institute of Management, Erasmus University Rotterdam, P.O. Box 1738,3000 DR Rotterdam, The Netherlands

Available online 9 June 2005

Abstract

In this paper we consider the capacitated lot-sizing problem (CLSP) with linear costs. It is known that thisproblem is NP-hard, but there exist special cases that can be solved in polynomial time. We derive a new O(T 2)algorithm for the CLSP with non-increasing setup costs, general holding costs, non-increasing production costs andnon-decreasing capacities over time, where T is the length of the model horizon. We show that in every iteration wedo not consider more candidate solutions than the O(T 2) algorithm proposed by [Chung and Lin, 1988. ManagementScience 34, 420–6]. We also develop a variant of our algorithm that is more efficient in the case of relatively largecapacities. Numerical tests show the superior performance of our algorithms compared to the algorithm of [Chungand Lin, 1988. Management Science 34, 420–6].� 2005 Elsevier Ltd. All rights reserved.

Keywords: Capacitated lot-sizing; Production; Inventory

1. Introduction

In this paper we consider the capacitated lot-sizing problem (CLSP). The problem can be described asfollows. For a finite time horizon, there is a known demand for a single product. This demand has to besatisfied each period by producing in this period or in previous periods, i.e., back-logging is not allowed.When production occurs in a period, setup cost and marginal production cost per unit production areincurred. In contrast to the uncapacitated lot-sizing problem, production in each period is limited to a

∗ Corresponding author. Tel.: +31 10 4081321; fax: +31 10 4089162.E-mail address: [email protected] (W. van den Heuvel).

0305-0548/$ - see front matter � 2005 Elsevier Ltd. All rights reserved.doi:10.1016/j.cor.2005.02.046

3584 W. van den Heuvel, A.P.M. Wagelmans / Computers & Operations Research 33 (2006) 3583–3599

certain amount. Finally, holding costs are incurred for carrying ending inventory from one period to thenext period and it is assumed that all costs are non-negative.

Florian et al. [1] showed that the CLSP with general (not necessarily linear) cost functions is NP-hardand they suggested a pseudo-polynomial algorithm with time complexity O(T 2cd), where c and d denotethe average capacity and the average demand, respectively, and T denotes the model time horizon. Ifmarginal production costs are piecewise linear, Shaw and Wagelmans [2] showed that the complexity canbe improved to O(T 2qd), where q is the average number of pieces required to represent the productioncost functions.

In this paper we consider a special case of the CLSP, namely the case where holding costs and marginalproduction costs are assumed to be linear. Although the uncapacitated version of this lot-sizing problemcan be solved in polynomial time (Wagner and Whitin [3], Fedegruen and Tzur [4], Wagelmans et al. [5]and Aggarwal and Park [6]), Bitran and Yanasse [7] showed that the CLSP with linear costs is NP-hard,even in many special cases. These authors introduced the notation �/�/�/� for the CLSP, where �, �, �,� specify a certain structure for, respectively, setup costs, holding costs, production costs, and capacity.The parameters can have values equal to the letters Z, C, NI, ND, and G, which stand for zero, constantover time, non-increasing over time, non-decreasing over time, and no prespecified pattern, respectively.

The following special cases of the CLSP are known to be solvable in polynomial time. Florian andKlein [8] formulated an O(T 4) algorithm for the G/G/G/C case; later Van Hoesel and Wagelmans [9]improved this result to O(T 3). Bitran andYanasse [7] formulated an O(T 4), O(T 3), O(T log T ), and O(T)algorithm for the cases NI/G/NI/ND, NI/G/NI/C, C/Z/ND/NI, and ND/Z/ND/NI, respectively. Chung andLin [10] reduced the time complexity of the NI/G/NI/ND problem to O(T 2).

In this paper we develop a new algorithm for the NI/G/NI/ND problem. Note that this problem alsocontains the constant cost case. Our algorithm is based on the geometrical interpretation of a dynamicprogramming (DP) algorithm and is motivated by techniques used in Wagelmans et al. [5] and Chen etal. [11]. The theoretical time complexity of our algorithm is the same as the DP algorithm proposed byChung and Lin [10], but it runs much faster in practice. In fact, our algorithm has a linear behavior whileChung and Lin’s algorithm has a quadratic behavior.

The remainder of the paper is organized as follows. In Section 2 we introduce our new O(T 2) algorithmto solve the NI/G/NI/ND problem. We show that our algorithm is at least as fast as the algorithm proposedby Chung and Lin [10], which has the same time complexity. In Section 3 we show that our algorithmcan be improved further if capacities are relatively large. In Section 4 we present some numerical resultsand the paper ends with the conclusion in Section 5.

2. Problem description and algorithm

2.1. Problem description

We use the following notation to describe the CLSP. Denote:

T: model time horizon

and for t = 1, . . . , T :

dt : demand in period t,ct : capacity in period t,

W. van den Heuvel, A.P.M. Wagelmans / Computers & Operations Research 33 (2006) 3583–3599 3585

Kt : setup costs in period t,pt : unit production costs in period t,ht : unit holding costs in period t,xt : production quantity in period t,It : ending inventory in period t,Dt : cumulative demand in periods t, . . . , T , i.e., Dt =∑T

i=t di .

The problem can be formulated as

(P ) min∑T

t=1 (Kt�(xt ) + ptxt + htIt )

s.t. It = It−1 − dt + xt t = 1, . . . , T ,

0�xt �ct t = 1, . . . , T ,

It �0 t = 1, . . . , T ,

I0 = IT = 0,

where

�(xt ) ={

0, for xt = 0,

1, for xt > 0.

Assume w.l.o.g. that starting and ending inventory at period T are equal to zero. Furthermore, it has beenproven by Bitran andYanasse [7] that the CLSP can always be reformulated to a problem with the propertydt �ct . In the remainder of the paper we will assume that this is the case.

Finally, assume w.l.o.g. that holding costs equal zero. This can easily be derived by substituting It =∑ti=1(xi − di) in (P) (see for example Chen et al. [11]). Then (P) can be written as

minT∑

t=1

(Kt�(xt ) + p′

t xt − ht

t∑i=1

di

)(1)

s.t.t∑

i=1

xi �t∑

i=1

di t = 1, . . . , T , (2)

T∑i=1

xi =T∑

i=1

di (3)

0�xt �ct t = 1, . . . , T , (4)

where

p′t = pt +

T∑i=t

hi, t = 1, . . . , T . (5)

Note that the last term in (1) is constant. Hence, (P) is equivalent to a similar problem with zero holdingcost. Furthermore, because marginal production costs are non-increasing and holding costs are non-negative, it follows from (5) that p′

t is non-increasing.

3586 W. van den Heuvel, A.P.M. Wagelmans / Computers & Operations Research 33 (2006) 3583–3599

2.2. The algorithm

In this section we will introduce a backward DP algorithm similar to that of Chen et al. [11]. Let Ft(Xt)

be the minimum cost when cumulative production from period t until period T is Xt =∑Ti=t xi for feasible

values of Xt , that is, when (2)–(4) are satisfied. Combining (2) and (3) yields Xt �Dt . Combining (3)

and (4) yields Xt � max{D1 −∑t−1

i=1ci, 0}

. That is, cumulative production in periods t, . . . , T should

be sufficiently large, otherwise there is not enough capacity in periods 1, . . . , t −1 to satisfy total demandD1. So, more formally we have

Ft(Xt) ={minimum cost when production equals

Xt =∑Ti=t xi and (2).(4) are satisfied, for Xt ∈ Rt,

∞, otherwise,

where

Rt = [At, Dt ] with At = max

{D1 −

t−1∑i=1

ci, 0

}.

Note that At+1 �At and Dt+1 �Dt , so that the intervals Rt shift to the right for decreasing values of t.For notational convenience the first stage of the algorithm is called iteration T and we end up at recursion

step t = 1, so that in recursion step t demand equals dt . So we start with computing FT (XT ), end withcomputing F1(X1), and iteration s is performed before iteration r for s > r . Now the minimum costfunction Ft(Xt) can be determined recursively by

Ft(Xt) = minXt+1∈Rt+1

{Ft+1(Xt+1) + Pt(Xt − Xt+1)}, (6)

where

Pt(x) ={0, for x = 0,

Kt + ptx, for 0 < x�ct ,

∞, otherwise

for t = 1, . . . , T and Xt ∈ Rt . The recursion is initialized by FT +1(0) = 0 with RT +1 = {0}.The interpretation of (6) is as follows. Given the optimal production plan Ft+1(Xt+1) for periods

t + 1, . . . , T , we can find the optimal production plan for some Xt ∈ Rt by taking the minimum ofFt+1(Xt+1) + Pt(Xt − Xt+1) for Xt+1 ∈ Rt+1, i.e., produce xt = Xt − Xt+1 units in period t. Note thatthe restriction 0�Xt − Xt+1 �ct is implicit in the definition of Pt(x). The minimal cost of the overalloptimal production plan can be found by calculating F1(D1). We will call the execution of (6) for a certaint a recursion step or iteration.

The above recursion is similar to the backward version of the algorithm proposed by Chen et al. [11].They showed that Ft(Xt) is a piecewise linear and right continuous cost function and we are looking forthe lower envelope of a finite number of line pieces. In the case of no restrictions on the cost parameters,Ft(Xt) may change over the whole interval [At, Dt ] in every iteration t. However, we will show that theminimum cost function Ft(Xt) will only change in the interval [Dt+1, Dt ] because of the special coststructure we consider. In other words, if ft+1(Xt+1) is a line piece of Ft+1(Xt+1), it will be a line piece ofFt(Xt) as well (if ft+1(Xt+1) is still contained in [At, Dt ]) and it will not be replaced by some other line

W. van den Heuvel, A.P.M. Wagelmans / Computers & Operations Research 33 (2006) 3583–3599 3587

..

..

..

..

..

..

..

..

..

.

.............................

.........................

F

X t , X t +1

Kt

a bX

f 2( Xt) := ft + 1(b) + K

t + pt( Xt − b)

ft +1(Xt +1)�

f t + 1( X ) + K t + p t(X t − X )

f 1(X t )

Fig. 1. Updating Ft+1.

piece. So the main difference with Chen et al. [11] is that we consider smaller intervals when updatingFt(Xt).

Geometrically the recursion is as follows. Let ft+1(Xt+1) be a line piece of Ft+1(Xt+1) defined onsome interval 〈a, b] (see Fig. 1). For a fixed value X ∈ 〈a, b], producing xt = Xt − X leads to a cost offt+1(X) + Kt + ptxt . So the thin lines in Fig. 1 represent the costs for producing Xt = Xt+1 + xt units.Taking the minimum over all values of Xt we get the two functions

f 1(Xt) = ft+1(Xt) + Kt for a�Xt �b,

f 2(Xt) = ft+1(b) + Kt + pt(Xt − b) for b < Xt �b + ct .

Note that f 1(Xt)�ft+1(Xt), so f 1(Xt) will never contribute to Ft(Xt). This means that we only have toconsider line pieces of type f 2(Xt), which have slope pt . Because ft+1(Xt+1) was a type f 2 line piececreated in some iteration s� t +1, we have pt �ps =�. So, for all line pieces in Ft+1(Xt+1) we constructa type f 2 line and update Ft+1(Xt+1) with these lines obtaining Ft(Xt). Note that to construct a typef 2 line piece, only the point ft+1(b) is needed. Furthermore, note that in the case pt < �, line f 2 couldhave intersected ft+1. This is why the number of line pieces may grow exponentially in the case that wedo not have non-increasing marginal production costs (a NP-hard problem in general). In the remainderof this paper we will call a line piece j created from line piece i the successor of line j and line i is calledthe predecessor of line j. We will now show that line pieces in Ft+1(Xt+1) will never be replaced initeration t.

Proposition 1. For a NI/G/NI/ND problem it holds that Ft(X) = Ft+1(X) for all X ∈ Rt+1 ∩ Rt .

Proof. We will prove the proposition by induction. The proposition holds for t =T , because RT +1∩RT ={0} and FT +1(0) = 0. Assume there is some X ∈ Rt+1 ∩ Rtwith Ft(X) < Ft+1(X) for some t �T − 1.Ft(X) is the successor of some line piece fs defined on 〈as, bs] in iteration s with s� t + 1, i.e.,

Ft(X) = fs(bs) + Kt + pt(X − bs).

• s > t + 1:

3588 W. van den Heuvel, A.P.M. Wagelmans / Computers & Operations Research 33 (2006) 3583–3599

...........................................

..

..

.......

.

Ft +1

X t +1Xbsbr

Ft (X )

Ft +1(X )

fr

fs

Fig. 2. Contradicting situation described in the proof of Proposition 1.

Then we have

fs(bs) + Kt+1 + (X − bs)pt+1 �fs(bs) + Kt + (X − bs)pt = Ft(X) < Ft+1(X),

which contradicts the minimality of Ft+1(X) in iteration t + 1. Note that there is enough capacity toproduce X − bs in period t + 1, because 0 < X − bs �ct �ct+1.

• s = t + 1:Let fr(x) (defined on 〈ar, br ]) be the predecessor of Ft+1(X), i.e.,

Ft+1(X) = fr(br) + Kt+1 + (X − br)pt+1.

Because Ft+1 is non-decreasing and the slope of fr is smaller than the slope of fs (line fr was createdin some iteration r � t + 1 = s), we have:

fr(br) + (bs − br)pt+1 �fs(bs).

Note that by the induction hypothesis, we must have br < bs . But

Ft+1(X) = fr(br) + Kt+1 + (X − br)pt+1

= fr(br) + Kt+1 + (X − bs)pt+1 + (bs − br)pt+1

�fs(bs) + Kt+1 + (X − bs)pt+1

�fs(bs) + Kt + (X − bs)pt

= Ft(X),

which contradicts our initial assumption. �

A picture of this contradicting situation can be found in Fig. 2. The claim in the proposition states thatFt(X) is equal to Ft+1(X) with some new line pieces added to the right. Because pt is non-increasing,the slopes of the line pieces in Ft are non-decreasing if the lines are ordered from left to right. The lengthof the interval to consider in each iteration can be reduced considerably. Because only line pieces of typef 2 (with domain length ct ) may contribute to Ft , we only have to search the interval [Dt+1 − ct , Dt+1]for candidate successors (for the other line pieces there is not sufficient capacity to contribute to Ft ). In

W. van den Heuvel, A.P.M. Wagelmans / Computers & Operations Research 33 (2006) 3583–3599 3589

conclusion Ft(Xt) is constructed in the following way. Starting with Ft+1(Xt+1) construct type f 2 linepieces from the line pieces in the interval [Dt+1 − ct , Dt+1], check if they contribute to Ft(Xt), and addthem to Ft(Xt) if necessary.

2.3. Time complexity of the algorithm

We will show that our algorithm runs in O(T 2) time. Note that in each recursion step we have to createa line piece from an existing line piece, we have to check if this line piece will contribute to Ft and wehave to add it to Ft if necessary. The above steps can be carried out in constant time, so by determiningthe total number of line pieces considered in each recursion step, we find the time complexity of thealgorithm.

Proposition 2. In iteration t − 1 the number of line pieces to be considered will be at most one morethan in each iteration t.

Proof. Recall that only successors from line pieces in the interval [Dt+1 − ct , Dt+1] may contribute toFt . Let 1, . . . , mt+1 be those line pieces numbered from right to left. Define:

s = Dt − ct = Dt+1 + dt − ct �Dt+1.

Furthermore, let S1 = {1, . . . , ns} be the set of line pieces i with bi �s and S2 = {ns + 1, . . . , mt+1} bethe set of line pieces i with bi < s. S2 may be empty if s�0.

For a successor of a line piece i ∈ S1 we have bi + ct �s + ct = Dt . So successors of line pieces in S1cover the whole interval [Dt+1, Dt ]. Because line pieces created in iteration t have equal slopes, thereis only one of these line pieces that will contribute to Ft . Now consider a line piece i ∈ S2. We haveDt+1 �bi + ct < s + ct = Dt . So every line piece i ∈ S2 may contribute to Ft . This means that in totalwe may have at most mt+1 − ns + 1 new line pieces in Ft .

Now look at the number of line pieces considered in iteration t − 1. These are the line pieces in theinterval

[Dt − ct−1, Dt ] ⊂ [s, Dt ] = [s, Dt+1] ∪ [Dt+1, Dt ].But the number of line pieces in those two intervals equals at most (ns) + (mt+1 − ns + 1) = mt+1 + 1,which is one more than the number of line pieces considered in iteration t. �

A visual representation can be found in Fig. 3. The horizontal lines represent the intervals on which theline pieces of Ft are defined (we do not show the functions themselves). In iteration t we have to considerfive line pieces for possible contribution to Ft and at most two new line pieces will be created. Line 7 isthe successor of line 2, 3, 4 or 5 and line 6 is the successor of line 1. If line 6 contributes to Ft , we seethat the number of line pieces to be considered in iteration t − 1 is increased by one to six. But if line 6does not contribute to Ft , the number of line pieces will not increase.

Assume we have line pieces i, j with bi < bj and i ∈ S2 (in our example i = 1 and j ∈ {2, 3, 4, 5}).We know that the successors of lines i and j in iteration t both have slope pt . If f (bi)�f (bj ) + (bj −bi)pt , then the successor of line i is dominated by the successor of line j and will not contribute to Ft .

3590 W. van den Heuvel, A.P.M. Wagelmans / Computers & Operations Research 33 (2006) 3583–3599

ct −1

Dt +1

Dt

Dt − 1

dt

dt

dt −1

Dt − ct −1

Dt −1 − ct − 2

s

s

Ft +1

Ft

Ft − 1

Dt +1 − ct1 2 3 4 5

2 3 4 5 6 7

3 4 5 6 7 8

ct − 2

..

..

..

..

..

..

.

..

..

..

..

..

..

.

Fig. 3. Graphical representation of the proof of Proposition 2.

For example, if the successor of line 1 was dominated by the successor of line 2 in Fig. 3, then only onenew line piece was added to Ft .

It also follows from Fig. 3 that if capacities are strictly increasing, then the number of line pieces to beconsidered may not increase. Because ct−2 < ct−1, line 2 need not be considered in iteration t − 2 andthe number of line pieces to be considered in this iteration still equals six as in iteration t − 1. Note thatif ct−2 was equal to ct−1, then line 2 needed to be considered in iteration t − 2.

Theorem 3. The time complexity of the algorithm is O(T 2).

Proof. Let mt be the number of line pieces considered in iteration t. Then we have mT = 1 and byProposition 2 we have mt �mt+1 + 1 for t = 1, . . . , T − 1, so that mt �T − t + 1 for t = 1, . . . , T .Summing up all line pieces to be considered yields

T∑t=1

mt �T∑

t=1

(T − t + 1) =T∑

t=1

t = 1

2T (T + 1),

which implies that the time complexity of the algorithm is O(T 2). �

2.4. Numerical example

In this section we give a numerical example of our algorithm. Consider the following four-periodexample which has been taken from Chung and Lin [10]:

d = (30, 40, 70, 30)

c = (60, 70, 80, 90)

K = (50, 40, 30, 20)

p = (5, 5, 5, 4)

h = (1, 2, 3, 4).

W. van den Heuvel, A.P.M. Wagelmans / Computers & Operations Research 33 (2006) 3583–3599 3591

After rewriting this problem as a problem without holding cost, we have

p′ = (15, 14, 12, 8), D = (30, 70, 140, 170) andT∑

t=1

(ht

t∑i=1

di

)= 1270.

After solving the problem with the new production cost, subtract 1270 from the optimal value to obtainthe minimal cost for the original problem.

In the first iteration (t = 4) create one line piece from (0, 0) (see Fig. 4 for the whole construction ofthe minimum cost function). The setup cost of 20 plus the production of x4 = 30 items at a cost of eightleads to a total cost of 260. In the second iteration (t = 3) line piece (2), successor of line (1), covers thewhole interval [30, 100]. However, there is another line piece which may contribute to this interval. Thisis line (3) which corresponds to full production in period 3. Note that this line is created from the point(0, 0). We see that this line does not contribute to the minimum cost function. So production of x3 = 50units in period 3 and x4 = 30 units in period 4 with total cost 890 is preferred over full production inperiod 3 (x3 = 80), which has cost 990.

In the third iteration (t =2) only line (4), the successor of line (2), contributes to the interval [100,140].The successor of line (1) is not considered, because it cannot contribute to this interval since productioncapacity is too small. In the last iteration the same happens and line (5) (the successor of line (4)) is theonly line which contributes to the minimum cost function. The total costs equal 2230 corresponding toproduction plan x = (30, 40, 70, 30). So the costs of the original problem equal 2230 − 1270 = 960,which is equal to the solution found in Chung and Lin [10]. In Fig. 4 the intervals from which new linepieces are created are indicated below the horizontal axis in each iteration.

2.5. Comparison of the algorithm with Chung and Lin [10]

To compare our algorithm with the O(T 2) algorithm by Chung and Lin [10], we first briefly describethe main ideas of their algorithm. Chung and Lin [10] defined a subplan suv (1�u�v�T ) as the portionof the solution that covers period u trough v. Here periods u − 1 and v are two consecutive regenerationpoints, i.e., Iu−1 = Iv = 0. Because a NI/G/NI/ND problem satisfies the property It−1xt (xt − Ct) = 0for all t (see Bitran and Yanasse [7]), it must hold that there is full or zero production in each period of asubplan suv except for period u.

The following subplans are candidates for the optimal solution. If a subplan is denoted by sut ={ik, . . . , i1}, where ij (j=1, . . . , k−1) is a period with capacity production and 1�u=ik < ik−1 < · · · < i1� t , then a candidate subplan sut satisfies the property

in = max{i : i < in−1 and ci < (di + · · · + dt ) − (ci1 + · · · + cin−1)},for n = 1, . . . , k − 1 where i0 = t + 1. So in is the largest period for which demand in periods in, . . . , t

cannot be satisfied by capacities ci1, . . . , cin . This demand will be satisfied by a previous productionperiod.

Candidate subplans sut are built in the following way. Assume at period v we have the partial can-didate subplan {. . . , v < in−1, . . . , i1 � t}. If ci1 + · · · + cin−1 + cv �dv + · · · + dt , then we have foundthe candidate subplan svt = {in = v, in−1, . . . , i1}. Continue with period v − 1 and partial candidatesubplan {. . . , in−1, . . . , i1} to search for other candidate subplans. This means that v is a period of zero

3592 W. van den Heuvel, A.P.M. Wagelmans / Computers & Operations Research 33 (2006) 3583–3599

0

(1)

(1)

(1)

30

(2)

1130

(4)

(2)

260

0

0 30

(2)

(4)

(5)

22300

30

(1)

(3)

9901130

30 80 100

890

100 140

260

260

1730

t = 4

1130

1730

140 170100

t = 1

t = 2

t = 3

110

40

260

F4(X 4)

F3(X 3)

F2(X 2)

F1(X 1)

X4

X 3

X2

X1

Fig. 4. Construction of the minimum cost function.

production in the following candidate subplans. If ci1 + · · ·+ cin−1 + cv > dv + · · ·+ dt , then there existsno subplan svt and we continue with partial subplan {. . . , in =v, in−1, . . . , i1}, so v is a period of capacityproduction in the following candidate subplans.

W. van den Heuvel, A.P.M. Wagelmans / Computers & Operations Research 33 (2006) 3583–3599 3593

Table 1Costs of the candidate subplans of the numerical example

sut , C(sut ) u = 1 u = 2 u = 3 u = 4

t = 1 {1}, 500t = 2 × {2}, 600t = 3 × × {3}, 870t = 4 × {2, 3}, 1870 × {4}, 260

Denote the set of candidate subplans sut with 1�u� t by Vt , the cost associated with candidate subplansut by C(sut ), and the minimal cost for period 1 through t by f (t). Then

f (t) = minu=1,...,t

{f (u − 1) + C(sut ) : sut ∈ Vt }

with f (0) = 0. All candidate subplans in Vt with corresponding costs can be constructed in O(t) timestarting in period t with candidate subplan stt and ending in period 1 with s1t . However, our algo-rithms detects in an early stage that some candidate subplans will never occur in an optimal solu-tion. If we compare both methods, we see that a line piece that covers the point Dt in iteration tin our method, corresponds to a partial production period in the method of Chung and Lin [10] andwe have found a candidate subplan in terms of this method. Furthermore, a line piece fi (defined on〈ai, bi]) with Dt+1 < bi < Dt in our method corresponds to a period of full production in a candidatesubplan.

Our algorithm detects in an early stage that some candidate subplans may not occur in the optimalsolution. It is never optimal to build subplans on certain full production periods. If line k is a succes-sor of line i that does not contribute to Ft , then it will also not contribute in the following iterationsto the minimum cost function. So if k is a full production period in the partial subplan {. . . , k, . . . , t}that is not optimal, then all subplans sjt (j = 1, . . . , k − 1) will also not occur in the optimal so-lution. However, the algorithm of Chung and Lin [10] does consider these candidate subplans. Con-versely, all line pieces considered in our method are also considered in the subplans of the algorithm byChung and Lin [10]. The numerical example will make the relation between our algorithm and subplansmore clear.

Let us solve the problem instance of Section 2.4 by the method of Chung and Lin [10]. The candidatesubplans sut can be found in Table 1. In each cell one finds the production periods with correspondingcosts. For example, the cost of subplan s2,4 = {2, 3} equals 40 + 60 · 14 + 30 + 80 · 12 = 1870. We usedthe modified production costs to make it easier to compare both methods. An × indicates that there existsno candidate subplan. There are two possible production plans: combining subplans s1,1 and s2,4 withtotal costs 2370 or combining subplans s1,1, s2,2, s3,3, and s4,4 with total costs 2230.

The first iteration of our algorithm corresponds to subplan s44 = {4}. However, subplan s2,4 = {2, 3}corresponding to production of 60 units in period 2 and full production of 80 units in period 3 will notbe found in our algorithm. It follows from Fig. 4 (iteration t = 3) that full production in period 3 is notoptimal and there are no successors of line (3). No new subplans will be built on the production planwith full capacity in period 3. In this example there is only one candidate subplan (s2,4) excluded, but forlarger problem instances this number will be much larger (see also Section 4).

3594 W. van den Heuvel, A.P.M. Wagelmans / Computers & Operations Research 33 (2006) 3583–3599

3. Improving the algorithm for large capacities

If capacities are large, we can improve our algorithm further by keeping a lower envelope for a cer-tain interval of the minimum cost function Ft . Wagelmans et al. [5] used a similar idea to solve theWagner–Whitin problem in linear time. They noticed that only points fi(bi) are important, where fi isa line piece of Ft defined on 〈ai, bi], and they keep a lower envelope of these points. However, in theWagner–Whitin problem, capacities are infinite, whereas in the CLSP this is not the case.

We modify our algorithm by keeping a lower envelope of the points fi(bi) in iteration t with bi ∈[Dt − ct , Dt+1]. Because capacity is sufficiently large to cover the point Dt , capacity seems to be infinitefor these lines and the ideas of Wagelmans et al. [5] can be applied. In iteration t the lower envelope isupdated as follows. The points fi(bi) with bi < Dt−1 − ct−1 leave the lower envelope and the newpoints created in the interval [Dt+1, Dt ] are added to the lower envelope. Because a lower envelope canbe constructed in linear time, the theoretical running time remains O(T 2) as in our original algorithm.Wagelmans et al. [5] showed that the points in the lower envelope have the following properties.

Property 1. Only successors of the points in the lower envelope may contribute to Ft .

Property 2. If the optimal line piece that covers Dt is successor of the point fi(bi) in iteration t, thenthe optimal line piece that covers Dt−1 is successor of a point fj (bj ) with bj �bi in iteration t − 1.

If capacities are relatively small, which implies that the lower envelope contains few points, the con-struction of a lower envelope will not be useful in lowering the practical running time. However, ifcapacities are relatively large, we have the following advantages. Firstly, points fi(bi) that are containedin the interval [Dt − ct , Dt+1] for several iterations but do not contribute to the lower envelope, do notneed to be considered for these iterations. This follows from Property 1. Secondly, Property 2 impliesthat points fj (bj ) with bj < bi do not have to be considered in iteration t − 1, if fi(bi) is the predecessorof the point Ft(Dt).

The advantages of both properties are shown in Fig. 5. In both pictures we do not present the whole linesfi but only the points fi(bi). In the upper picture we see the lower envelope of the points in the interval[Dt − ct , Dt+1]. There are four points that may cover Dt , but the minimum is attained by the successorof point c. Furthermore, point e also contributes to Ft . Now look at the points we have to consider initeration t − 1 (lower picture). First we construct the lower envelope in the interval [Dt−1 − ct−1, Dt ].There is one new point in Ft which contributes to the lower envelope and point e will not contributeanymore. Furthermore, point a is contained in the lower envelope of iteration t − 1 but not in the lowerenvelope of iteration t.

Now look at the points that are necessary and those that are not necessary to consider. We see thatpoints b and d are not considered in both iterations t and t −1 (the advantage of Property 1). Furthermore,because the minimum in Dt was attained from point c, point f need also not be considered in iterationt − 1 (the advantage of Property 2). It is easy to see that the minimum in Dt−1 will not be attained by thesuccessor of point f, because pt is increasing for decreasing order of t.

Finally, if capacities satisfy ct �∑T

i=t di (this is the uncapacitated Wagner–Whitin case), then ouralgorithm reduces to the algorithm of Wagelmans et al. [5], which is a linear time algorithm. If capacitiesare sufficiently large, then in each iteration there is only one new line piece created and Property 2 assuresthat we have to consider O(T) line pieces in total. For details we refer to Wagelmans et al. [5]. However,

W. van den Heuvel, A.P.M. Wagelmans / Computers & Operations Research 33 (2006) 3583–3599 3595

...........

........

........

........

.

........

........

........

........

........

........

........

.

..

..

..

..

..

..

.

..

..

..

..

..

..

.........

........

........

........

.......

..

..

..

..

..

.........

........

........

........

........

........

.....

..

..

..

..

..

..

.........

.....

F

F

XDt +1 D t

ct

ab

c

d

e

ab

c

f

d

e

f

D t D t − 1X

ct −1

Fig. 5. Updating the lower envelope.

as mentioned in Chung and Lin [10], the algorithm reduces to the original Wagner–Whitin algorithmwhich is O(T 2). This is also the case for our original algorithm presented in Section 2.

4. Computational results

We have tested our algorithm empirically using the same problem instances as in Chen et al. [11]. Thatis, the demand pattern is generated by the formula

dt = � + �εt + a sin

[2�

c(t + c/2)

]

3596 W. van den Heuvel, A.P.M. Wagelmans / Computers & Operations Research 33 (2006) 3583–3599

Table 2Average running times (in seconds) of the algorithms (maxima in parentheses)

T = 500 T = 1000 T = 2000

K C A1 A2 CL A1 A2 CL A1 A2 CL

100 250 0.01 0.01 0.14 0.02 0.01 0.55 0.03 0.02 2.20(0.02) (0.02) (0.14) (0.02) (0.02) (0.59) (0.03) (0.03) (2.34)

700 0.01 0.01 0.16 0.01 0.02 0.64 0.03 0.03 2.55(0.02) (0.02) (0.17) (0.02) (0.02) (0.66) (0.03) (0.03) (2.64)

1200 0.01 0.01 0.17 0.02 0.02 0.65 0.03 0.03 2.61(0.02) (0.02) (0.17) (0.03) (0.03) (0.67) (0.05) (0.03) (2.64)

900 250 0.01 0.01 0.14 0.02 0.02 0.55 0.03 0.04 2.20(0.02) (0.02) (0.16) (0.03) (0.03) (0.58) (0.05) (0.06) (2.28)

700 0.01 0.01 0.16 0.02 0.02 0.64 0.03 0.03 2.54(0.02) (0.02) (0.17) (0.03) (0.03) (0.67) (0.03) (0.05) (2.64)

1200 0.01 0.01 0.16 0.02 0.02 0.65 0.03 0.03 2.62(0.02) (0.02) (0.17) (0.02) (0.03) (0.67) (0.05) (0.03) (2.69)

3600 250 0.02 0.02 0.14 0.03 0.03 0.55 0.06 0.07 2.19(0.03) (0.03) (0.16) (0.06) (0.06) (0.58) (0.09) (0.13) (2.27)

700 0.01 0.02 0.16 0.03 0.03 0.64 0.05 0.05 2.55(0.02) (0.03) (0.17) (0.03) (0.03) (0.66) (0.06) (0.06) (2.61)

1200 0.01 0.01 0.17 0.02 0.02 0.66 0.04 0.04 2.61(0.02) (0.02) (0.17) (0.03) (0.03) (0.67) (0.05) (0.05) (2.67)

for t = 1, . . . , T , where � is the average demand, � the standard deviation of demand, εt the i.i.d.standard normal random variable, a the amplitude of the seasonal component, c the cycle length ofthe seasonal component. If demand is negative for some period, demand is set to zero and only fea-sible problem instances are generated, i.e., problem instances that satisfy

∑ti=1ci �

∑ti=1di for

t = 1, . . . , T .We have four different types of demand: (1) �=67, a=0, (2) �=237, a=0, (3) �=67, a=125, c=T ,

(4) � = 67, a = 125, c = 12 and for each type of demand we set � = 200. For each type of demand fiveproblem instances are generated, so that we have 20 test instances for some parameter setting of Kt , ct ,pt , and ht . Furthermore, we set Kt =K = 100, 900, and 3600, ht =h= 1, pt =p = 0, and ct =C = 250,700, and 1200. We performed tests for model horizons T = 500, 1000, and 2000.

In Table 2 are the average running times (in seconds) of the algorithms. The algorithms were coded ona Pentium IV 1.8 GHz with 256 MB RAM. The maximum running time for each set of 20 instances isdenoted in parentheses. Algorithm A1 is our first proposed algorithm of Section 2, Algorithm A2 is thealgorithm of Section 3 where we keep the lower envelope and algorithm CL is the algorithm proposed byChung and Lin [10]. It follows from Table 2 that both Algorithm A1 and A2 are faster than algorithm CLfor all parameter settings. Note that the maximum running times of Algorithms A1 and A2 are below theaverage running times of algorithm CL for all parameter settings, so that statistical tests are not necessaryto validate the better performance of Algorithms A1 and A2.

W. van den Heuvel, A.P.M. Wagelmans / Computers & Operations Research 33 (2006) 3583–3599 3597

Table 3Average number of line pieces considered (maxima in parentheses)

T = 500 T = 1000 T = 200012 T (T + 1) 125250 500500 2001000

K C A1 A2 CL A1 A2 CL A1 A2 CL

100 250 1063 1049 123517 2139 2112 498858 4271 4220 1984385(1140) (1104) (125250) (2282) (2205) (500500) (4520) (4374) (2001000)

700 1891 1385 125147 3788 2765 500408 7623 5553 2001000(2307) (1510) (125250) (4654) (3033) (500500) (9262) (6071) (2001000)

1200 3001 1427 125238 5990 2854 500500 12001 5715 2000979(3853) (1520) (125250) (7541) (3031) (500500) (14898) (6071) (2001000)

900 250 2001 1831 124599 4047 3699 497542 8024 7341 1996817(2995) (2789) (125250) (5836) (5432) (500500) (11311) (10636) (2001000)

700 2330 1661 125249 4774 3360 500488 9480 6704 2000701(2753) (1791) (125250) (5548) (3621) (500500) (11023) (7217) (2001000)

1200 3005 1674 125241 6053 3379 500485 12031 6749 2001000(3750) (1840) (125250) (7717) (3689) (500500) (15008) (7387) (2001000)

3600 250 4322 3638 124561 8997 7486 499178 17970 14893 1996696(7749) (6585) (125250) (15942) (13730) (500500) (31471) (26981) (2001000)

700 5132 2500 125250 10393 5025 500500 20963 10113 2000865(5995) (2721) (125250) (12257) (5468) (500500) (24283) (10921) (2001000)

1200 4250 1798 125191 8545 3607 500479 17132 7229 2000965(5071) (1913) (125250) (10059) (3904) (500500) (19857) (7742) (2001000)

To study the running times in more detail we also counted the number of relevant steps performed by thealgorithms. In Table 3 are the average number of times a line piece is considered for possible contributionto the minimum cost function Ft . For Algorithm CL the number of times a time period is consideredfor possible contribution to a candidate subplan is shown. The worst case number is 1

2T (T + 1) and canbe found in the second row of the table. For algorithm CL we observe a clear quadratic behavior: as Tdoubles, the number of potential candidate subplans quadruples. We also see that the maximum numberachieves the theoretical worst case number for all parameter settings.

For Algorithms A1 and A2 we observe a linear increase of the total number of line pieces considered:as T doubles, the number of line pieces considered doubles. Because we keep the lower envelope inAlgorithmA2, we see that the number of line pieces considered is smaller than inAlgorithmA1. Especiallyfor C =1200 there is a clear difference. However, the construction of the lower envelope takes more timethan the gain achieved by it which results in larger average running times.

We performed more tests with larger capacities (C = 2000, 5000, and 10,000) to see whether keep-ing a lower envelope could result in a gain in running time. The results of these tests are in Tables 4and 5 . We see that Algorithm A2 performs at least as good as Algorithm A1 in all cases. The gain whichis obtained by keeping the lower envelope is evident in Table 5. For example, the average number of linepieces considered in Algorithms A1 and A2 is 91,316 and 6464, respectively, for the parameter setting

3598 W. van den Heuvel, A.P.M. Wagelmans / Computers & Operations Research 33 (2006) 3583–3599

Table 4Average running times (in seconds) for relatively large capacities (maxima in parentheses)

T = 500 T = 1000 T = 2000

K C A1 A2 A1 A2 A1 A2

100 2000 0.01 0.01 0.02 0.02 0.03 0.03(0.02) (0.02) (0.03) (0.03) (0.05) (0.03)

5000 0.02 0.01 0.03 0.02 0.05 0.03(0.03) (0.02) (0.05) (0.02) (0.08) (0.03)

10000 0.02 0.01 0.05 0.02 0.09 0.03(0.03) (0.02) (0.06) (0.02) (0.11) (0.03)

900 2000 0.01 0.01 0.02 0.02 0.04 0.03(0.02) (0.02) (0.03) (0.03) (0.05) (0.03)

5000 0.02 0.01 0.03 0.02 0.06 0.03(0.03) (0.02) (0.05) (0.03) (0.08) (0.03)

10000 0.02 0.01 0.05 0.02 0.09 0.03(0.03) (0.02) (0.06) (0.02) (0.11) (0.03)

3600 2000 0.01 0.01 0.02 0.02 0.04 0.03(0.02) (0.02) (0.03) (0.03) (0.05) (0.03)

5000 0.02 0.01 0.03 0.02 0.06 0.03(0.03) (0.02) (0.05) (0.02) (0.08) (0.03)

10000 0.03 0.01 0.05 0.02 0.09 0.03(0.03) (0.02) (0.06) (0.03) (0.13) (0.05)

T =2000, K=3600, and C=10, 000. We conclude that bothAlgorithmsA1 andA2 outperform algorithmCL and that Algorithm A2 is preferred over Algorithm A1 in the case of relatively large capacities.

5. Conclusion

In this paper we proposed an O(T 2) algorithm to solve the CLSP with non-increasing setup costs, gen-eral holding cost, non-increasing production costs, and non-decreasing capacities. While the theoreticalrunning time of the proposed algorithm is equal to the time complexity of the algorithm proposed byChung and Lin [10], we showed that on the basis of a cost argument our algorithm considers less candidatesolutions. Furthermore, we showed that our algorithm can be improved for the case of relatively largecapacities.

Numerical tests showed that both of our algorithms outperform the algorithm of Chung and Lin [10].For the latter algorithm, as the model horizon increased, we observed a quadratic increase in the numberof relevant steps performed by the algorithm, whereas our algorithms exhibited a linear increase. Finally,we showed that in the case of an uncapacitated problem our improved algorithm reduces to the linear timealgorithm of Wagelmans et al. [5], while the algorithm of Chung and Lin [10] reduces to the classicalO(T 2) Wagner–Whitin algorithm.

W. van den Heuvel, A.P.M. Wagelmans / Computers & Operations Research 33 (2006) 3583–3599 3599

Table 5Average number of line pieces considered for relatively large capacities (maxima in parentheses)

T = 500 T = 1000 T = 2000

K C A1 A2 A1 A2 A1 A2

100 2000 4736 1417 9597 2854 19100 5705(6104) (1511) (12404) (3026) (24172) (6067)

5000 11436 1407 23036 2836 46539 5705(14457) (1499) (29331) (3015) (59428) (6060)

10000 21487 1383 44789 2812 91426 5683(27483) (1476) (56496) (2989) (115691) (6023)

900 2000 4757 1693 9535 3393 19008 6789(6065) (1841) (11894) (3698) (23778) (7393)

5000 11388 1669 22926 3364 46249 6777(14746) (1832) (28968) (3668) (57685) (7373)

10000 21532 1641 45183 3354 90952 6752(26355) (1791) (57304) (3654) (114472) (7333)

3600 2000 4772 1616 9619 3253 19487 6532(6103) (1741) (12050) (3523) (24506) (7025)

5000 11322 1600 22885 3228 46462 6500(14132) (1727) (28789) (3513) (58298) (7020)

10000 21797 1579 44901 3201 91316 6464(28066) (1711) (56682) (3470) (115021) (6983)

References

[1] Florian M, Lenstra JK, Rinnooy Kan AHG. Deterministic production planning: algorithms and complexity. ManagementScience 1980;26:669–79.

[2] Shaw DX, WagelmansAPM.An algorithm for single-item capacitated economic lot sizing with piecewise linear productioncosts and general holding costs. Management Science 1998;44:831–8.

[3] Wagner HM, Whitin TM. Dynamic version of the economic lot size model. Management Science 1958;5:89–96.[4] Federgruen A, Tzur M. A simple forward algorithm to solve general dynamic lot sizing models with n periods in O(n log n)

or O(n) time. Management Science 1991;37:909–25.[5] Wagelmans APM, Van Hoesel CPM, Kolen A. Economic lot sizing: an O(n log n) algorithm that runs in linear time in the

Wagner–Whitin case. Operations Research 1992;40:S145–56.[6] Aggarwal A, Park JK. Improved algorithms for economic lot-size problems. Operations Research 1993;14:549–71.[7] Bitran GR, Yanasse HH. Computational complexity of the capacitated lot size problem. Management Science 1982;28:

1174–86.[8] Florian M, Klein M. Deterministic production planning with concave costs and capacity constraints. Management Science

1971;18:12–20.[9] Van Hoesel CPM, Wagelmans APM. An O(T 3) algorithm for the economic lot-sizing problem with constant capacities.

Management Science 1996;42:142–50.[10] Chung CS, Lin CHM. An O(T 2) algorithm for the NI/G/NI/ND capacitated lot size problem. Management Science

1988;34:420–6.[11] Chen H-D, Hearn DW, Lee C-Y. A new dynamic programming algorithm for the single item capacitated lot size model.

Journal of Global Optimization 1994;4:285–300.