AGGREGATE PLANNING FOR PROBABILISTIC DEMAND WITH INTERNAL AND EXTERNAL STORAGE

This paper presents three approaches to support decision-making for production planning, sales and inventory problems. They work in a situation with: non-stationary probabilistic demand; production capacity in regular hours and overtime; shortage leads to lost sales; limited internal storage space; and ordering costs resulting from machine preparation are negligible. In the first approach, we consider the problem as linear and deterministic. In the second, safety inventories are used to fill a probabilistic demand, but the possibility of stockout is not considered. The third approach estimates shortage resulting from demand uncertainty. The last two approaches use iterative processes to re-estimate unit holding cost, which is the basis to calculate safety inventories in each period of the horizon. Using Microsoft Excel Solver, with linear programming and nonlinear search functions, a hypothetical example (but strongly based on real-life companies) and some scenarios permit concluding that developing more realistic and complex models may not provide significant benefits.


NTRODUCTION
Aggregate Production Planning, or Sales and Operations Planning, represents an intermediary level of planning in companies, between strategic, in which the company defines its production structure for future years, and operational, which defines the processing sequence of production orders based on the resources available.Buffa and Sarin (1987) present the main concepts about this subject.
In aggregate planning, companies should define how to use their resources to reach their operational goals (maximize operational profit, usually).Overtime work may be considered, as well as having additional shifts, outsourcing part of production, not meeting part of demand, or building inventories in periods of low demand to use them in higher demand periods.The texts analyzed present two approaches for the sizing of safety inventories in each period in the planning horizon, necessary in situations of demand uncertainty.The first approach results from the arbitrary definition of a proportion of replenishment cycles without shortage (for example, 95%) or a demand proportion to be met without shortage, which leads to the identification of a safety coefficient to meet demand (usually, based on normal distribution).The second approach considers product holding and shortage costs to establish this safety coefficient.This approach is more adequate when the intention is to minimize total operation costs.This paper addresses a problem not addressed elsewhere in the literature: due to storage constraints in the company's own facilities (refrigerated environment, for example), unit holding costs depend on making seasonal and safety inventories for periods of high demand, which would require an iterative planning process, as the safety inventory is defined by the relationship between holding costs and shortage costs.This proposed iterative planning process will be compared to others, simpler, to assess the benefit of a more complex process.One should always bear in mind that people will be carrying out processes in companies and, if these people find the process too complicated for an uncertain return, this process will be left aside.A relevant number of companies have similar problems in aggregate planning, and comparing aggregate planning models may be quite useful for them, as it will guide their decisions of which model the company should use.
The rest of the text is organized in the following way: after presenting method and literature review, I de-scribe the aggregate planning problem to be solved by the models presented next.The first formulation corresponds to the deterministic linear model for nonstationary demand with internal storage constraints and the option to use overtime.The second formulation corresponds to the linear model proposed for the probabilistic demand problem, while third formulation is used to solve the nonlinear model with probabilistic demand and shortage, thus allowing for the comparison among models and guidelines for their use in companies, made next.Finally I present the conclusions and limitations of the study.

