Alternative Mathematical Models and Solution Approaches for Lot-Sizing and Scheduling Problems in the Brewery Industry : Analyzing Two Different Situations

This research proposes new approaches to deal with the production planning and scheduling problem in brewery facilities. Two real situations found in factories are addressed, which differ by considering (or not) the setup operations in tanks that provide liquid for bottling lines. Depending on the technology involved in the production process, the number of tank swaps is relevant (Case A) or it can be neglected (Case B). For both scenarios, new MIP (Mixed Integer Programming) formulations and heuristic solution methods based on these formulations are proposed. In order to evaluate the approach for Case A, we compare the results of a previous study with the results obtained in this paper. For the solution methods and the result analysis of Case B, we propose adaptations of Case A approaches yielding an alternative MIP formulation to represent it. Therefore, the main contributions of this article are twofold: (i) to propose alternative MIP models and solution methods for the problem in Case A, providing better results than previously reported, and (ii) to propose new MIP models and solution methods for Case B, analyzing and comparing the results and benefits for Case B considering the technology investment required.


Introduction
The underlying manufacturing process in the brewery industry can be basically divided into two main production stages.Stage I prepares liquids using most of the time fermentation and maturation tanks.The time spent on this step is estimated for several days and each tank is for the liquid assigned to it from the beginning to the end of the fermentation and maturation processes.The tank can be refueled only when it is empty.Stage II bottles the liquids in the filling lines, making products with different liquids and package sizes and types, resulting in the final items.This stage can only start after the liquid is ready in the tanks, in other words, when Stage I has been completed, making the liquid ready to be bottled.A tank can simultaneously supply several filling lines, when they are bottling final items containing the same liquid type.In contrast, a filling line can only receive ready liquid from only one tank at each time.
The main planning decisions in Stage I establish how much, when, and which liquid will be assigned to each tank in the course of the planning horizon in order to fulfill the demand required by Stage II, considering the limitations of the available resources and the required times to conclude the fermentation and maturation processes (i.e., lot-sizing problem).In Stage II, in addition to the problem of deciding when, which, and how many resources will be used for each item production during the planning horizon, it is also necessary to deal with the coupling of production scheduling in the problem.For each bottling line, the capacity available depends on both the lot sizes and the sequences of produced 2 Mathematical Problems in Engineering items.For example, when a single malt beer production lot has ended, the line needs to be prepared (cleaned and adjusted) in order to be able to start the production of a beer that contains corn grits in its composition.This preparation time is much less in the opposite way, that is, first the beer with corn grits and then the single malt.Concluding, Stage I and Stage II decisions are taken aiming to minimize the number of changeovers in the filling lines and also to minimize the inventory and backlog costs.
Integrated lot-sizing and scheduling (sequencing) are a widely studied area [1,2].The recent literature reviews by Almada-Lobo et al. [3] and Copil et al. [4] highlight an increasing interest in simultaneous lot-sizing and scheduling problems in many companies, resulting in researches motivated by industrial practical applications, such as glass container [5], animal nutrition [6], soft drink [7], wood floor [8], pulp and paper mill [9], food [10], automotive applications [11], supermarkets [12], and thin film transistor and liquid crystal display [13].In these studies different models are used to represent lot-sizing and scheduling problems with sequence-dependent setups.The two most widely used models are the general lot-sizing and scheduling problem (GLSP) [14] and the capacitated lot-sizing problem with sequence-dependent setup (CLSD) [15].These models are also known for their complexity and loose bounds; therefore they need to be reformulated, seeking stronger models and better bounds.Examples for the lot-sizing problem include the network flow-based model proposed by Eppen and Martin [16] and the Simple Plant Location (SPL) model [17].These reformulation efforts motivated the models presented in the following sections.
Despite the vast literature, lot-sizing and scheduling in brewery facilities are still relatively understudied.Related research was carried out by Guimarães et al. [18], who studied the problem of annual production in a beverage company (soft drinks and beers), considering a multiplant environment, the seasonality of demand, and other particularities of this company, for example, permitting final item transferences between plants.However, this paper does not explicitly consider the decisions involving Stage I. Guimarães et al. [18] proposed a VNS (Variable Neighborhood Search) algorithm to find feasible solutions for this production problem.
Another related study is presented in Baldo et al. [19], who propose a mathematical programming approach to solve the problem considering both stages simultaneously.This is the only study found in the literature that performs the integration of both stages to address this problem.Due to the difficulty of solving or even finding a feasible solution to the problem, two MIP-heuristics using relax-and-fix and fixand-optimize strategies are proposed.The solutions are able to provide feasible production plans aimed at minimizing inventory costs and backlogs of final items (commercialized beers), while minimizing the number of setup changeovers in the filling lines.Preparation in such bottling lines is dependent on the production item sequences and tank swaps that provide ready liquid for the filling lines.That is, before starting the bottling process, the lines need to be adjusted for a specific item, to fill the right quantity of liquid in the packaging, and it must be connected to a single tank which supplies the liquid during production of the respective final item.Thus, each change of item or tank on the filling line results in a setup operation consuming the available production capacity.
The present article proposes new approaches to deal with the lot-sizing and scheduling problems that occur in brewery facilities.The main integrated decisions in Stages I and II are considered and two different situations often found in brewing industry, according to the production process technology, are analyzed.These situations can be distinguished by the consideration (or not) of the operations responsible for swapping the tanks that feed the bottling lines when the production plan is being developed.In other words, at the end of the fermentation and maturation processes, the liquid is available in the tank to fill packages of final items, a process that occurs in the bottling lines.However, before starting a new production run, each line must be prepared, adjusted, and also connected to the respective tank that will supply it.Figures 1(a)-1(c) illustrate the possibilities encountered in a case study, regarding the preparation of a filler.Figure 1(d) presents a summary of the pictures (a-c), introducing the information about the number of setup changeovers (last row of the table) that occur in the consecutive periods illustrated by the pictures.To sum up, Case A usually occurs in less automated breweries, while, in Case B, the automation of the plant results in a fast setup of the tank and this spending of time does not need to be considered.
Figure 1(a) depicts the production in the first period, when a tank filled with ready liquid supplies the bottling line, producing a final item (glass bottle type).Figure 1(b) describes the continuous production of bottles in the second period, when the liquid tank illustrated in Figure 1(a) becomes empty and the line is switched to the tank that has the same liquid type available for supplying it.If this setup changeover is a time consuming operation (Case A), its explicit consideration is necessary for the preparation of realistic production plans.If the setup is close to immediate (Case B), as it happens in more automated filling lines, it can be disregarded (see Figure 1(d), Cases A and B, resp.). Figure 1(c) describes the third period, which illustrates a situation in which the production of bottles ends and the production of cans starts, in both Cases A and B. This changeover between final items generates a sequence-dependent preparation in the machine, regardless of the technology involved.
This article aims to contribute to the literature by proposing the following: (a) For Case A (with explicit setup changeover of tanks), it contributes the following: (i) an alternative mathematical formulation using SPL (Simple Plant Location) strategies [20], to represent both stages (I and II) (ii) two other models, obtained by the combination of the SPL model and the model presented in Baldo et al. [19].
(b) For Case B (disregarding the setup changeover when swapping tanks), it contributes the following: (i) model adjustments from Case A to Case B (ii) an alternative mathematical formulation for Stage II using strategies based on ATSP (Asymmetric Traveling Salesman Problem) [21].
(c) For both cases, a MIP-based heuristic that considers the lot-sizing and scheduling decisions in a sequential fashion is proposed.This MIP-heuristic method consists of two main steps: Several computational tests were run supported by an optimization solver and the analysis of the results shows that the new approaches proposed for Case A obtained better results than the ones previously reported in the literature [19].The computational tests also quantify the benefits of using more advanced technology available for brewery production processes, in order to reduce the setup changeover times (consequently costs) of the tanks that supply the filling lines, when considering Case B.
The remainder of this paper is organized as follows.Section 2 briefly describes the beer production process and presents a detailed description of the problem.Section 3 includes a short explanation regarding the model described in Baldo et al. [19].Section 4 describes the mathematical formulations proposed to represent Case A and Section 5 the mathematical models for Case B. Section 6 proposes the MIPheuristics to solve both scenarios.The computational results are shown in Section 7. The conclusions and future research perspectives are discussed in Section 8.

