A Dynamic Programming Algorithm for Single-Item Capacitated Economic Lot Sizing with Start-up Costs, Piecewise Linear Production Costs and Piecewise Linear Holding Costs
Lutz Tautenhahn (1997, 1999, 2001, 2024)
C++ Sourcecode is available at http://www.lutanho.net/plt/lotsize.zip
Online-Version (HTML/JS-Sourcecode) is available at http://www.lutanho.net/plt/lotsize.html (2024)
Data: | |||
I | - number of periods | ||
ximin | - min. feassible production quantity in period i | (i = 1...I) | |
ximax | - max. feassible production quantity in period i | (i = 1...I) | |
yimin | - min. feassible inventory quantity in period i | (i = 1...I-1) | |
yimax | - max. feassible inventory quantity in period i | (i = 1...I-1) | |
y0 | - inventory quantity at the end of period 0 | ||
yI | - inventory quantity at the end of period I | ||
Ji | - number of production intervals in period i | (i = 1...I) | |
Ki | - number of inventory intervals in period i | (i = 1...I) | |
xij | - upper border of production interval j in period i | (i = 1...I, j = 0...Ji) | |
yik | - upper border of inventory interval k in period i | (i = 1...I, k = 0...Ki) | |
ai | - start-up costs in period i | (i = 1...I) | |
sij | - fix production costs in period i in interval j | (i = 1...I, j = 1...Ji) | |
cij | - variable production costs in period i in interval j | (i = 1...I, j = 1...Ji) | |
tik | - fix inventory costs in period i in interval k | (i = 1...I, k = 1...Ki) | |
hik | - variable inventory costs in period i in interval k | (i = 1...I, k = 1...Ki) | |
di | - demand in period i | (i = 1...I) | |
u0 | - binary production variable in period 0 | ||
Variables: | |||
ui | - binary production variable in period i | (i = 1...I) | |
xi | - production quantity in period i | (i = 1...I) | |
yi | - inventory quantity at the end of period i | (i = 1...I -1) |
A field is an invalid field (no field) if:
pl (integer) predecessor left pr (integer) predecessor right le (integer) left ri (integer) right hl (integer) height left dh (integer) derivative of height
ri < le orIn order to operate with the property * of a field f, the notation f .* is used (f .pl, f.pr, ...).
hl < 0 or
hl + (ri-le) * dh < 0
Fn = {f1, ..., fn}A set Fn is sorted, if and only if:
A set Fn is well-formed , if and only if:
fi.le < fi+1.le + 1 or (for all i = 1...n-1) (left sorted) fi.ri < fi+1.ri + 1 or (for all i = 1...n-1) (right sorted) ( fi.le< fi+1.le + 1 and fi.ri< fi+1.ri + 1 ) (for all i = 1...n-1) (both side sorted)
fi.ri + 1 = fi+1.le (for all i = 1...n-1)In this way a well-formed field-set can represent a piecewise linear total cost function or any other piecewise linear function.
F*1 = p*(f, d)Meaning:
3. 1. 2 Production-Transformation of a field-set Fn by a field d
pd0 production quantity = 0 for an entire inventory interval; without set-up costs; no start-up costs in this period; start-up costs in the next period possible pdl production quantity = left border of the production interval for an entire inventory interval; with set-up costs; start-up costs in this period possible, in the next period impossible pdr production quantity = right border of the production interval for an entire inventory interval; with set-up costs; start-up costs in this period possible, in the next period impossible pfl inventory quantity = left border of the inventory interval for an entire production interval; with set-up costs; start-up costs in this period possible, in the next period impossible pfl inventory quantity = right border of the inventory interval for an entire production interval; with set-up costs; start-up costs in this period possible, in the next period impossible
F*n = { f*1, ..., f*n }= P* (Fn, d) = { p* ( f1 , d), ..., p* ( fn , d) }Meaning:
If Fn is the representation of a total cost function in a certain period and d is the representation of the appropriate production cost function (linear plus set-up costs) in this period then the resulting field-sets include the representation of all possible extremal production transformations. So the optimum production transformation can be represented by at least one of these resulting field-sets for each inventory level.
Fmk = m(f, d) (k = 1, 2 or 3)Meaning:
If f is the representation of a possible total cost function in the interval [f.le, f.ri] and d is the representation of another possible total cost function in the interval [d.le, d.ri] then the resulting field-set is the representation of the minimum total costs of both in the interval [f.le, f.ri].3. 2. 2 Minimum-Interference of a well-formed field-set Fn with a field g
FMk = {m(f1, g), ..., m(fn, g)} = M ( Fn , g) = M ({f1, ..., fn}, g) (k>n-1)Meaning:
If Fn is the representation of a possible total cost function in the interval [f1.le, fn.ri] and d is the representation of another possible total cost function in the interval [d.le, d.ri] then the resulting field-set is the representation of the minimum total costs of both in the interval [f1.le, fn.ri].3. 2. 3 Minimum-Interference of a well-formed field-set Fn with a (not necessarily sorted) field-set Go
F1n(1) = M (Fn ,g1)and
Fi+1n(i+1) = M (Fin(i) ,gi+1) for i = 1...o-1In general:
FMMk = MM (Fn ,Go) = Fon(o) (k>n-1)Meaning:
If Fn is the representation of a possible total cost function in the interval [f1.le, fn.ri] and Go is the representation of o other possible total cost functions in the intervals [g1.le, g1.ri], ..., [go.le, go.ri] then the resulting field-set is the representation of the minimum total costs of all in the interval [f1.le, fn.ri].
Flk = l(f, d) (k = 1, 2, 3 or 4)Meaning:
If f is the representation of a possible total cost function in the interval [f.le, f.ri] and d is the representation of another possible total cost function in the interval [d.le, d.ri] and f.le-2<d.ri holds then the resulting field-set is the representation of the minimum total costs of both in the interval [Min{f.le, d.le}, f.ri] else in the interval [f.le, f.ri].3. 3. 2 Left-Interference of a well-formed field-set Fn with a field g
FLk = { l(f1, g), m(f2, g), ..., m(fn, g)} = L ( Fn , g) = L ({f1, ..., fn}, g) (k>n-1)Meaning:
If Fn is the representation of a possible total cost function in the interval [f1.le, fn.ri] and d is the representation of another possible total cost function in the interval [d.le, d.ri] and f1.le-2<d.ri holds then the resulting field-set is the representation of the minimum total costs of both in the interval [Min{ f1.le, d.le}, fn.ri] else in the interval [f1.le, fn.ri].3. 3. 3 Left-Interference of a well-formed field-set Fn with a sorted field-set Go
F1n(1) = L (Fn ,go)and
Fi+1n(i+1) = L (Fin(i) ,go-i) for i = 1...o-1In general:
FLLk = LL (Fn ,Go) = Fon(o) (k>n-1)Meaning:
If Fn is the representation of a possible total cost function in the interval [f1.le, fn.ri] and Go is the representation of o other possible total cost function in o intervals on [g1.le, go.ri] and f1.le-2< go.ri holds then the resulting field-set is the representation of the minimum total costs of all in the interval [Min{ f1.le, g1.le}, fn.ri] else in the interval [f1.le, fn.ri].
Frk = r(f, d) (k = 1, 2, 3 or 4)Meaning:
If f is the representation of a possible total cost function in the interval [f.le, f.ri] and d is the representation of another possible total cost function in the interval [d.le, d.ri] and f.ri+2>d.le holds then the resulting field-set is the representation of the minimum total costs of both in the interval [f.le, Max{f.ri, d.ri}] else in the interval [f.le, f.ri].3. 4. 2 Right-Interference of a well-formed field-set Fn with a field g
FRk = {m(f1, g), ..., m(fn-1, g) ), r(fn, g)} = R ( Fn , g) = R ({f1, ..., fn}, g) (k>n-1)Meaning:
If Fn is the representation of a possible total cost function in the interval [f1.le, fn.ri] and d is the representation of another possible total cost function in the interval [d.le, d.ri] and fn.ri+2>d.le holds then the resulting field-set is the representation of the minimum total costs of both in the interval [ f1.le, Max{fn.ri, d.ri}] else in the interval [f1.le, fn.ri].3. 4. 3 Right-Interference of a well-formed field-set Fn with a sorted field-set Go
F1n(1) = R (Fn ,g1)and
Fi+1n(i+1) = R (Fin(i) ,gi+1) for i = 1...o-1In general:
FRRk = RR (Fn ,Go) = Fon(o) (k>n-1)Meaning:
If Fn is the representation of a possible total cost function in the interval [f1.le, fn.ri] and Go is the representation of o other possible total cost function in o intervals on [g1.le, go.ri] and fn.ri+2> g1.le holds then the resulting field-set is the representation of the minimum total costs of all in the interval [f1.le, Max{fn.ri, gn.ri}] else in the interval [f1.le, fn.ri].
Fsk = s (f, Inf, Sup) (k = 0 or 1)Meaning:
If f is the representation of a possible total cost function in the interval [f.le, f.ri] then the resulting field-set is the representation in the interval [Max{ f.le, Inf}, Min{f.ri, Sup}].3. 5. 2 Section of a well-formed field-set Fn on the interval [Inf, Sup]
Meaning:
FSk = S (Fn, Inf, Sup) = {s(f1, Inf, Sup), ..., s(fInf, Inf, Sup), ..., s(fSup, Inf , Sup), ..., s(fn, Inf, Sup)} = {s(fInf, Inf, Sup), ..., s(fSup, Inf, Sup)} = {s(fInf, Inf, Sup), fInf+1, ..., fSup-1, s(fSup, Inf, Sup)} = {fS1, ..., fSk} (k<n+1)
If Fn is the representation of a possible total cost function in the interval [f1.le, fn.ri] then the resulting field-set is the representation in the interval [Max{ f1.le, Inf}, Min{fn.ri, Sup}].
Fck = c (f1, f2) (k = 1 or 2)Meaning:
If f1 is the representation of a possible total cost function in the interval [f1.le, f1.ri] and f2 is the representation of another possible total cost function in the interval [f2.le, f2.ri] and f1.ri+1=f2.le holds and the two fields can be consolidated (i.e. the fields ‘fit’ together) then the resulting field-set consists of only one field that is the representation of both in the interval [f1.le, f2.ri] else the resulting field-set consists of the two fields f1 and f2. In this way it is possible to reduce data without any loss of information.3. 6. 2 Consolidation of a well-formed field-set Fn at position i
FCk = C (Fn, i) = {f1, ..., c(fi, fi+1), ..., fn} (k = n-1 or n)Meaning:
If Fn is the representation of a possible total cost function then the resulting field-set is the representation of the same cost function with a Consolidation of the fields fi and fi+1. In this way it is possible to reduce data without any loss of information.3. 6. 3 Total Consolidation of a well-formed field-set Fn
F1n(1) = C (Fn, n-1)and
Fi+1n(i+1) = C (Fn(i), n-(i+1)) for i = 1 ... n-2In general:
FCCk = CC (Fn) = Fn-1n(n-1) (k<n+1)Meaning:
If Fn is the representation of a possible total cost function then the resulting field-set is the representation of the same cost function with a minimum number of fields. In this way it is possible to reduce data without any loss of information.
Fhk = h (f, g) (k = 1, 2 or 3)Meaning:
If f is the representation of a total cost function without holding costs in the interval [f.le, f.ri] and g is the representation of a linear holding cost function in the interval [g.le, g.ri] then the resulting field-set is the representation of the same total cost function in the interval [f.le, f.ri] with additional holding costs in the interval [g.le, g.ri].3. 7. 2 Linear Holding-Transformation of a well-formed field-set Fn by a field g
FHk = H (Fn, g) = {h(f1, g), ..., h(fn, g)}= {fH1, ..., fHk} (n-1<k<n+3)Meaning:
If Fn is the representation of a total cost function without holding costs in the interval [f1.le, fn.ri] and g is the representation of a linear holding cost function in the interval [g.le, g.ri] then the resulting field-set is the representation of the same total cost function in the interval interval [f1.le, fn.ri] with additional holding costs in the interval [g.le, g.ri].3. 7. 3 Piecewise Linear Holding-Transformation of a well-formed field-set Fn by a well-formed field-set Go
F1n(1) = H (Fn ,g1)and
Fi+1n(i+1) = H (Fin(i) ,gi+1) for i = 1...o-1In general:
FHHk = HH (Fn ,Go) = Fon(o) (k>n-1)Meaning:
If Fn is the representation of a total cost function without holding costs in the interval [f1.le, fn.ri] and Go is the representation of a piecewise linear holding cost function in the interval [g1.le, go.ri] then the resulting field-set is the representation of the same total cost function in the interval [f1.le, fn.ri] with additional holding costs in the interval [g1.le, go.ri].
if d.pl=0: Fopm = S ( Pd0 ( Fn, d ), Inf, Sup) (production quantity=0)if d.le<d.ri:
if d.pl>0: Fopm = S ( Pdl ( Fn, d ), Inf, Sup) (production quantity>0)
In general:
if d.pl=0: F*n = P* ( Fn, d) (for * = d0, dr, fl, fr) Fopm = CC (S (RR (RR ( Fd0n, Ffln ), LL ( Fdrn, Ffrn ) ), Inf, Sup) ) if d.pl>0: F*n = P* ( Fn, d) (for * = dl, dr, fl, fr) Fopm = CC (S (RR (RR ( Fdln, Ffln ), LL ( Fdrn, Ffrn ) ), Inf, Sup) )
Fopm = op (Fn, d, Inf, Sup) = {fop1, ..., fopm}Meaning:
If Fn is the representation of an optimum total cost function in a certain period, d is the representation of the appropriate production cost function in the next period and [Inf, Sup] is feasible inventory interval in the next period then the resulting field-set is the representation of an optimum total cost function without holding costs in the next period. The appropriate model has no start-up costs (o), linear production costs + set-up costs (p) and no holding costs, resulting in the notation op.3. 8. 2 Optimum-Transformation opt of a well-formed set Fn by a field d and a field g
Foptm = H ( op ( Fn, d, g.le, g.ri ), g )In general:
Foptm = opt (Fn, d, g) = {fopt1, ..., foptm}Meaning:
If Fn is the representation of an optimum total cost function in a certain period, d is the representation of the appropriate production cost function in the next period and g is the representation of the appropriate holding cost function in the next period in the feasible inventory interval then the resulting field-set is the representation of an optimum total cost function in the next period. The appropriate model has no start-up costs (o), linear production costs + set-up costs (p) and linear holding costs (t), resulting in the notation opt.3. 8. 3 Optimum-Transformation oPt of a well-formed field-set Fn by a well-formed field-set Dk and a field g
F1n(1) = op (Fn, d1, g.le, g.ri)and
Fi+1n(i+1) = CC (RR (Fin(i), op (Fn, di+1, g.le, g.ri) ) ) (for i = 1 ... k-1)and
FoPtm = H ( Fkn(k) , g )In general:
FoPtm = oPt (Fn, Dk, g) = {foPt1, ..., foPtm}Meaning:
If Fn is the representation of an optimum total cost function in a certain period, Dk is the representation of the appropriate production cost function in the next period and g is the representation of the appropriate holding cost function in the next period in the feasible inventory interval then the resulting field-set is the representation of an optimum total cost function in the next period. The appropriate model has no start-up costs (o), piecewise linear production costs + set-up costs (P) and linear holding costs (t), resulting in the notation oPt.3. 8. 4 Optimum-Transformation opT of a well-formed field-set Fn by a field d and a well-formed field-set Go
F1n(1) = op (Fn, d, g1.le, go.ri)and
FopTm = CC (HH (F1n(1), Go))In general:
FopTm = opT (Fn, d, Go) = {fopT1, ..., fopTm}Meaning:
If Fn is the representation of an optimum total cost function in a certain period, d is the representation of the appropriate production cost function in the next period and Go is the representation of the appropriate holding cost function in the next period in the feasible inventory interval then the resulting field-set is the representation of an optimum total cost function in the next period. The appropriate model has no start-up costs (o), linear production costs + set-up costs (p) and piecewise linear holding costs (T), resulting in the notation opT.3. 8. 5 Optimum-Transformation oPT of a well-formed field-set Fn by a well-formed field-set Dk and a well-formed field-set Go
F1n(1) = op (Fn, d1, g.le, g.ri)and
Fi+1n(i+1) = CC (RR (Fin(i), op (Fn, di+1, g.le, g.ri) ) ) (for i = 1 ... k-1)and
FoPTm = CC (HH (Fkn(k), Go))In general:
FoPTm = oPT (Fn, Dk, Go) = {foPT1, ..., foPTm}Meaning:
If Fn is the representation of an optimum total cost function in a certain period, Dk is the representation of the appropriate production cost function in the next period and Go is the representation of the appropriate holding cost function in the next period in the feasible inventory interval then the resulting field-set is the representation of an optimum total cost function in the next period. The appropriate model has no start-up costs (o), piecewise linear production costs + set-up costs (P) and piecewise linear holding costs (T), resulting in the notation oPT.3. 8. 6 Optimum-Transformation Opt of two well-formed sets Em and Fn by an integer c, a field d and a field g
EOptp = H (CC (S (MM (Pd0 (Fn, d), Pd0 (Em, d)), g.le, g.ri)), g)if d.pl>0:
EOptp = {}In general:
EOptp = OptE (Em, Fn, d, g) = {eOpt1, ..., eOptp}In general:
d.pl = 1
Foptn(1) = opt (Fn, d, g)
d.hl = d.hl + c
FOptq = CC (MM (Foptn(1), opt (Em, d, g)))
FOptq = OptF (Em, Fn, c, d, g) = {fOpt1, ..., fOptq}Meaning:
If Em is the representation of an optimum total cost function in a certain period with production quantity=0 and no set-up costs, Fn is the representation with any production quantity and set-up costs, c is the amount of the start-up costs in the next period, d is the representation of the appropriate production cost function in the next period with no start-up costs and g is the representation of the appropriate holding cost function in the next period in the feasible inventory interval then the resulting field-sets are the representation of an optimum total cost function in the next period. The appropriate model has start-up costs (O), linear production costs + set-up costs (p) and linear holding costs (t), resulting in the notation Opt.3. 8. 7 Optimum-Transformation OPt of two well-formed sets Em and Fn by an integer c, a well-formed field-set Dk and a field g
EOPtp = H (CC (S (MM (Pd0 (Fn, d1), Pd0 (Em, d1)), g.le, g.ri)), g)if d1.pl>0:
EOPtp = {}In general:
EOPtp = OPtE (Em, Fn, Dk, g) = {eOPt1, ..., eOPtp}In general:
d1.pl = 1
F1n(1) = op (Fn, d1, g.le, g.ri)
Fi+1n(i+1) = CC (RR (Fin(i), op (Fn, di+1, g.le, g.ri) ) ) (for i = 1 ... k-1)
di.hl = di.hl + c (for i = 1 ... k)
E1m(1) = op (Em, d1, g.le, g.ri)
Ei+1m(i+1) = CC (RR (Eim(i), op (Em, di+1, g.le, g.ri) ) ) (for i = 1 ... k-1)
FOPtq = H (CC (MM (Fkn(k), Ekm(k)) ), g)
FOPtq = OPtF (Em, Fn, c, Dk, g) = {fOPt1, ..., fOPtq}Meaning:
If Em is the representation of an optimum total cost function in a certain period with production quantity=0 and no set-up costs, Fn is the representation with any production quantity and set-up costs, c is the amount of the start-up costs in the next period, Dk is the representation of the appropriate production cost function in the next period with no start-up costs and g is the representation of the appropriate holding cost function in the next period in the feasible inventory interval then the resulting field-sets are the representation of an optimum total cost function in the next period. The appropriate model has start-up costs (O), piecewise linear production costs + set-up costs (P) and linear holding costs (t), resulting in the notation OPt.3. 8. 8 Optimum-Transformation OpT of two well-formed sets Em and Fn by an integer c, a field d and a well-formed field-set Go
E1m(1) = CC (S (MM (Pd0 (Fn, d), Pd0 (Em, d)), g1.le, go.ri))if d.pl>0:
EOpTp = CC ( HH (E1m(1), Go))
EOpTp = {}In general:
EOpTp = OpTE (Em, Fn, d, Go) = {eOpT1, ..., eOpTp}In general:
d.pl = 1
FopTn(1) = opT (Fn, d, Go)
d.hl = d.hl + c
FOpTq = CC (MM (FopTn(1), opT (Em, d, Go)))
FOpTq = OpTF (Em, Fn, c, d, Go) = {fOpT1, ..., fOpTq}Meaning:
If Em is the representation of an optimum total cost function in a certain period with production quantity=0 and no set-up costs, Fn is the representation with any production quantity and set-up costs, c is the amount of the start-up costs in the next period, d is the representation of the appropriate production cost function in the next period with no start-up costs and Go is the representation of the appropriate holding cost function in the next period in the feasible inventory interval then the resulting field-sets are the representation of an optimum total cost function in the next period. The appropriate model has start-up costs (O), linear production costs + set-up costs (p) and piecewise linear holding costs (T), resulting in the notation OpT.3. 8. 9 Optimum-Transformation OPT of two well-formed sets Em and Fn by an integer c, a well-formed field-set Dk and a well-formed field-set Go
E1m(1) = CC (S (MM (Pd0 (Fn, d1), Pd0 (Em, d1)), g1.le, go.ri))if d1.pl>0:
EOPTp = CC ( HH (E1m(1), Go))
EOPTp = {}In general:
EOPTp = OPTE (Em, Fn, Dk, Go) = {eOPT1, ..., eOPTp}In general:
d1.pl = 1
F1n(1) = op (Fn, d1, g1.le, go.ri)
Fi+1n(i+1) = CC (RR (Fin(i), op (Fn, di+1, g1.le, go.ri) ) ) (for i = 1 ... k-1)
di.hl = di.hl + c (for i = 1 ... k)
E1m(1) = op (Em, d1, g1.le, go.ri)
Ei+1m(i+1) = CC (RR (Eim(i), op (Em, di+1, g1.le, go.ri) ) ) (for i = 1 ... k-1)
FOPTq = CC (HH (MM (Fkn(k), Ekm(k)), G) )
FOPTq = OPTF (Em, Fn, c, Dk, Go) = {fOPT1, ..., fOPTq}Meaning:
If Em is the representation of an optimum total cost function in a certain period with production quantity=0 and no set-up costs, Fn is the representation with any production quantity and set-up costs, c is the amount of the start-up costs in the next period, Dk is the representation of the appropriate production cost function in the next period with no start-up costs and Go is the representation of the appropriate holding cost function in the next period in the feasible inventory interval then the resulting field-sets are the representation of an optimum total cost function in the next period. The appropriate model has start-up costs (O), piecewise linear production costs + set-up costs (P) and piecewise linear holding costs (T), resulting in the notation OPT.
fd0 = { pl = f.le pr = f.ri le = f.le + d.le ri = f.ri + d.le hl = f.hl dh = f.dh }
fdl = { pl = f.le pr = f.ri le = f.le + d.le ri = f.ri + d.le hl = f.hl + d.hl dh = f.dh }
fdr = { pl = f.le pr = f.ri le = f.le + d.ri ri = f.ri + d.ri hl = f.hl + d.hl + (d.ri-d.le)*d.dh dh = f.dh }
ffl = { pl = f.le pr = f.le le = f.le + d.le ri = f.le + d.ri hl = f.hl + d.hl dh = d.dh }
ffr = { pl = f.ri pr = f.ri le = f.ri + d.le ri = f.ri + d.ri hl = f.hl + (f.ri-f.le)*f.dh + d.hl dh = d.dh }
F*1 = p*(f, d) = { f*1 } (* = d0, dl, dr, fl, fr)
There are 9 combinations, that can be distinguished by identity numbers (Case-Id’s). Cases with f.le>f.ri or d.le>d.ri are impossible.
( 1, * ): d.le < f.le+1 ( 2, * ): f.le < d.le < f.ri+1 ( 3, * ): f.ri < d.le ( *, 1 ): d.ri < f.le ( *, 2 ): f.le-1 < d.ri < f.ri ( *, 3 ): f.ri-1 < d.ri
4. 2. 2 Calculation instruction for Case-Id 1 and Case-Id 9
Case Case-Id Type of result ( 1, 1 ): 1 (= 1*1) Fmk = Fm1 ( 2, 1 ): 0 not possible ( 3, 1 ): 0 not possible ( 1, 2 ): 2 (= 1*2) Fmk = Fm1 or Fm2 or Fm3 ( 2, 2 ): 4 (= 2*2) Fmk = Fm1 or Fm3 ( 3, 2 ): 0 not possible ( 1, 3 ): 3 (= 1*3) Fmk = Fm1 or Fm2 ( 2, 3 ): 6 (= 2*3) Fmk = Fm1 or Fm2 or Fm3 ( 3, 3 ): 9 (= 3*3) Fmk = Fm1
Fmk = m(f, d) = Fm1 = { fm1 } = { f }4. 2. 3 Calculation instruction for Case-Id 2
dl = f.hl - ( d.hl + ( f.le - d.le ) * d.dh )If ( dl>0 and dr<0 ) or ( dl<0 and dr >0 ) Calculation of the integer variable lr with
dr = ( f.hl + ( d.ri - f.le ) * f.dh ) - ( d.hl + ( d.ri -d.le ) * d.dh )
lr < ( dl * d.ri - dr * f.le ) / (dl - dr ) < lr + 1 or lr = ( dl * d.ri - dr * f.le ) / (dl - dr )Sub-Case 2.1: dl-1<0 and dr-1<0
Fmk = m(f, d) = Fm1 = { fm1 } = { f }Sub-Case 2.2: dl+1>0 and dr+1>0
Sub-Case 2.3: dl>0 and dr<0
fm1 = { pl = d.pl + ( f.le - d.le ) * sign ( d.pr - d.pl ) pr = d.pr le = f.le ri = d.ri hl = d.hl + ( f.le - d.le ) * d.dh dh = d.dh }
fm2 = { pl = f.pl + ( d.ri + 1 - f.le ) * sign ( f.pr - f.pl ) pr = f.pr le = d.ri + 1 ri = f.ri hl = f.hl + ( d.ri + 1 - f.le ) * f.dh dh = f.dh }
Fmk = m(f, d) = Fm2 = { fm1, fm2 }
Sub-Case 2.4: dl<0 and dr>0
fm1 = { pl = d.pl + ( f.le - d.le ) * sign ( d.pr - d.pl ) pr = d.pl + ( lr - d.le ) * sign ( d.pr - d.pl ) le = f.le ri = lr hl = d.hl + ( f.le - d.le ) * d.dh dh = d.dh }
fm2 = { pl = f.pl + ( lr + 1 - f.le ) * sign ( f.pr - f.pl ) pr = f.pr le = lr + 1 ri = f.ri hl = f.hl + ( lr + 1 - f.le ) * f.dh dh = f.dh }
Fmk = m(f, d) = Fm2 = { fm1, fm2 }
4. 2. 4 Calculation instruction for Case-Id 3
fm1 = { pl = f.pl pr = f.pl + ( lr - f.le ) * sign ( f.pr - f.pl ) le = f.le ri = lr hl = f.hl dh = f.dh }
fm2 = { pl = d.pl + ( lr + 1 - d.le ) * sign ( d.pr - d.pl ) pr = d.pr le = lr + 1 ri = d.ri hl = d.hl + ( lr + 1 - d.le ) * d.dh dh = d.dh }
fm3 = { pl = f.pl + ( d.ri + 1 - f.le ) * sign ( f.pr - f.pl ) pr = f.pr le = d.ri + 1 ri = f.ri hl = f.hl + ( d.ri + 1 - f.le ) * f.dh dh = f.dh }
Fmk = m(f, d) = Fm3 = { fm1, fm2 , fm3 }
dl = f.hl - ( d.hl + ( f.le - d.le ) * d.dh )If ( dl>0 and dr<0 ) or ( dl<0 and dr >0 ) Calculation of the variable lr with
dr = ( f.hl + ( f.ri - f.le ) * f.dh ) - ( d.hl + ( f.ri -d.le ) * d.dh )
lr < ( dl * f.ri - dr * f.le ) / (dl - dr ) < lr + 1 orSub-Case 3.1: dl-1<0 and dr-1<0
lr = ( dl * f.ri - dr * f.le ) / (dl - dr )
Fmk = m(f, d) = Fm1 = { fm1 } = { f }Sub-Case 3.2: dl+1>0 and dr+1>0
Sub-Case 3.3: dl>0 and dr<0
fm1 = { pl = d.pl + ( f.le - d.le ) * sign ( d.pr - d.pl ) pr = d.pl + ( f.ri - d.le ) * sign ( d.pr - d.pl ) le = f.le ri = f.ri hl = d.hl + ( f.le - d.le ) * d.dh dh = d.dh }
Fmk = m(f, d) = Fm1 = { fm1 }
Sub-Case 3.4: dl<0 and dr>0
fm1 = { pl = d.pl + ( f.le - d.le ) * sign ( d.pr - d.pl ) pr = d.pl + ( lr - d.le ) * sign ( d.pr - d.pl ) le = f.le ri = lr hl = d.hl + ( f.le - d.le ) * d.dh dh = d.dh }
fm2 = { pl = f.pl + ( lr + 1 - f.le ) * sign ( f.pr - f.pl ) pr = f.pr le = lr + 1 ri = f.ri hl = f.hl + ( lr + 1 - f.le ) * f.dh dh = f.dh }
Fmk = m(f, d) = Fm2 = { fm1, fm2 }
4. 2. 5 Calculation instruction for Case-Id 4
fm1 = { pl = f.pl pr = f.pl + ( lr - f.le ) * sign ( f.pr - f.pl ) le = f.le ri = lr hl = f.hl dh = f.dh }
fm2 = { pl = d.pl + ( lr + 1 - d.le ) * sign ( d.pr - d.pl ) pr = d.pl + ( f.ri - d.le ) * sign ( d.pr - d.pl ) le = lr + 1 ri = f.ri hl = d.hl + ( lr + 1 - d.le ) * d.dh dh = d.dh }
Fmk = m(f, d) = Fm2 = { fm1, fm2 }
dl = ( f.hl + ( d.le - f.le ) * f.dh ) - d.hlIf ( dl>0 and dr<0 ) or ( dl<0 and dr >0 ) Calculation of the variable lr with
dr = ( f.hl + ( d.ri - f.le ) * f.dh ) - ( d.hl + ( d.ri -d.le ) * d.dh )
lr < ( dl * d.ri - dr * d.le ) / (dl - dr ) < lr + 1 orSub-Case 4.1: dl-1<0 and dr-1<0
lr = ( dl * d.ri - dr * d.le ) / (dl - dr )
Fmk = m(f, d) = Fm1 = { fm1 } = { f }Sub-Case 4.2: dl+1>0 and dr+1>0
Sub-Case 4.3: dl>0 and dr<0
fm1 = { pl = f.pl pr = f.pl + ( d.le - 1 - f.le ) * sign ( f.pr - f.pl ) le = f.le ri = d.le - 1 hl = f.hl dh = f.dh }
fm2 = d
fm3 = { pl = f.pl + ( d.ri + 1 - f.le ) * sign ( f.pr - f.pl ) pr = f.pr le = d.ri + 1 ri = f.ri hl = f.hl + ( d.ri + 1 - f.le ) * f.dh dh = f.dh }
Fmk = m(f, d) = Fm3 = { fm1, fm2, fm3 }
Sub-Case 4.4: dl<0 and dr>0
fm1 = { pl = f.pl pr = f.pl + ( d.le - 1 - f.le ) * sign ( f.pr - f.pl ) le = f.le ri = d.le - 1 hl = f.hl dh = f.dh }
fm2 = { pl = d.pl pr = d.pl + ( lr - d.le ) * sign ( d.pr - d.pl ) le = d.le ri = lr hl = d.hl dh = d.dh }
fm3 = { pl = f.pl + ( lr + 1 - f.le ) * sign ( f.pr - f.pl ) pr = f.pr le = lr + 1 ri = f.ri hl = f.hl + ( lr + 1 - f.le ) * f.dh dh = f.dh }
Fmk = m(f, d) = Fm3 = { fm1, fm2, fm3 }
4. 2. 6 Calculation instruction for Case-Id 6
fm1 = { pl = f.pl pr = f.pl + ( lr - f.le ) * sign ( f.pr - f.pl ) le = f.le ri = lr hl = f.hl dh = f.dh }
fm2 = { pl = d.pl + ( lr +1 - d.le ) * sign ( d.pr - d.pl ) pr = d.pr le = lr + 1 ri = d.ri hl = d.hl + ( lr +1 - d.le ) * d.dh dh = d.dh }
fm3 = { pl = f.pl + ( d.ri + 1 - f.le ) * sign ( f.pr - f.pl ) pr = f.pr le = d.ri + 1 ri = f.ri hl = f.hl + ( d.ri + 1 - f.le ) * f.dh dh = f.dh }
Fmk = m(f, d) = Fm3 = { fm1, fm2, fm3 }
dl = ( f.hl + ( d.le - f.le ) * f.dh ) - d.hl )If ( dl>0 and dr<0 ) or ( dl<0 and dr >0 ) Calculation of the integer variables lr with
dr = ( f.hl + ( f.ri - f.le ) * f.dh ) - ( d.hl + ( f.ri -d.le ) * d.dh )
lr < ( dl * f.ri - dr * d.le ) / (dl - dr ) < lr + 1 orSub-Case 6.1: dl-1<0 and dr-1<0
lr = ( dl * f.ri - dr * d.le ) / (dl - dr )
Fmk = m(f, d) = Fm1 = { fm1 } = { f }Sub-Case 6.2: dl+1>0 and dr+1>0
Sub-Case 6.3: dl>0 and dr<0
fm1 = { pl = f.pl pr = f.pl + ( d.le - 1 - f.le ) * sign ( f.pr - f.pl ) le = f.le ri = d.le - 1 hl = f.hl dh = f.dh }
fm2 = { pl = d.pl pr = d.pl + ( f.ri - d.le ) * sign (d.pr - d.pl ) le = d.le ri = f.ri hl = d.hl dh = d.dh }
Fmk = m(f, d) = Fm2 = { fm1, fm2 }
Sub-Case 6.4: dl<0 and dr>0
fm1 = { pl = f.pl pr = f.pl + ( d.le - 1 - f.le ) * sign ( f.pr - f.pl ) le = f.le ri = d.le - 1 hl = f.hl dh = f.dh }
fm2 = { pl = d.pl pr = d.pl + ( lr - d.le ) * sign ( d.pr - d.pl ) le = d.le ri = lr hl = d.hl dh = d.dh }
fm3 = { pl = f.pl + ( lr + 1 - f.le ) * sign ( f.pr - f.pl ) pr = f.pr le = lr + 1 ri = f.ri hl = f.hl + ( lr + 1 - f.le ) * f.dh dh = f.dh }
Fmk = m(f, d) = Fm3 = { fm1, fm2 , fm3 }
fm1 = { pl = f.pl pr = f.pl + ( lr - f.le ) * sign ( f.pr - f.pl ) le = f.le ri = lr hl = f.hl dh = f.dh }
fm2 = { pl = d.pl + ( lr + 1 - d.le ) * sign ( d.pr - d.pl ) pr = d.pl + ( f.ri - d.le ) * sign ( d.pr - d.pl ) le = lr + 1 ri = f.ri hl = d.hl + ( lr + 1 - d.le ) * d.dh dh = d.dh }
Fmk = m(f, d) = Fm2 = { fm1, fm2 }
Case else:
fl1 = { pl = d.pl pr = d.pl + ( f.le -1 - d.le ) * sign ( d.pr - d.pl ) le = d.le ri = f.le - 1 hl = d.hl dh = d.dh }
Flk = l(f, d) = { fl1, m(f, d) }
Flk = l(f, d) = m(f, d)
Case else:
frk = { pl = d.pl + ( f.ri + 1 - d.le ) * sign ( d.pr - d.pl ) pr = d.pr le = f.ri+1 ri = d.ri hl = d.hl + ( f.ri + 1 - d.le ) * d.dh dh = d.dh }
Frk = r(f, d) = { m(f, d), frk }
Frk = r(f, d) = m(f, d)
There are 9 combinations, that can be distinguished by identity numbers (Case-Id’s). Cases with f.le>f.ri or Inf>Sup are impossible.
( 1, * ): Inf < f.le+1 ( 2, * ): f.le < Inf < f.ri+1 ( 3, * ): f.ri < Inf ( *, 1 ): Sup < f.le ( *, 2 ): f.le-1 < Sup < f.ri ( *, 3 ): f.ri-1 < Sup
4. 5. 2 Calculation instruction for Case-Id 2
Case Case-Id Type of result ( 1, 1 ): 1 (= 1*1) Fbk = Fb0 = {} ( 2, 1 ): 0 not possible ( 3, 1 ): 0 not possible ( 1, 2 ): 2 (= 1*2) Fbk = Fb1 ( 2, 2 ): 4 (= 2*2) Fbk = Fb1 ( 3, 2 ): 0 not possible ( 1, 3 ): 3 (= 1*3) Fbk = Fb1 = { fb1 } = { f } ( 2, 3 ): 6 (= 2*3) Fbk = Fb1 ( 3, 3 ): 9 (= 3*3) Fbk = Fb0 = {}
4. 5. 3 Calculation instruction for Case-Id 4
fb1 = { pl = f.pl pr = f.pl + ( Sup - f.le ) * sign ( f.pr - f.pl ) le = f.le ri = Sup hl = f.hl dh = f.dh }
Fbk = b(f, Inf, Sup) = Fb1 = { fb1}
4. 5. 4 Calculation instruction for Case-Id 6
fb1 = { pl = f.pl + ( Inf - f.le ) * sign ( f.pr - f.pl ) pr = f.pl + ( Sup - f.le ) * sign ( f.pr - f.pl ) le = Inf ri = Sup hl = f.hl + ( Inf - f.le ) * f.dh dh = f.dh }
Fbk = b(f, Inf, Sup) = Fb1 = { fb1}
fb1 = { pl = f.pl + ( Inf - f.le ) * sign ( f.pr - f.pl ) pr = f.pr le = Inf ri = f.ri hl = f.hl + ( Inf - f.le ) * f.dh dh = f.dh }
Fbk = b(f, Inf, Sup) = Fb1 = { fb1}
Sub-Case1.1: ( | f1.hl + ( f2.le - f1.le ) * f1.dh = f2.hl and |
f1.hl + ( f2.ri - f1.le ) * f1.dh = f2.hl + ( f2.ri - f2.le ) * f2.dh and | |
f1.pl + ( f2.le - f1.le ) * sign ( f1.pr - f1.pl ) = f2.pl and | |
f1.pl + ( f2.ri - f1.le ) * sign ( f1.pr - f1.pl ) = f2.pr) |
fv1 = { pl = f1.pl pr = f2.pr le = f1.le ri = f2.ri hl = f1.hl dh = f1.dh }
Fvk = v (f1, f2) = Fv1 = { fv1 }
Sub-Case1.2: ( | f2.hl - ( f2.le - f1.le ) * f2.dh = f1.hl and |
f2.hl - ( f2.le - f1.ri ) * f2.dh = f1.hl + ( f1.ri - f1.le ) * f1.dh and | |
f2.pl - ( f2.le - f1.le ) * sign ( f2.pr - f2.pl ) = f1.pl and | |
f2.pl - ( f2.le - f1.ri ) * sign ( f2.pr - f2.pl ) = f1.pr) |
Sub-Case 1.else and Case else:
fv1 = { pl = f1.pl pr = f2.pr le = f1.le ri = f2.ri hl = f1.hl dh = f2.dh }
Fvk = v (f1, f2) = Fv1 = { fv1 }
Fvk = v (f1, f2) = Fv2 = { fv1, fv2 } = { f1, f2 }
There are 9 combinations, that can be distinguished by identity numbers (Case-Id’s). Cases with f.le>f.ri or g.le>g.ri are impossible.
( 1, * ): g.le < f.le+1 ( 2, * ): f.le < g.le < f.ri+1 ( 3, * ): f.ri < g.le ( *, 1 ): g.ri < f.le ( *, 2 ): f.le-1 < g.ri < f.ri ( *, 3 ): f.ri-1 < g.ri
4. 5. 2 Calculation instruction for Case-Id 1 and Case-Id 9
Case Case-Id Type of result ( 1, 1 ): 1 (= 1*1) Fhk = Fh1 = { fh1 } = { f } ( 2, 1 ): 0 not possible ( 3, 1 ): 0 not possible ( 1, 2 ): 2 (= 1*2) Fhk = Fh2 ( 2, 2 ): 4 (= 2*2) Fhk = Fb3 ( 3, 2 ): 0 not possible ( 1, 3 ): 3 (= 1*3) Fhk = Fh1 = { fh1 } ( 2, 3 ): 6 (= 2*3) Fhk = Fh2 ( 3, 3 ): 9 (= 3*3) Fbk = Fb1 = { fh1 } = { f }
Fhk = h(f, g) = Fh1 = { fh1} = { f }4. 5. 3 Calculation instruction for Case-Id 2
4. 5. 4 Calculation instruction for Case-Id 3
fh1 = { pl = f.pl pr = f.pl + ( g.ri - f.le ) * sign ( f.pr - f.pl ) le = f.le ri = g.ri hl = f.hl + g.hl + ( f.le - g.le ) * g.dh dh = f.dh + g.dh}
fh2 = { pl = f.pl + ( g.ri +1 - f.le ) * sign ( f.pr - f.pl ) pr = f.pr le = g.ri+1 ri = f.ri hl = f.hl + ( g.ri +1 - f.le ) * f.dh dh = f.dh }
Fhk = h(f, g) = Fh2 = { fh1, fh2}
4. 5. 5 Calculation instruction for Case-Id 4
fh1 = { pl = f.pl pr = f.pr le = f.le ri = f.ri hl = f.hl + g.hl + ( f.le-g.le ) * g.dh dh = f.dh + g.dh }
Fhk = h(f, g) = Fh1 = { fh1}
4. 5. 6 Calculation instruction for Case-Id 6
fh1 = { pl = f.pl pr = f.pl + ( g.le - 1 - f.le ) * sign ( f.pr - f.pl ) le = f.le ri = g.le - 1 hl = f.hl dh = f.dh }
fh2 = { pl = f.pl + ( g.le - f.le ) * sign ( f.pr - f.pl ) pr = f.pl + ( g.ri - f.le ) * sign ( f.pr - f.pl ) le = g.le ri = g.ri hl = f.hl + ( g.le - f.le ) * f.dh + g.hl dh = f.dh + g.dh }
fh3 = { pl = f.pl + ( g.ri +1 - f.le ) * sign ( f.pr - f.pl ) pr = f.pr le = g.ri+1 ri = f.ri hl = f.hl + ( g.ri +1 - f.le ) * f.dh dh = f.dh }
Fhk = h(f, g) = Fh3 = { fh1, fh2, fh3}
fh1 = { pl = f.pl pr = f.pl + ( g.le - 1 - f.le ) * sign ( f.pr - f.pl ) le = f.le ri = g.le - 1 hl = f.hl dh = f.dh }
fh2 = { pl = f.pl + ( g.le - f.le ) * sign ( f.pr - f.pl ) pr = f.pr le = g.le ri = f.ri hl = f.hl + ( g.le - f.le ) * f.dh + g.hl dh = f.dh + g.dh }
Fhk = h(f, g) = Fh2 = { fh1, fh2}
Set | yIInf = Max { yImin; yI } |
For i = I-1 down to 1 calculate | yiInf = Max { yi+1Inf + di+1 - xi+1max ; yimin } |
Set | y0Inf = Max { y1Inf + d1 - x1max ; y0 } |
For i = 1 up to I calculate | yiInf = Max { yi-1Inf + ximin - di ; yiInf } |
Set | y0Sup = y0 |
For i = 1 up to I calculate | yiSup = Min { yi-1Sup + ximax - di ; yimax } |
Set | yISup = Min { yISup; yI } |
For i = I-1 down to 0 calculate | yiSup = Min { yi+1Sup + di+1 - xi+1min; yiSup } |
Set | IsFeasibleSolution = true |
For i = 0 up to I do | If ( yiInf > yiSup ) then IsFeasibleSolution = false |
5. 2. 3 Calculation of the optimum total cost functions
f01 = { pl = y0 pr = y0 le = y0 ri = y0 hl = 0 dh = 0 }
if (model=opt or model=opT) then calculate field d withSub-Step 2: Calculate the field-set Fin(i)
d = { pl = sign(ximin) pr = 0 le = -di + ximin ri = Min { ximax - di ; yiSup - yi-1Inf } hl = si1 + ximin * ci1 dh = ci1 }
if (model=oPt or model=oPT) then calculate field-set DJ(i) = {d1, ..., dJ(i)}with
dj = { pl = sign(xij-1+1) pr = 0 le = -di + xij-1+1 ri = xij - di hl = sij + (xij-1 +1) * cij dh = cij }
if (model=opt or model=oPt) then calculate field g with
g = { pl = 0 pr = 0 le = yimin ri = yimax hl = ti1 + yimin * hi1 dh = hi1 }
if (model=opT or model=oPT) then calculate field-set GK(i) = {g1, ..., gK(i)} with
gk = { pl = 0 pr = 0 le = yik-1+1 ri = yik hl = tik + (yik-1+1)* hik dh = hik }
if model=opt: Fin(i) = opt ( Fi-1n(i-1), d, g )5. 2. 4 Calculation of the optimum production and inventory quantities
if model=oPt: Fin(i) = oPt ( Fi-1n(i-1), DJ(i), g )
if model=opT: Fin(i) = opT ( Fi-1n(i-1), d, GK(i) )
if model=oPT: Fin(i) = oPT ( Fi-1n(i-1), DJ(i), GK(i) )
Find fi* in Fin(i) = {fi1, ..., fi*, ..., fin(i)}, so thatSub-Step 2:
fi*.le-1 < yi < fi*.ri+1
Calculate yi-1 = fi*.pl + ( yi - fi*.le ) * sign ( fi*.pr - fi*.pl )Calculate the optimum production quantities and start-ups in the following way:
xi = di + yi - yi-1
ui = sign( xi )
Initialize the set F01 = {f01} with
e01 = { pl = y0 pr = y0 le = y0 ri = y0 hl = 0 dh = 0 }
5. 3. 3 Calculation of the optimum total cost functions
f01 = { pl = y0 pr = y0 le = y0 ri = y0 hl = ( 1 - u0 ) * a1 dh = 0 }
Set the integer c = aiSub-Step 1:
if (model=Opt or model=OpT) then calculate field d withSub-Step 2: Calculate the field-sets Eim(i) and Fin(i)
d = { pl = sign(ximin) pr = 0 le = -di + ximin ri = Min { ximax - di ; yiSup - yi-1Inf } hl = si1 + ximin * ci1 dh = ci1 }
if (model=OPt or model=OPT) then calculate field-set DJ(i) = {d1, ..., dJ(i)}with
dj = { pl = sign(xij-1+1) pr = 0 le = -di + xij-1+1 ri = xij - di hl = sij + (xij-1 +1) * cij dh = cij }
if (model=Opt or model=OPt) then calculate field g with
g = { pl = 0 pr = 0 le = yimin ri = yimax hl = ti1 + yimin * hi1 dh = hi1 }
if (model=OpT or model=OPT) then calculate field-set GK(i) = {g1, ..., gK(i)}with
gk = { pl = 0 pr = 0 le = yik-1+1 ri = yik hl = tik + (yik-1+1)* hik dh = hik }
5. 3. 4 Calculation of the optimum production and inventory quantities
if model=Opt: Eim(i) = OptE (Ei-1m(i-1), Fi-1n(i-1), d, g ) Fin(i) = OptF (Ei-1m(i-1), Fi-1n(i-1), c, d, g ) if model=OPt: Eim(i) = OPtE (Ei-1m(i-1), Fi-1n(i-1), DJ(i), g ) Fin(i) = OPtF (Ei-1m(i-1), Fi-1n(i-1), c, DJ(i), g ) if model=OpT: Eim(i) = OpTE (Ei-1m(i-1), Fi-1n(i-1), d, GK(i) ) Fin(i) = OpTF (Ei-1m(i-1), Fi-1n(i-1), c, d, GK(i) ) if model=OPT: Eim(i) = OPTE (Ei-1m(i-1), Fi-1n(i-1), DJ(i), GK(i) ) Fin(i) = OPTF (Ei-1m(i-1), Fi-1n(i-1), c, DJ(i), GK(i) )
Set a = 0For i = I down to 1 calculate:
Find fi* in Fin(i) = {fi1, ..., fi*, ..., fin(i)}, so thatCalculate the optimum production quantities in the following way:
fi*.le-1 < yi < fi*.ri+1
Try to find ei* in Eim(i) = {ei1, ..., ei*, ..., ein(i)}, so that
ei*.le-1 < yi < ei*.ri+1
Set c = 1
If there is an ei* then calculate
c = a + (ei*.hl + (yi - ei*.le) * ei*.dh) - (fi*.hl + (yi - fi*.le) * fi*.dh)
If c<0 then calculate
yi-1 = ei*.pl + ( yi - ei*.le ) * sign ( ei*.pr - ei*.pl )
ui = 0
Else calculate
yi-1 = fi*.pl + ( yi - fi*.le ) * sign ( fi*.pr - fi*.pl )
ui = 1
Set a = ai * ui
xi = di + yi - yi-1
Problem Size I | Time [sec] using sub-problems of | |
Size I | Size I_sub | |
73 | 0.05 | 0.12 |
146 | 0.10 | 0.38 |
219 | 0.15 | 0.83 |
|
|