METHOD
The analysis of the related literature mentioned in the references of books about operations and papers found after search in databases (Science Direct, Scopus and Web of Science, among others) provided the approaches that could be useful to deal with the problem addressed herein.This is not a case study.A fictitious company was created to permit the comparison between the mathematical modelling approaches to solve problems of aggregate planning with probabilistic demand and production and storage constraints.The initial information about the fictitious company, like the behavior of demand and unit costs involved in operations, were obtained from real-life companies, and combined to create a dataset representing a valid and realistic problem.
The mathematical models were populated into Microsoft Excel ®  spreadsheets and solved by the addin optimization software Solver, by Frontline Systems Inc.
The performance comparison of the test models was based on the total margin resulting from the operations of the fictitious company.The total margin is a result of the difference between the revenues from product sales and direct production costs (materials and energy), overtime costs, onsite storage costs and contracted offsite storage costs.Due to considering monetary values resulting from operational decisions (production, sales, shortage, and internal and external storage), the total margin would be a better performance indicator than reaching arbitrary goals for utilization of the installed capacity or fill rate.
Different scenarios were tested to validate conclusions.In each one of this six scenarios, costs or demand pattern were changed (one change each time) in relation to original values.An increase of 50% was made to unit holding cost due to internal storage, unit holding cost due to external storage and unit sale revenue.A decrease of 50% was made to original value of internal storage capacity; an increase of ten times was made to unit labor cost in overtime; a greater variation of demand along horizon, with same average, was applied in the last scenario.Buffa and Sarin (1987), Thomé, Scavarda, Fernandez, and Scavarda (2012) and Silver, Pyke, and Peterson (1998) present the most usual techniques to solve aggregate planning problems.The simplest ones contemplate simplified models of companies, only considering the main resources, usually implemented through electronic spreadsheets and simulation, whose equations permit evaluating the feasibility of a suggested plan, without result optimization.Tenhiälä (2011) suggests that companies underuse more sophisticated models that use linear programming and mixed linear programming techniques (the later considers binary variables used to represent resource consumption-and associated costs-when equipment is prepared in an intermittent production environment).Hierarchical models may also be used, with optimization in each detailing level of production and sales plans.Günther (1982) used simulation to compare the performance of linear programming models and linear decision rules in situations of demand uncertainty, indicating that the more uncertain the demand, the latter produces better results than the former; however, he does not develop a specific model to deal with the issue of uncertainty.Li, Wang, Yang, Guom, Qi (2013) present a technique (belief-rule-based inference) for conditions of demand uncertainty, in which plans are evaluated in scenarios with different probabilities.