Problem Description
In the context of this study, the production process in a brewery is considered divided into two main stages and there are several tasks that comprise them.They are described below.
(i) Liquid Preparation (Stage I).This starts with the wort preparation (mashing and lautering).Mashing involves mixing the milled grain with water, which is then submitted to a heating process.During lautering, the mixture is filtered making it ready for boiling and adding the hops.The wort is cooled before adding the yeast, yielding green beer.All the previous processes take a few hours to complete.The wort and yeast cells are then placed into fermentation tanks to start the fermentation phase.At the end of the fermentation process, the yeast is separated by decanting, leading to the maturation phase.The fermentation and maturation processes occur inside the same tank and usually take several days to complete.Depending on the type and style of beer, these two phases can take from 3 to 41 days.The final step to create the ready liquid (beer) is filtration and carbonation.At this point, the beer is ready to be bottled.If the filling line is not available, the liquid can wait within its own fermentation and maturation tanks, or it can be filtered and kept at buffer tanks while waiting to be bottled.Nevertheless, after being filtered, the beer must be bottled within a few days.
(ii) Bottling (Stage II).This is the final stage of the production process, where the beer is bottled in containers (glass bottles, aluminum cans, or barrels) and packed.The filling process occurs on a conveyor belt, moving the containers between procedures: washing and sterilizing returnable containers (this can be suppressed for cans, because they are purchased and sterilized), followed by filling, sealing, labeling, and packing.The filling lines are initially adjusted to produce beer of a given liquid and type of container/package and, in each  changeover of liquid and/or container/package (depending on the situation, also the tank that supplies liquid) in the filling lines, a set of setup operations (cleaning and/or filling line adjustments) need to be performed, which depend on the production sequence.
The production bottlenecks in each of these stages are the focus of this study.The bottleneck of Stage I is the fermentation/maturation process, because the tanks are busy for several days until the liquid becomes ready and available for bottling.Regarding Stage II, the main bottleneck is in the filling, because the speed at which the packages are filled with liquid directly influences the release (or not) of the tanks.In the production environment studied in this paper, the possibility of using buffer tanks between Stages I and II is not considered.
To solve this problem, new mathematical models aimed at optimizing the main decisions involved in Stages I and II are proposed.The objective in the mathematical models is to minimize the inventory and backlog costs, as well as the number of setup changeovers in the filling lines (each change implies a small penalty in the objective function).The third term in the objective function is of a second order in comparison with the first two terms (observe that the value of alpha is a sufficiently small number; see function (1)).This small penalty aims at ensuring that, among the minimum cost solutions (first two terms), the optimal solution results in a small number of setup changeovers in periods with idle capacity.The models have a set of constraints that represent the main process limitations found in Stages I and II, as well as the decisions that integrate both stages.According to the literature, this paper deals with a multilevel lotsizing problem with sequence-dependent setup times and costs between the production of different items in different parallels filling lines (Almada-Lobo et al. [3] and Copil et al. [4]).The logical structure of each mathematical model is shown in Figure 2(a).Note in Figure 2(a) that Stage I is represented by two different mathematical formulations: BSAM-I is described in Baldo et al. [19] (see Section 3) and SPL-I is presented in Section 4.1.SPL-I uses a Simple Plant Location problem strategy [20] for modeling production and inventory decisions in Stage I.For Stage II, when it comes to Case A, the problem can be modeled by two different approaches.The first was already presented in the literature using the GLSP (General Lot-sizing and Scheduling Problem [14]) in BSAM-II (see Section 3).The second approach, SPL-II, also uses a Simple Plant Location reformulation and is presented in Section 4.2.Still describing Stage II models, but now for Case B, BSAM-II and SPL-II models of Case A are adapted to this problem situation (BSAM  -II and SPL  -II), as well as an alternative proposal modeling (ATSP-II) using the Asymmetric Traveling Salesman Problem [21] to capture scheduling decisions, as presented in Section 5.2.For Case A, there are four possible modeling approaches, by combining Stages I and II models, and each complete model structure can be seen in Figure 2

