Professional Documents
Culture Documents
Demand Forecasting and Material Requirement Planning Optimization Using Open Source Tools
Demand Forecasting and Material Requirement Planning Optimization Using Open Source Tools
Demand Forecasting and Material Requirement Planning Optimization Using Open Source Tools
1 Introduction
MRP-I) refers to a model that comes from a production plan and focuses over
get the optimal requirements for every Stock keeping unit involved in the bill of
manufacture (also called BOM), [29]. The MRP improvement years later is called
MRP II, but the letters MRP in MRP II stand for Manufacturing Resources
Planning to make it clear that resources are considered in addition to materials
as in mrp. The word “resource” is used to emphasize that any type of productive
capability can be considered, not just machines. This work uses only the MRP I
model, focus the effort in the forecast of demands and manage large sets of data
for every SKU in the company portfolio of products.
This section describes the basic concepts of Material requirement planning, De-
mand Driven Material requirement planning and Forecasting techniques needed
to solve the dynamic demand problem presented in the case study.
This item first describes every part in a production system and later focuses
on MRP implementation. A production plan describes in detail the quantity of
principal sku (final product to sell) and produced in subsets of sku, the exact
time of production and lot sizing. The production plan can be divided in mas-
ter production schedule (MPS), Material requirement planning (MRP) and the
detailed plan of jobs in the production floor. See Fig. 1.
The APICS dictionary defines MRP as: "A set of techniques that uses a bill
of material data, inventory data, and the master production schedule to calculate
requirements for materials" [4]. MRP requires three basic inputs. First the master
production schedule, second a bill of material (BOM) for each sku (part number)
what other sku are required as direct components, and third the actual level of
(a) BOM for a Simple Example. (b) The basic MRP record form: [13].
Fig. 2. Example of a bill of manufacture and basic records for feeding the MRP system.
inventory for every sku. See Fig. 2. According to [13] an MRP system serves
a central role in material planning and control. It translates the overall plans
for production into the detailed individual steps necessary to accomplish those
plans. It provides information for developing capacity plans, and it links to the
systems that actually get the production accomplished. [20]
Lot for lot MRP Optimization model The formulation for MRP is based
in the model proposed by [29] and follow the form:
P X
X T
minimize (T − t)Xi,t
x
i=1 t=1
subject to
t−LT (i) t P
X X X
Xi,τ + I(i, 0) ≥ D(i, τ ) + R(i, j)Xi,j
τ =1 τ =1 j=1
P Number of SKUs
T Number of time buckets (i.e., planing horizon)
LTi Lead time for each SKU i
Ri,j Number i necesarios para hacer un j
Di,t External demand for i over tperiod
Ii, 0 Initial inventory for every SKU i
LSi Minimum lot size for every SKU i
M A large number
Demand Forecasting and Material Requirement Planning Optimization 97
The planning horizon i calculated by [25] and the overall costs are as well
found to significantly increase with forecast error [1]
Time series analysis According to [13] the time series methods are called
common methods because they no longer require other information of past val-
ues. Time series is a term to refer to the collection of observations of economic
or physical phenomena drawn at discrete points in time. The idea is that past
information can be used to forecast future values of the series. In time series
analysis we try to isolate the patterns that arise most frequently, these include
the following:
– Trend: refers to the trend of a series of time that exhibits a stable pattern
of growth or decrease.
– Seasonality: A seasonality pattern are those that are repeated at fixed inter-
vals.
– Cycles: The variation of cycles is similar to seasonality, except that the du-
ration and the magnitude of the cycle varies. One associates cycles with
economic variations that are also present in seasonal fluctuations.
– Randomness: A random series is where you do not have a recognized pat-
tern of data. One can generate a random series of data that have a specific
structure . The data that seems to have apparently a randomness , actually
have a specific structure. Actually the random data fluctuate around a fixed
average.
The bright idea of introducing self-loops to produce paths where the gradient
can flow for long durations is a core contribution of the first long short-term
memory (LSTM) model [11]. In this case, we mean that even for an LSTM with
Demand Forecasting and Material Requirement Planning Optimization 99
fixed parameters, the time scale of integration can change based on the input
sequence, because of the time constants.
The LSTM has been found hugely successful in many applications, such as
unconstrained handwriting recognition [8], speech recognition [7, 9] handwriting
generation [6], machine translation (Sutskever et al., 2014), image captioning
[14, 28, 30], and parsing [27] .
The LSTM block diagram is illustrated in Fig. 3. The corresponding for-
ward propagation equations are given below, for a shallow recurrent network
architecture.
Cells are connected recurrently to each other, replacing the usual hidden
units of ordinary recurrent networks. An input feature is computed with a reg-
ular artificial neuron unit. Its value can be accumulated into the state if the
sigmoidal input gate allows it. The state unit has a linear self-loop whose weight
is controlled by the forget gate. The output of the cell can be shut off by the
output gate. All the gating units have a sigmoid nonlinearity, while the input
unit can have any squashing nonlinearity. The state unit can also be used as an
extra input to the gating units. The black square indicates a delay of a single
time step.
(t) f (t) f (t−1)
X X
fi = σ bfi + Ui,j xj + Wi,j hj , (1)
j j
(t) (t) (t−1) (t−1) (t) (t−1)
X X
si = fi si + gi σ bi + Ui,j xj + Wi,j hj , (2)
j j
(t) g (t) g (t−1)
X X
gi = σ bgi + Ui,j xj + Wi,j hj . (3)
j j
100 J. Romero-Gelvez et al.
(t) (t)
hi = tanh sti qi , (4)
(t) 0 (t) 0 (t−1)
X X
qi = σ b0i + Ui,j xj + Wi,j hj , (5)
j j
3 Solution method
Open source tools in optimization are increasing popularity over the last years
and can be observed in works like [24] for the optimization process in supply
chain management and [19] in machine learning applications. We describe our
approach for using open source tools in MRP with dynamic demand as follows.
4 Results
First, the historical demand data is plotted in order to isolate the data patterns.
Later we apply the SARIMA model by using the R language Fig. 5, also the
Fb-Prophet package and Lstmn using KERAS and Google Colab Fig. 6.
Table 1 shows the difference in forecasts generated and their associated errors
in the last row. The techniques with the lowest associated error are SARIMA
and LSTMN, so the predicted demand generated by them will be used, which
can be seen in Table 1.
As it can be seen in Table 2 the future demand for 9 months is the principal
input for the MRP formulation, and it will be represented on the subset Dj .
102 J. Romero-Gelvez et al.
(a) Historical demand data plot (b) Forecasting for 2019 (monthly).
In this item, we use the Julia programing language and the package JuMP for
mathematical optimization, the code for the problem it can be seen as follows.
using JuMP,Cbc,NamedArrays,DataFrames
filas=size(D,1)
col=size(D,2)
mrp=Model(solver=CbcSolver())
@variables mrp begin
x[1:filas,1:col]>=0
d[1:filas,1:col]>=0
end
T=col
@objective(mrp,Min,sum( x[i,j]*((T-j)) for i=1:filas, j=1:col))
for i=1:filas,t=1:col
@constraint(mrp, sum(x[i,s] for s=1:t-LT[i,1])+I[i,1]>=sum(D[i,s]
+sum(R[i,j]*x[j,s] for j=1:filas) for s=1:t))
end
@constraint(mrp,x-d.*LS.>=0)
@constraint(mrp,d-x/1000000000000000.>=0)
status=solve(mrp)
println(getobjectivevalue(mrp))
println(DataFrame(getvalue(x)))
println(DataFrame(getvalue(d)))
We use the Ri,j bill of manufacture that shows in the Table 3 as follows:
j1 j2 j3 j4 j5 . . . j34
i1 0 0 0 0 0 ... 0
i2 253.816 0 0 0 0 ... 0
i3 0.4 0 0 0 0 ... 0
i4 20 0 0 0 0 ... 0
i5 20 0 0 0 0 ... 0
i6 105.784 0 0 0 0 ... 0
i7 0.1 0 0 0 0 ... 0
104 J. Romero-Gelvez et al.
Table 4: Final results for every sku i and their needs over time in
kgs
t1 t2 t3 t4 t5 t6 t7 t8
sku1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
sku2 0.0 0.0 0.0 0.0 22422.7 24925.6 26537.2 27511.6
sku3 0.0 0.0 0.0 0.0 35.3 39.3 41.8 43.4
sku4 0.0 0.0 0.0 0.0 1766.8 1964.1 2091.1 2167.8
sku5 0.0 0.0 0.0 0.0 1766.8 1964.1 2091.1 2167.8
sku6 0.0 0.0 0.0 0.0 9345.2 10388.3 11060.0 11466.1
sku7 0.0 0.0 0.0 0.0 8.8 9.8 10.5 10.8
Demand Forecasting and Material Requirement Planning Optimization 105
Future investigation must be related to DDMRP demand driven MRP and ma-
chine learning techniques related to forecasting methods. The first affirmations
is related with methods for maintain a minimum and maximum intervals for in-
ventory management over every sku. The second affirmation is related to method
that helps us to obtain better and more accurates forecasts for future demand.
6 Conclusions
The use of Open source optimization and forecasting tools allows to solve opti-
mization and predictive problems efficiently.
The forecasting problem is the principal problem in an MRP based company
and can be solved at scale using open source tools.
106 J. Romero-Gelvez et al.
The biggest contribution of this work is to show how to solve a real problem
over forecasting and optimization using three programming languages in order
to reduce error and improve the time scheduling for every stock keeping unit.
The company uses this implementation in order to plan his manufacturing
process at a larger scale including every product of their portfolio.
References
1. Altendorfer, K., Felberbauer, T., Jodlbauer, H.: Effects of forecast errors on optimal
utilisation in aggregate production planning with stochastic customer demand.
International Journal of Production Research 54(12), 3718–3735 (2016)
2. Bousqaoui, H., Achchab, S., Tikito, K.: Machine learning applications in supply
chains: long short-term memory for demand forecasting. In: International Confer-
ence of Cloud Computing Technologies and Applications. pp. 301–317. Springer
(2017)
3. Box, G.E., Jenkins, G.M., Reinsel, G.C., Ljung, G.M.: Time series analysis: fore-
casting and control. John Wiley & Sons (2015)
4. Cox, J.F., Blackstone, J.H.: APICS dictionary. Amer Production & Inventory
(2002)
5. Disney, S.M., Farasyn, I., Lambrecht, M., Towill, D.R., Van de Velde, W.: Tam-
ing the bullwhip effect whilst watching customer service in a single supply chain
echelon. European Journal of Operational Research 173(1), 151–172 (2006)
6. Graves, A.: Generating sequences with recurrent neural networks. arXiv preprint
arXiv:1308.0850 (2013)
7. Graves, A., Jaitly, N.: Towards end-to-end speech recognition with recurrent neural
networks. In: International conference on machine learning. pp. 1764–1772 (2014)
8. Graves, A., Liwicki, M., Fernández, S., Bertolami, R., Bunke, H., Schmidhuber,
J.: A novel connectionist system for unconstrained handwriting recognition. IEEE
transactions on pattern analysis and machine intelligence 31(5), 855–868 (2008)
9. Graves, A., Mohamed, A.r., Hinton, G.: Speech recognition with deep recurrent
neural networks. In: 2013 IEEE international conference on acoustics, speech and
signal processing. pp. 6645–6649. IEEE (2013)
10. Harvey, A.C., Peters, S.: Estimation procedures for structural time series models.
Journal of Forecasting 9(2), 89–108 (1990)
11. Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural computation
9(8), 1735–1780 (1997)
12. Hopp, W.J., Spearman, M.L.: Factory physics. Waveland Press (2011)
13. Jacobs, F.R.: Manufacturing planning and control for supply chain management.
McGraw-Hill (2011)
14. Kiros, R., Salakhutdinov, R., Zemel, R.S.: Unifying visual-semantic embeddings
with multimodal neural language models. arXiv preprint arXiv:1411.2539 (2014)
15. Lee, T., Adam Jr, E.E.: Forecasting error evaluation in material requirements plan-
ning (mrp) production-inventory systems. Management Science 32(9), 1186–1205
(1986)
16. Lee, T., Shih, W.: Optimal forecast biasing in theoretical inventory models. THE
INTERNATIONAL JOURNAL OF PRODUCTION RESEARCH 27(5), 809–830
(1989)
17. Li, Q., Disney, S.M.: Revisiting rescheduling: Mrp nervousness and the bullwhip
effect. International Journal of Production Research 55(7), 1992–2012 (2017)
Demand Forecasting and Material Requirement Planning Optimization 107
18. Mabert, V.A.: The early road to material requirements planning. Journal of Op-
erations Management 25(2), 346–356 (2007)
19. Moreno, R.H., Garcia, O., et al.: Model of neural networks for fertilizer recom-
mendation and amendments in pasture crops. In: 2018 ICAI Workshops (ICAIW).
pp. 1–5. IEEE (2018)
20. Nahmias, S., Cheng, Y.: Production and operations analysis, vol. 6. McGraw-hill
New York (2005)
21. Orlicki, J.A.: Material requirements planning: the new way of life in production
and inventory management. McGraw-Hill (1975)
22. Priore, P., Ponte, B., Rosillo, R., de la Fuente, D.: Applying machine learning
to the dynamic selection of replenishment policies in fast-changing supply chain
environments. International Journal of Production Research pp. 1–15 (2018)
23. Ptak, C.A., Smith, C.: Demand Driven Material Requirements Planning
(DDMRP). Industrial Press, Incorporated (2016)
24. Romero-Gelvez, J.I., Gonzales-Cogua, W.C., Herrera-Cuartas, J.A.: Cvrptw model
for cargo collection with heterogeneous capacity-fleet. In: International Conference
on Applied Informatics. Springer (2019)
25. Sridharan, V., BERRY, W.L.: Master production scheduling make-to-stock prod-
ucts: a framework for analysis. The International Journal of Production Research
28(3), 541–558 (1990)
26. Taylor, S.J., Letham, B.: Forecasting at scale. The American Statistician 72(1),
37–45 (2018)
27. Vinyals, O., Kaiser, Ł., Koo, T., Petrov, S., Sutskever, I., Hinton, G.: Grammar
as a foreign language. In: Advances in neural information processing systems. pp.
2773–2781 (2015)
28. Vinyals, O., Toshev, A., Bengio, S., Erhan, D.: Show and tell: A neural image
caption generator. In: Proceedings of the IEEE conference on computer vision and
pattern recognition. pp. 3156–3164 (2015)
29. Voß, S., Woodruff, D.L.: Introduction to computational optimization models for
production planning in a supply chain, vol. 240. Springer Science & Business Media
(2006)
30. Xu, K., Ba, J., Kiros, R., Cho, K., Courville, A., Salakhutdinov, R., Zemel, R.,
Bengio, Y.: Show, attend and tell: Neural image caption generation with visual
attention. arXiv preprint arXiv:1502.03044 (2015)