LITERATURE REVIEW
Literature search revealed a set of papers (Wang & Liang, 2005;Hsieh & Wu, 2000) about aggregate production planning in situations of uncertain cost coefficients, demand and production capabilities suggesting their resolution by "possibilistic" linear programming, where uncertainties are defined by triangular distributions (minimal, most likely and maximum values).Their concern is different from this paper's, because those authors do not try to calculate safety inventories, but rather to define deterministic decisions that are appropriate to a scenario of uncertainties.A similar approach is observed in "robust optimization models" or stochastic linear programming, in which scenarios with different probabilities of occurrence are built based on possible values of initial parameters (RahmanI, Ramezanian, Fattahi, & Heydari, 2013;Sen & Higle, 1999).Mula, Poler, García-Sabater, and Lario (2006) conducted an extensive survey of production planning models under uncertainty, but the part about aggregate planning does not provide relevant contributions for this article as they only mention studies using fuzzy logic.
Working with heuristics, Ketzenberg, Metters, and Semple (2006) analyze the problem of aggregate planning with several products, non-stationary probabilistic demand, and common capacity restraints.Marginal analysis heuristics, which allocates production capacity both in limited capacity periods and in advanced production, according to each product's economic return, provided better results than others tested (balanced (fair share), proportional and fixed allocation).The results of the winning heuristic were compared with optimal results, obtained with the use of dynamic programming.The study ignores preparation costs and calculates safety inventories based on storage costs and lost sales costs, like prosed by this work, but without considering the possibility of overtime and external storage.Pauls-Worm, Hendrix, Alcoba, and Haijema (2016) analyze the situation of perishable products with probabilistic demand and limited demand proportion met (defined arbitrarily, and not based on the relationship between storage and shortage costs), comparing an optimizing approach (mixed integer nonlinear programming) with an approximate approach (mixed integer linear programming).They conclude that linear approximation is adequate when ordering costs make appropriate a replenishment cycle for the next product life period.
Martínez-Costa, Mas-Machuca, Benedito and Corominas (2014) say, based on an extensive review, that there are few studies addressing simultaneously strategic capacity management and production and inventory management, although they emphasize that capacity and inventory are substitutes: the more installed capacity, the smaller the needs of inventory.This separation occurs in a base company (one of the companies used to create the fictitious company of this study), in which strategic capacity planning (with a horizon of several years and annual detail of decisions) is done without analyzing the detailed consequences for long term production and inventory management.These are left for the production and sales planning process, with a horizon close to one year and monthly detail.In the first problem, the base company adopts a solution based on demand tracking strategy, in which the company's regular capacity should meet average demand.As suggested by Olhager and Johansson (2012), differently from the anticipation strategy, in which there is always installed capacity to meet demand increases (with major idleness), and demand-following strategy, in which capacity is only installed after demand occurs (with potential demand losses), the tracking strategy leads to situations in which inventories are formed to cover periods of high demand.In the case of our base company (and the fictitious one), there is still the possibility of overtime work (on weekends).Bookbinder and Tan (1988) present basic cases, both deterministic and probabilistic, of production planning with non-stationary demand, assuming unlimited capacity of production and storage, and ignoring shortage costs.In the deterministic case, there would be no reason for them to exist, as there is unlimited capacity.In the situation of demand uncertainty, however, they simplify reality because they would consider that the minimal service level required by the company would take shortage as little significant.Service level would be measured by the proportion of replenishment cycles without stockout (also called as cycle service level), and values usually adopted would be equal or greater than 90%.The basic issue of Bookbinder and Tan's study would be to define how to calculate production lots to balance ordering and storage costs.
Having the same objective in mind, i.e., minimizing total costs that include ordering and storage, the most common solving techniques are Complete Enumeration, Wagner-Whitin Algorithm, Silver-Meal Algorithm, Mixed Simulation, and Linear Programming.Assuming quadratic costs in some cases, another solving technique is Linear Decision Rule, obtained from the HMMS model (Holt, Modigliani, Mutt and Simon), as Buffa and Sarin (1987), Tarim and Kingsman (2004), and others indicate.
Mixed linear programming was Bookbinder and Tan's option, as well as Tarim andKingsman's (2004 and2006).Choudhary and Shankar (2015) used Tarim and Kingsman's 2004 formulation to analyze the benefit of using VMI (Vendor-Managed Inventory) in relation to the "simple" information sharing between companies.In their 2006 paper, Tarim and Kingsman incorporate shortage cost in the analysis, and calculate shortage as the function of an item demand probability distribution for the time interval the purchased lot would last.To use linear programming, Tarim and Kingsman (2006) suggest piecewise linearization for the cost curve as a function of stocked and late quantities.They also calculate maximum errors in relation to the values that would be obtained from the nonlinear curve (more realistic), and these errors depend on the number of segments adopted.In the studies identified in this paragraph, capacity constraints of production and internal storage are not considered.