Literature Mathematical Model
This section briefly presents the mathematical model described in Baldo et al. [19].The mathematical model considers a planning horizon composed of a few weeks and each week is divided into periods corresponding to days or shifts.At Stage I, the periods add up to a total of || days.The decisions involved in Stage II need to be synchronized with the ones in Stage I; therefore for Stage II the || days are divided into two disjoint parts,  1 and  2 , having a Planning horizon different time segmentation for each.Thus, each day  ∈  is subdivided into a set   consisting of  subperiods of flexible size (see Figure 3).For each  ∈  Objective Function: BSAM-II subject to the following.

Mathematical Problems in Engineering
(5)

BSAM-II
The objective function (1) minimizes the sum of the backlogging cost, the inventory cost, and a term proportional to the number of item changeovers in the filling lines during the horizon planning.Constraints (2) represent the tank liquid balance equality and integrate Stages I and II.The liquid demand  in each tank  and period  comes from the item production quantities defined by Ψ, and in this model ensure that, in order to prepare the liquid in  (  = 1), the fermentation/maturation process has to take place during the previous Δ  periods.Constraints (4) ensure that, during any period of the fermentation/maturation process, the tank has no available liquid; that is,    equals zero.Constraints (4) impose boundaries on the amount of ready liquid.Concerning Stage II, constraints (6) balance the inventory, backlogs, production, and demand.Constraints (7) and ( 8) ensure that the limited capacity of the filling lines is respected for ranges  1 and  2 , respectively.During  1 , the setup time contributes to the capacity consumption, contrary to  2 .Constraints (9) ensure that the production of  only occurs in case the filling line is ready.Constraints (10) and (11) ensure that the filler must be prepared for a single item for each subperiod  ∈   ( ∈  1 ) and the number of preparations of the filler to Ω in every subperiod  ∈   ( ∈  2 ), respectively; in  2 the length of each subperiod is bigger than that of  1 .Constraints ( 12) and ( 13) capture the changeover of items in the filling lines in  1 , balancing the flow in and flow out of setups.Finally, constraints (14) define the domain of the variables.

Case A: Models
To model the problem at hand, consider the same sets and parameters described in Section 3 and also the definitions given below.The mathematical models proposed in this section use the sets and the parameters explained before.

𝐾 SPL
0  = 0: no ready liquid  inside tank  at the start of the planning horizon used in period   .

Case A: Stage I.
There are two approaches for representing Stage I of Case A with mathematical models, as shown in Figure 2. One of them was presented in Baldo et al. [19] and it is called BSAM-I.The main variables that compose this model are   , corresponding to the amount of ready liquid  available in tank  in period , and   , describing the total amount of liquid  that gets ready in tank  in period , comprising a set of constraints (3)- (5).
To describe Stage I of the present problem, we use reformulating and SPL strategies.This consists of replacing the variables   and   , resulting in variables  SPL   .The definition of these new variables is given below and constraints ( 15)- (20) representing Stage I are defined later.Moreover, it is known in advance that an auxiliary symbol Ψ is used in constraints (15), which is defined later during the presentation of the models for Stage II.

Variable: Stage I (SPL)
SPL   : amount of liquid  available in tank , which was prepared in period  and is used in period   .

SPL-I
∑ ∑ The set of constraints (15) engages Stages I and II, by ensuring that there is production of items during period   , only if there is ready liquid available.The symbol Ψ corresponds to the amount of liquid in tank  used in the production of final items (Stage II); this is described in Sections 4.2 and 5.2.
Stage I is exclusively represented by constraints ( 16)-( 21).The maximum and minimum capacity for each tank must be respected and it is ensured by constraints (16).Constraints (17) and (18) guarantee that the fermentation/maturation periods are completed; that is, they prohibit during at least Δ  periods that more than one liquid has been produced within the same tank.Constraints (19) and (20) ensure that, to have ready liquid in , then    = 1, and the process of fermentation and maturation takes place during the Δ  periods immediately preceding period .The necessary time to complete the fermentation and maturation processes for liquid  is satisfied by restrictions (19), as  SPL  *   = 0 ( * ∈ { − Δ  , . . .,  − 1}) during entire Δ  periods immediately prior to ; that is, the tank is solely for liquid  processing.Constraints (20) ensure that there is no production before the liquid is ready.The domain of the variables is defined by the set of constraints (21).

Case A: Stage II.
As depicted in Figure 2, there are two ways to define a mathematical model for Case A considering Stage II.The first uses GLSP modeling strategies, described in Section 3, consisting of a set of constraints ( 6)-( 14 .Thus, the definition of these new variables is given below.

Variables: Stage II (SPL)
: amount of item  produced in filling line  in subperiod  ( ∈   and  ∈ ), made of liquid fed by tank , to fulfill the demand of period   ,  backlog  : amount of item  required in period  which has not met at the end of the horizon of planning.

The mathematical model SPL-II concerning Stage II of
Case A is given by the following.

SPL-II
Objective function (22) aims to minimize the sum of the backlogging cost of unmet demand and the inventory cost of final products and a term proportional to the number of item changeovers in the filling lines and the cost of undelivered demand at the end of the horizon planning.For Stage II (bottling), constraints (23) ensure that the demand is being met and when there is a backlog or when the demand is not completely included in the horizon planning (backorder), it incurs penalties in the objective function.Constraints (24) and ( 25) ensure that the filler capacity limit is respected.In constraints (26), it is guaranteed that the production of  only occurs in case the filling line is ready.The set of constraints ( 27)-( 31) is similar to ( 10)-( 14), and, according to constraints (27), every filling line must be prepared for a single item for each subperiod  ∈   ;  ∈  1 .Constraints (28) limit the number of preparations of the filler to Ω in every subperiod  ∈   ;  ∈  2 .Remember that, in the second part of the horizon ( 2 ), the size of each subperiod can be larger than  1 , and scheduling decisions are not considered, but several lots (up to Ω) may be produced in the same filling line per subperiod.Constraints (29) and (30) capture the setup changeovers in the filling lines during  1 .Finally, constraints (31) define the domain of the variables.
It is worth remembering that constraints ( 15) and (2) introduce Ψ, which can be replaced by Ψ = ∑ ∈ ∑ ∈  ∩  ∑   ∈ ∑ ∈       when it is used to represent the problem using this model.
Table 1 shows all the possibilities to generate the mathematical models by the combinations that comprise the parts in Figures 2(a) and 2(b), concerning Case A, using the defined constraints.Note on the left of Table 1 that Stage I can be modeled using the BSAM-I or SPL-I approach and also that Stage II (Case A) can be described using the BSAM-II or SPL-II, resulting in four possible combinations (Figure 2(b)).The possibilities of model compositions are described in the first column of Table 1 and are interpreted analogously to the BSAM-I + BSAM-II model, composed of the objective function (1), the constraints coupling Stages I and II (2), the Stage I constraints (3)-( 5), and, finally, the set of constraints that make up Stage II ( 6)-( 14).

Case B: Models
For the definition of the mathematical models proposed for Case B, consider the notation introduced in Section 4.  .As a consequence, fine adjustments in the model were made since changes in the tank that supply each filling line are no longer tracked.This representation of the problem reduces the number of variables, but the problem is still difficult to solve.
-II.Equations ( 6) and (7)  (33) In addition to the adjustments to the previous models, a new formulation proposal is made for Stage II based on the ATSP (Asymmetric Traveling Salesman Problem); see Figure 2. In this reformulation of the Stage II model, the concept of subperiods is dropped.In this model, each period in the first part of the planning horizon corresponds to one day, but the details regarding the scheduling remains in the first  1 periods.Consider the following settings for the model.

Variables: Stage II (ATSP) 𝑌 II
: 1, if in filling line  a setup for item  in the beginning of period  occurs, 0 otherwise,   : 1, if in filling line  a setup changeover from  to  in period  occurs, 0 otherwise,   : number corresponding to the order production sequence of item  of bottling line  during period .

Objective Function: ATSP-II
adding constraints (32) and the same domain to (14), with  II  .
The objective function (34) minimizes the sum of the backlogging cost, the inventory cost, and a term proportional to the number of item changeovers in the filling lines during the horizon planning.
The set of constraints ( 35) and ( 36) is similar to ( 6) and ( 7), respectively.Constraints (35) ensure the inventory and production balance of the final items.The capacity limit for each filler during the first | 1 | periods is ensured by constraints (36).Constraints (37) only allow the production Mathematical Problems in Engineering of item  at period  if the filler is prepared for it, either by a changeover setup operation (the bottling line is prepared for the production of item  and is changed to item , and then   = 1) or by the inheritance of the previous period setup state (when the machine in period  − 1 is already prepared to produce item  and this preparation was taken to ,  II  = 1).At the beginning of each period, the machine must always be prepared for one item as imposed by constraints (38).The flow of changes and preparations for each filling line are captured by constraints (39).The left side is equal to 1 if there is a preparation and the filler is prepared for item  in period  ( II  = 1) or if there is at least one changeover in the filling line from items  to  (∑    = 1).Therefore, the machine setup is sent to +1,  II ,+1 = 1, or there is a setup changeover from items  to any other  during period  (∑       = 1).The same logic applies when both sides are equal to zero.The maximum number of changeovers in each filler  for each period  is limited to Ω (40).
By using this model (ATSP-II), the coupling constraints need to be changed by replacing Ψ = ∑ ∈ ∑ ∈  ∩      .
Before going to the next section, note that BSAM-II constraints ( 11)-( 12) were replaced by (39) in the ATSP-II model.This change was motivated by the computational results of various tests conducted, considering both sets of constraints (also adding subtour elimination constraints to the model).The tests did not distinguish the computational performances between the two alternatives and it was decided to use constraints (39).
The solutions provided by the solution of this model without constraints (41) enable the existence of subtours and, therefore, it is invalid in practice.These constraints (41) were proposed by Miller et al., therefore named MTZ constraints [22].To generate constraints (41), MTZ, in order to obtain a feasible solution, it should be imposed that there is only one component connected to the corresponding arc of the  II  variable, whose constraints (41) achieve this by using variables   , that is, by analyzing the filling line status through any sequence.A similar mathematical modeling strategy is known as the Traveling Salesman Problem [23].
The mathematical modeling alternatives for the integrated lot-sizing and scheduling problem in the brewery industry, specifically for Case B, are summarized in Table 2.The reading and interpretation of this table are similar to Table 1.

MIP-Based Heuristics: Decomposition of Stages
Using both case models, several computational tests were conducted using different MIP-heuristic methods to find good solutions for the problem, which are not accomplished by the exact methods found in standard commercial optimization solvers.
In the design of the MIP-heuristics, a hierarchical decomposition method is followed.By decoupling stages, the method aims to disaggregate the most difficult decisions of each stage, while providing relevant information from one stage to the other.The MIP-heuristics first solve Stage I and then Stage II.In other words, first the tank filling plans are defined, and this information is used to develop the bottling plans.Basically, Stage I defines which liquids, periods, and the corresponding amount of these fluids that will be ready in each one of the tanks during the planning horizon.This information is then used to develop the production plan for Stage II.The order in which each stage is solved was defined after several preliminary tests.As a matter of fact, when Stage II was solved first followed by Stage I, there were many cases in which the heuristics were unable to find feasible solutions.This fact occurs mainly by establishing impracticable production plans due to unforeseen tank capacity issues resulting in ready liquid absence to manufacture the expected items.This situation does not occur if Stage I is solved first and then Stage II, since Stage II can always adapt its schedule to the available ready liquid, even if it implies backlogging some demand.
Thus, the proposed MIP-heuristic can be described in two main steps: one describing the Stage I solution and the other tailored to solve Stage II.
Step 1 (Stage I).When disengaging stages during Stage I solution, some constraints of Stage II and other relevant information have to be considered to prevent some solutions, such as having all the liquids ready at the same time, overwhelming the filling lines.Other constraints follow the same definitions of their mathematical models previously described.
Step 2 (Stage II).The information received from Step 1 ( copy  and  I copy  ) is maintained and respected during the solution of Stage II.Furthermore, the objective function is the same as that defined in Stage II models both for Cases A and B.

MIP-Heuristic: Stage II Objective Function
Case A: BSAM-II or SPL-II or Case B: BSAM  -II or SPL  -II or ATSP-II: using the correspondents Ψ, according to Case A or B and also the model that one wants to use to represent Stage II.

Stage II
Case A: BSAM-II or SPL-II or Case B: BSAM  -II or SPL  -II or ATSP-II.
In this step, the MIP-heuristic solves Stage II considering the information received from Stage I ( copy  and   copy  ).This is achieved using the set of constraints ( 48)-(50), which is responsible for the definition of the tanks plan in Stage II.The production only occurs if there is ready liquid available for the filling, as guaranteed by constraints (48).Constraints (49) ensure the tank will be empty in order to receive the liquid that will ferment and mature and also that it will be exclusively for this liquid while fermenting and maturing.Moreover, constraints (50) ensure that the maximum and minimum tank limits are respected.
The MIP-heuristics used to solve Cases A and B follow the modeling approach defined in Tables 1 and 2. To distinguish them from the original model solution, these heuristics are named using "H:" in front of the respective model name, for example, H:BSAM-I + BSAM-II.

Computational Results
The solution approaches were implemented in C++ using ILOG Concert libraries and were solved using the solver Cplex (version 12.6).The test bed consisted of the same testing instances introduced in Baldo et al. [19], composed of 20 instances randomly generated based on real data.The numbers of items (|| = {35, 40}) and filling lines (|| = 5) have dimensions that correspond to industrial settings usually found in brewery companies.The tests were performed using a PC with a 3.4 GHz Core i7 2600 processor (four cores, 2 threads each) and 16 GB of RAM memory.The running time of each solution approach was limited to one hour, which is an acceptable time in order to support planning decisions in practical settings.For the MIP-heuristics, the maximum execution time was divided by the two steps as follows: a maximum of 45 minutes for the solution of Stage I model and the remaining time for the Stage II model.
For each instance, the values of GAP-defined in (51), RATIO-calculated as (52), the amount of undelivered demand at the end of the planning horizon, and the execution time were analyzed.In the definitions of GAP and RATIO, OF represents the current value of the analyzed objective function, LB is the best lower bound found for the instance during the runtime limit, and OF Best is the best objective function value found for the problem.
The results are presented in Subsections 7.1, 7.2, and 7.3.Subsection 7.1 contains the results of Case A shown in this sequence: the holistic model and the MIP-heuristic results, the latter was compared with the best model performances, and then a summary was compiled and is shown in Table 3. Subsection 7.2 presents the results of Case B using the same layout introduced for Case A. Then, Subsection 7.3 compares both Cases A and B. In Subsections 7.1 and 7.2, the comparison charts are based on the study presented in Dolan and Moré [24].In the charts in Figures 4 and 5, two or more methods can be compared by analyzing the relation of a performance parameter (e.g., OF, RATIO, and GAP) in a finite set of instances.The deviations between the solution value of each procedure and the best solution of all methods are calculated for each instance.Then, a chart based on Dolan and Moré is complied based on the quantity of solutions that presents deviations smaller than .This is done for all methods and it is analyzed in relation to the percentage of the entire set of test instances solved.In this paper, the objective function (OF) values are used as the performance parameter.
The chart based on Dolan and Moré depicts (log 2 ( , ) ≤  : 1 ≤  ≤  S ) values, which represent the cumulative distribution function for the performance profile associated with a given value , that is, the fraction of problems solved by the method within a factor  of the best performance obtained.All charts use a logarithmic scale to present the results.
The computational results for the first, second, and third parts are presented in Sections 7.1, 7.2, and 7.3, respectively.For the graph interpretation, summarizing, the -axis is the fraction of solved examples and the -axis is given by .Thus, the performance of each procedure is represented by one curve in these graphs.The curve should be analyzed in relation to the origin-the closer the origin is in the -axis and the further it is in the -axis, the greater the number of problems solved considering the best performance by this procedure is.If the curve is in -axis, finding level 1 means that all instances have been resolved by the method.
7.1.Computational Results: Case A. As already mentioned, all computational tests were solved using CPLEX 12.6.However, we used the results published in Baldo et al. [19] for BSAM-I + BSAM-II model MIP-heuristic Pro Inc (the method with the best performance in the literature and named here as H:BAL14), that is, using the version of CPLEX 12.4.It is worth remembering that, in the referred paper, the comparison of the results was analyzed using only RATIO values, while in this present research we are using RATIO values (calculated in relation to the methods presented here) and other comparison parameters.
The mathematical models described in Table 1 obtained feasible solutions for all the 20 test instances within the specified time limit.Figure 4(a)-(i) presents the results of the performance profiles expressed as suggested in Dolan and Moré [24], using the OF as the comparison metric.Figure 4(a)-(ii) depicts the RATIO values through a boxplot, whose interpretation should be made in relation to the axis.The closer the boxplot extremes are to zero, that is, its quartiles, the closer the solutions are to the best solution found for the instances.
Note also in Figure 4(a)-(ii) that, next to each boxplot, the set of points representing each individual instance is also depicted.The closer the points are to zero, the better the quality of the evaluated solutions is.Analyzing Figure 4(a)-(i), the models BSAM-I + SPL-II, BSAM-I + BSAM-II, SPL-I + GLSP-II, and SPL-I + SPL-II obtained the best OF values for 60%, 30%, 15%, and 5%, respectively.Note that the sum of these percentages is equal to 110%, which means that there was a draw in 10% of the best solutions.The SPL-I + GLSP-II and SPL-I + SPL-II models had poor performances for 90% of the test instances when compared to BSAM-I + BSAM-II and BSAM-I + SPL-II models, which alternated (or tied) in yielding the best performances.These results can be reaffirmed by observing Figure 4(a)-(ii).Therefore, in general, it can be affirmed that model SPL-I + SPL-II had the less satisfactory performance, while the most satisfying one alternated between models BSAM-I + BSAM-II and BSAM-I + SPL-II, with the latter producing a higher percentage of the best solutions.The amount of demand not delivered at the end of the planning horizon was quite high for all models, with an average of 73.3%, 71.8%, 78.8%, and 95.0% to models BSAM-I + BSAM-II, BSAM-I + SPL-II, SPL-I + GLSP-II, and SPL-I + SPL-II, respectively.
Concerning the GAPs, all the models obtained a value higher than 98% and, to compare the performances of the mathematical models with the MIP-heuristics, we used the best value of OF obtained regardless of which model was provided for each of the instances.Thus, in the second column of Table 3 (models), the GAP of the best OF values among all the analyzed models is shown.
The results obtained using the MIP-heuristics are presented in Figure 4(b) and Table 3, and the interpretation is similar to Figure 4(a).All the MIP-heuristics obtained a feasible solution for the 20 test instances using less than 3500 seconds in 100% of the tests.In Figure 4(b)-(i), the values obtained by the models, even with the best results among them, were clearly worse than any of the MIP-heuristics.These results are reinforced by the representation shown in Figure 4(b)-(ii), as the boxplot corresponding to the best objective among all models is far from the origin on the -axis.Moreover, the points designating the RATIO are all close to 100%.Regarding the MIP-heuristics, it can be seen that H:BAL14, H:BSAM-I + BSAM-II, H:BSAM-I + SPL-II, H:SPL-I + BSAM-II, and H:SPL-I + SPL-II showed the best OFs to 0%, 30%, 5%, 35%, and 35% of the instances, respectively.H:BAL14 was the MIP-heuristic that provided the best results reported in the literature; however it had a poor performance for 75% of the instance resolutions when compared to the newly introduced MIP-heuristics.Overall, H:SPL-I + SPL-II showed the best performance in 95% of the cases, as shown in Figure 4(b)-(i), for 90% of the instances, as its RATIO was less than 25% (see Figure 4(b)-(ii)).The amount of demand not delivered at the end of the planning horizon was practically zero for all the heuristics, with an average of 0.00%, 0.02%, 0.03%, 0.00%, and 0.00% for H:BSAM-I + BSAM-II, H:BSAM-I + SPL-II, H:SPL-I + BSAM-II, and H:SPL-I + SPL-II, respectively.Concerning the GAPs, Table 3 shows that H:BAL14 obtained higher values than the other MIP-heuristics, with an average GAP of 31.91%.For all 20 instances, H:BSAM-I + BSAM-II, H:BSAM-I + SPL-II, H:SPL-I + BSAM-II, and H:SPL-I + SPL-II presented the best GAP values with 30%, 5%, 30%, and 35%, respectively.Furthermore, the best average GAP value was H:SPL-I + SPL-II with 16.61%.To sum up, when considering Case A, the MIP-heuristics from the literature did not obtain as good results as the MIP-heuristics proposed here.

Computational Results: Case B. The computational tests
for Case B were conducted with the same instances used in Case A. The results of the mathematical models proposed for Case B described in Table 2 are shown in Figure 5(a).The models provided feasible solutions for all instances within the computational time available.Models BSAM-I + BSAM  -II, BSAM-I + SPL  -II, BSAM-I + ATSP-II, SPL-I + BSAM  -II, SPL-I + SPL  -II, and SPL-I + ATSP-II showed the best OF values for 45%, 5%, 50%, 0%, 0%, and 0%, respectively.
The model that had the overall worst performance was SPL-I + SPL  -II.Models SPL-I + ATSP-II and SPL-I + BSAM  -II, despite having better performances than SPL-I + SPL  -II, underperformed the others and had a performance close to BSAM-I + SPL  -II.The amount of demand not delivered at the end of the planning horizon averaged 16.69%, 61.92%, 15.02%, 70.80%, 99.32%, and 52.19% to BSAM-I + BSAM  -II, BSAM-I + SPL  -II, BSAM-I + ATSP-II, SPL-I + BSAM  -II, SPL-I + SPL  -II, and SPL-I + ATSP-II, respectively.The best performance was obtained from model BSAM-I + ATSP-II, followed by BSAM-I + BSAM  -II.Regarding the GAPs, in the vast majority of the instances, the models had GAP values over 70%, a few cases differ from this result.Regarding the comparison with the MIP-heuristic results, again the best OF values obtained for each of the instances were selected, regardless of which model provided this value.These GAPs are given in Table 4 in the column named models.
The MIP-heuristic results are shown in Figure 5(b) and Table 4.The performances of the models in obtaining good solutions were lower than the MIP-heuristics, followed by a not very satisfactory H:BSAM-I + SPL  -II performance.For the remaining MIP-heuristics, the results showed very similar performances; see Figure 5 the end of the planning horizon was close to zero for all procedures.Regarding the GAP values shown in Table 4, the MIP-heuristics H:BSAM-I + BSAM  -II, H:BSAM-I + SPL  -II, H:BSAM-I + ATSP-II, H:SPL-I + BSAM  -II, H:SPL-I + SPL  -II, and H:SPL-I + ATSP-II presented the best values for 5%, 0%, 40%, 5%, 5%, and 45%, respectively.The best average GAP was H:SPL-I + BSAM  -II, with a value of 2.19%.Therefore, it can be stated that the best performances were obtained using the MIP-heuristics H:BSAM-I + BSAM  -II, H:SPL-I + BSAM  -II, and H:BSAM-I + ATSP-II.

Results: Case A versus Case B.
In order to analyze the benefits of investing in the production process in order to change the situation from Case A to Case B, that is, automating the changeover process of the tanks that are supplying the filling lines, the results for all instances in both scenarios were compared.However, due to the large number of results and the similar behavior between these instances, only two of them were chosen to be reported here: one of the class of 35 items (|| = 35) and the other of 40 (|| = 40), both with 5 fillers.Figure 6(a) depicts the comparison of the instance with 35 items, showing the best performance obtained by the models that were presented in Tables 3 and 4

Conclusions and Perspectives
This study was motivated by the multistage production planning and scheduling in the brewery industry.The beer production process can be divided into two main stages: therefore the previous models were adapted and modified to represent this case (BSAM-I + BSAM  -II, BSAM-I + SPL  -II, SPL-I + BSAM  -II, and SPL-I + SPL  -II).Moreover, a new modeling approach is introduced to capture Stage II of this case, which is based on the ATSP (Asymmetric Traveling Salesman Problem) (BSAM-I + ATSP-II and SPL-I + ATSP-II).Due to the difficulty of solving these models with exact methods, a MIP-heuristic strategy is developed.The MIPheuristic sequentially solves Stages I and II submodels in separate phases in order to find a complete solution to the problem.However, to avoid nonfeasible solutions, some information has been supplied from one stage to another.This decomposition strategy was more efficient, yielding better results than the pure solution of mathematical models with standard commercial solvers, as well as other approaches previously reported in the literature.For Case A, the best performances were achieved by BSAM-I + BSAM-II and BSAM-I + SPL-II models and by H:SPL-I + SPL-II MIPheuristic.With respect to Case B, BSAM-I + ATSP-II and BSAM-I + BSAM  -II models and H:BSAM-I + BSAM  -II and H:BSAM-I + ATSP-II MIP-heuristics obtained the best performances.The benefits of using more automated technology in the production process are also analyzed establishing the potential cost reduction.
Regarding the perspectives for future research, the adaptation of an ATSP-based model to represent Case A is still a challenge.Moreover, the two-stage modeling is a suitable candidate to apply Dantzig-Wolfe decomposition [25], together with the generation of columns and a procedure to create feasible solutions.Another proposal for future research consists of adding to the mathematical formulations the possibility of using buffer tanks and analyzing the advantages and disadvantages of this approach.

FFigure 1 :
Figure 1: Difference between Cases A and B regarding the tank swaps to supply the bottling line.

(i) (Step 1 )
solve Stage I considering some information of Stage II (lot-sizing decisions).(ii) (Step 2) the solution obtained for Stage I is fixed and used during Stage II resolution.

Figure 2 :
Figure 2: Different approaches used to mathematically represent the problem.

5. 1 .
Case B: Stage I.The main difference between Cases A and B is found in Stage II.Therefore, the mathematical modeling of constraints describing BSAM-I and SPL-I for Stage I are valid to Case B. 5.2.Case B: Stage II.The proposed mathematical models to represent Stage II in Case A can be adapted to translate Case B. The machine preparation variables ( II  ) lose the index referring to tanks (, with  ∈ ) making  II

Figure 4 :
Figure 4: Case A: (i) performance profile and (ii) boxplot graphic summarizing the results of the RATIO.

Figure 5 :
Figure 5: Case B: (i) performance profile and (ii) boxplot graphic summarizing the results of the RATIO.
1 , |  | ≤ Ω and, for  ∈  2 , |  | = 1; that is, the number of subperiods per day varies only in  1 , keeping a similar division used for tanks in  2 ( =  1 ∪  2 ;  1 ∩  2 = 0).Ω is a maximum number of preparations in a filling line in a period.The first part of the planning horizon,  1 first periods, provides greater detail at the beginning of the planning horizon.  : production time of one unit of item  in filling line ,   : total filling line  capacity in period  (time),   : quantity of liquid  necessary for the production of one unit of item ,  : maximum number of preparations in each filling line in period , : sufficiently small number, : sufficiently large number,  0 = 0: no stock of items  at the start of the planning horizon,   : 1 if a setup changeover in filler  from items  to  in subperiod  occurs, 0 otherwise, Sets : items (,  ∈ ), : liquids ( ∈ ), : filling lines ( ∈ ), : tanks ( ∈ ),  1 : periods in the first part of the planning horizon ( ∈  1 ),  2 : periods in the second part of the planning horizon ( ∈  2 ), : periods in the planning horizon ( =  1 ∪ 2 ,  1 ∩  2 = 0),   : items that use liquid  in their composition,   : items that can be produced in filling line .Parameters Δ  : number of periods required to process liquid  (duration of the fermentation/maturation plus tanks' cleaning operations),   : demand of item  in period , ℎ +  : inventory cost for one unit of item  over one time period, ℎ −  : backlogging cost for one unit of item  over one time period,  : required setup time in filling line  when switching from items  to , Cap  min : lower bound in the amount of liquid in tank , Cap  max : upper bound in the amount of liquid in tank , Ω0 = 0: no ready liquid  inside tank  at the start of the planning horizon.Auxiliary Ψ: defining the item production quantities depends on the Stage II model that is used.Varibles Both: stages,   : amount of item  produced in filler  at subperiod  with liquid supplied by tank .Stage I   : amount (i.e., inventory) of liquid  ready and available inside tank  at subperiod ,   : amount of liquid  that gets ready in tank  at subperiod ,  I  : 1, if liquid  gets ready in period  in tank , 0 otherwise. : 1 if filler  is liquid supplied by tank  and prepared to produce item  in subperiod , 0 otherwise,  : Backlog number of items  at the end of period ,  +  : inventory of item  at the end of period .
) whose main variables are as follows:  −  refers to the backlog number of items  at the end of period ;  +  is the inventory of item  at the end of period ; and   denotes the amount of item  produced in filling line  in subperiod  ( ∈   and  ∈ ), made by the liquid fed by tank .In this research, the second way uses SPL strategies to reformulate Stage II, replacing the variables  −  ,  +  , and   , by the variables    and

Table 2 :
Mathematical model for Case B.

Table 3 :
Case A: comparison in relation to GAP values of MIP-heuristics and between the models with the best performance.

Table 4 :
Case B: comparison in relation to GAP values of MIP-heuristics and among the models with the best performance.