DESCRIPTION OF THE PARTICULAR PROBLEM OF PRODUCTION, INVENTORY AND SALES PLANNING
As mentioned before, the fictitious company herein presents an installed capacity that permits meeting total annual demand using overtime and/or early building of inventories for higher demand periods with production in lower demand periods.Figure 1 presents the situation described.The company's items are sufficiently similar, in terms of raw materials and production process, for us to safely assume that they would all be part of a single family.However, the formulas of the mathematical models designed consider that average unit processing time for the item family and production capacities are expressed in hours (not in product units).In this manner, it would be relatively simple to incorporate more general situations, with several products competing for the same production capacities.A similar transformation could be made to consider storage constraints for the several products; in this case, product units by product space.
Widely worked in many of the papers mentioned above, the issue of deciding if an item will be manufactured or not in each period of the planning horizon is not relevant for this situation, because it would be necessary to prepare machines even if the same item continued to be manufactured.The justification for the almost daily preparation of production lines is the fact that the items of this paper's base company are foods: regular cleaning of machines is fundamental for product quality.In this manner, the company planning problem is not to decide when to produce each item (because all of them may be produced in any month, without additional setup costs), but to decide if it is better to produce with overtime in higher demand months or to use seasonal inventories for that purpose, in addition to defining safety inventories for each period in the horizon.
There is limited production capacity both for regular work hours (for which there are not additional labor costs, because this labor in regular hours is already included in the company's fixed payroll) and for overtime production (that could be on weekends, and would lead to additional costs).There is also limited internal product storage capacity (in refrigerated environment).If necessary, the company may hire outsourced space, more expensive than the company's own space.If there is stockout, this will lead to lost sales.
The problem is probabilistic in nature because of demand uncertainty.The behavior of costs as a function of decision variables (particularly, in the case of product inventories and shortage) is nonlinear.The fact that unit holding cost depends on how much external storage is used increases even more the complexity of the situation.However, simpler approaches may be tested to solve this problem, as suggested, in a different situation, by Beale, Forrest, andTaylor (1980, apud Feiring &Sastri, 1990).The deterministic linear model, which allows solving by linear programming and regards safety inventories unnecessary, was the first tested in this study.Next, the probabilistic linear model with iterations is presented; it calculates safety inventories as a function of the relationship between holding and shortage costs (as suggested by Tarim & Kingsman, 2006) and uses an iterative process to refine the final result.This iterative process is necessary because unit holding cost, initially used to calculate the safety inventory, change after calculating production, inventory and sales decisions, because external storage is more expensive than internal storage.Last, the probabilistic nonlinear model with iterations is presented; unlike the previous one, it calculates expected shortages as a function of demand uncertainty.The last model is the most faithful to reality, but the order of presentation chosen, from the simplest to the most complex model, should facilitate understanding the increasing difficulty to operationalize the models.The economic margin function, criterion for comparing results, fails to present a linear behavior, requiring optimization by search algorithms, in addition to the use of an iterative process.
At the end, we analyze if the calculation of expected shortage and the use of an iterative process to refine unit holding cost, methods that are more timeconsuming and laborious, are offset by significantly better results, or if, to the contrary, simpler planning methods may be used without relevant losses in company performance.

DETERMINISTIC LINEAR MODEL
In the deterministic situation, in which demand is known without uncertainties, there would not be stockout, as the company's policy is to seek to always meet customer needs.
The decision variables are: V t sale (quantity to be sold) in period t (independent) P t production (quantity to be produced) in period t (independent) EF t inventory (quantity to be stored) at the end of period t (dependent) EFI t internal inventory at the end of period t (dependent) EFE t external inventory at the end of period t (independent) HN t regular hours used in period t (dependent) HXt overtime used in period t (independent) The initial parameters necessary (and their values) are: The formulation of the deterministic linear model would be: Objective function: maximize margin, margin = revenue minus variable costs of production, holding and overtime work Table 1 presents the example based on the hypothetical company.A horizon of only seven months was used to limit the size of problem and permit its resolution by the MS Excel add-in Solver.Shortage cost is not being considered because in a deterministic situation is not necessary to have shortage, as there is always capacity to meet demand with production in periods of lower demand.Pt, EFEt and HXt are the independent variables.One may note that part of the demand of months 4 to 6 is filled with early production of month 3, and with overtime production of months 3 to 6.The internal storage limit is reached in months 3 and 4, which required contracting external space.Inventory at the beginning of the planning horizon, of 1204 t, was used to fill part of the demand of the first period.

PROBABILISTIC LINEAR MODEL WITH ITERATIONS
In a more realistic situation, in which demand is considered uncertain, the company should have safety inventories.Bookbinder and Tan (1988), Feiring and Sastri (1990) and Tarim and Kingsman (2004) use the proportion of replenishment cycles without stockout (cycle service level) as a parameter to establish this safety inventory.This work uses Tarim and Kingsman's (2006) logic, which considers unit shortage and holding costs for this purpose.The relationship f/(f+e), with both costs having end of the month basis, permits calculating the best cumulative probability of fully meet demand in the month.Through the inverse function of cumulative probability in the standard normal distribution, one may find the safety coefficient to fill demand (z).Multiplying z by the standard deviation of demand in the month (dp), we may find the safety inventory (ES) and, lastly, the minimal initial inventory wanted for the month (EImin), which is equal to average demand plus the safety inventory for the month.These calculations are made for each month in the planning horizon, which require using the "t" index for the parameters.
In the cases of unit holding cost and safety coefficient z, values will have to be estimated again in future iterations, as upon the need to use external storage space, the unit holding cost will increase.This higher holding cost will suggest a smaller safety coefficient, thus indicating the need of an also smaller safety inventory.The unit holding cost in the second iteration is calculated as a weighted average, resulting from quantities stored onsite and offsite in the previous iteration.
It is important to highlight that, although demand was considered uncertain in the calculation of the safety inventory, such uncertainty is not considered to calculate possible stockouts.In this linear version of the probabilistic problem, demands would still be fully filled.The following section, which presents a more complete model, considers the possibility of stockout.
In addition to the parameters presented in the initial model, the following are necessary: The formulation of the probabilistic linear model would be: Objective function: maximize margin, margin = revenue minus variable costs of production, holding and overtime work In this case, the additional shortage cost was estimated to be 600$/t.As the unit sale price is 3000$/t and the direct production cost excluding labor is 500$/t, unit shortage cost was estimated at 3100$/t.Normal demand distribution is assumed, independent along time.
Table 2 presents the results for the problem considering safety inventory constraints.One may note that production decisions are the same as those of the deterministic linear model, except for the first period, because the inventory available at the beginning of the horizon corresponds to the safety inventory.The margin is smaller because of the safety inventories required, 1204 t each month.
In this case, as the safety coefficient is defined by the relationship f/(f+e t ), an iterative calculation process may be used, as the unit holding cost, resulting from weighting internal and external holding costs, becomes bigger than the value initially considered.
In a problem of limited internal storage capacity, in which safety inventory was calculated as the function of an imposed cycle service level, similar to Bookbinder and Tan (1988) and Tarim and Kingsman (2004), such iterative process would not be necessary, because the coefficient would be the same, even if the unit holding cost have changed.
In the example analyzed, the unit holding cost of period 3 would increase to 584.9$/t/month, result of the weighing (2000×400 + 1719.8×800)/(2000+ 1719.8).A similar re-evaluation occurs for period 4. Table 3 presents the results of the second iteration of the probabilistic linear model.One may note that, in the example given, the cost increase is insignificant, thus suggesting that the iterative process only would be necessary if the quantities stored offsite were a lot greater than quantities stored onsite and/or if the costs of offsite storage were a lot greater than those of onsite storage.Even in these situations, the iterative process is unlikely to be necessary, because, although the safety inventory and minimal initial inventory may be smaller, the initial inventory of the period in which this reduction occurs results in a value higher than the minimal because of the required anticipation of production.

PROBABILISTIC NONLINEAR MODEL WITH ITERATIONS
In the previous models, shortage was considered null, which would be reasonable in the hypothesis of deterministic demand (first model), but a simplification in situations of probabilistic demand.This section complements the previous model, considering the possibility of shortage.The expected shortage for each period in the horizon is calculated after the reevaluation of safety coefficient z.In the periods of lower demand, the minimal initial inventory, calculated as the sum of average demand plus safety inventory -suggested by the safety coefficient resulting from the relationship f/(f+e)-,becomes the initial inventory for each period.However, in the periods immediately before higher demand, in which production occurs ahead of time, the initial inven-tory of the period results in a value greater than the minimum.With this, it is possible to calculate a final safety coefficient (zf t ): As demand was assumed to have a normal behavior, average loss (F t ) may be estimated for each period in the horizon based on normalized average loss, given by the loss integral of the standard normal distribution at point z, I(z): In Microsoft Excel®, the I(z) value may be obtained with the use of the functions available: I(z) = f(z) -z * (1 -F(z)), in which f(z) is the probability density function of the standard normal and F(z) is the cumulative probability function of the standard normal.
The function of this loss integral is not linear, a fact that would require adopting a search software or the piecewise linearization technique, which was chosen by Tarim and Kingsman (2006).This study uses the Microsoft Excel® add-in Solver, which also has the search function.As there would be the expected shortage, the expected sale would not be period's demand, but the difference between this and expected shortage: Such shortage would lead to a shortage cost that was not present in the previous models.Part of this shortage cost would result from the margin loss (unit revenue minus unit direct production cost excluding labor) and another share, of an additional penalty, whose unit value is f ad .
We should clarify that the results found for sales, shortage and inventories at the end of periods are average values resulting from the same decisions for many years of the company's operations.In a same period of the same year, there cannot be simultaneously shortage and inventory, because either one or the other would occur.
The formulation of the probabilistic nonlinear model would be: Objective function: maximize margin, margin = revenue minus variable costs of production, holding, shortage and overtime work Table 4 presents the results of the first iteration of the probabilistic nonlinear model.The second iteration of the probabilistic nonlinear model is presented in Table 5.As in the situation of the probabilistic linear model, the second iteration changed very little the results of the first one.As expected, the total margin on the horizon is smaller than in the previous models, because uncertainty does not only require a safety inventory, but also leads to stockout.Shortages are relatively modest (less than 1% of demand), which is expected because its cost is significantly greater than holding costs.In the periods preceding higher demand, building inventories reduces shortage, because inventories are bigger than the minimal inventory for the period.

EVALUATION OF PROBLEM-SOLVING APPROACHES
Table 6 presents the results arising from the decisions of the probabilistic linear model entered in the calculation of the probabilistic nonlinear model.One may note that, as the former does not consider shortage, decisions would lead to a slightly bigger inventory, and the same would occur with sales.The total margin, however, would be slightly smaller (0.2%).1200 $/t/month.Scenario 4 uses unit sale revenue of 4500 $/t.Scenario 5 uses internal storage capacity of 1000 t.Scenario 6 uses unit labor cost in overtime of 400 $/h.Scenario 7 uses forecasted demand for each period of 4900, 4200, 4900, 12650, 13800, 12650 and 8900 t/month, respectively.
Table 7 shows the small differences in the margins (less than 1%), even in the situation with half of original internal storage capacity (scenario 5).Fill rates are slightly greater when simplifications of more complete model are used.
In addition to the small benefit resulting from the use of the nonlinear model, we should also remem-ber that the iterative calculation process to refine the value of unit holding cost did not show to be necessary either.With this, the conclusion is that the use of a deterministic linear model adopting several minimal inventories for each period (equivalent to each period's safety inventories) may be enough for good decision-making.This model is equivalent to the probabilistic linear model without iterations.
With results very close to optimal, this model would clearly be simpler to execute than the other ones.

FINAL CONSIDERATIONS
After presenting the results of the three models, deterministic linear, probabilistic linear, and probabilistic nonlinear, one may note that, for the hypothetical company analyzed and related scenarios, the application of the most complex model would not provide significant benefits, although it is conceptually more appropriate.Similar results are expected in other situations, possibly except for those in which internal storage capacities are very small and/or unit costs of external storage are much higher than internal storage and as stockout may be intentional (and not only resulting from demand uncertainties), situations that were not analyzed in this study.
For situations with many products and longer planning horizon, the quantity of variables and constraints would increase proportionally.Moreover, considering the problem as nonlinear would require using the piecewise linearization technique (a simplification that requires more constraints for the mathematical model) or using nonlinear optimization software (based on search algorithms, without guarantee of identifying optimal global results and with longer processing times).
We should weigh, therefore, the complexity of the model and its processing time with the potential benefits of its use.With regard to the problem of meeting non-stationary demands with constraints of internal storage and production capacity in regular hours and overtime, the approaches herein provided quite similar answers.
A natural complementation of this study would be to compare the approaches analyzed in other situations, particularly those in which the ordering cost would not be negligible, with the company making several products whose manufacturing processes shared production and storage resources.It would also be interesting to use data from several real-life situations to validate the approach and the conclusions of this study.

Figure 1 -
Figure 1 -Demand for the product family, installed capacity, and production (developed by the author).

Table 6 . Results of entering the decisions of probabilistic linear model into the calculations of the probabilis- tic nonlinear model (developed by the author).
Table7presents comparison of margins, fill rates and relative margins (to the second iteration of non linear approach) among approaches for the basic scenario and six other different scenarios, as explained in Section 2. Scenario 2 uses unit holding cost due to internal storage of 600 $/t/month.Scenario 3 uses unit holding cost due to external storage of