1 Introduction
Fruitbased beverages are nonalcoholic, noncarbonated beverages, characterized by having some amount of fruit in their composition. According to ^{Euromonitor (2015)}, this beverage industry is expected to move US$ 11 million by 2020. The high consumption of this type of beverage is explained by a worldwide trend of food consumption and healthpromoting ingredients, socalled functional foods. Considering the growth of the sector, new fruitbased beverage factories have emerged, making this market increasingly competitive. Amidst more options and increased competition among these companies, it is essential that they make assertive decisions, both strategically and operationally. One of the challenges for the beverage industry is to use efficient production programs, taking into account the demand in each period, the preparation times of the machines and the changeover times between the various items, capacity and limited production time (^{Ferreira et al., 2012}).
There are various studies in the scientific literature addressing the real problems of production scheduling with lot sizing and scheduling mathematical models (^{Jans & Degraeve, 2008}). ^{Copil et al. (2017)} present a vast literature review on these problems highlighting the classic models and how the literature has evolved from these models. They point out a research trend concerning problems applied to real situations, such as in the following industries: animal nutrition (^{Toso et al., 2009}), paper and pulp (^{Santos & AlmadaLobo, 2012}), food (^{Tempelmeier & Copil, 2016}), semiconductor manufacturing (^{Xiao et al., 2013}), tile manufacturing (^{Ramezanian et al., 2017}) among others. In these studies, the specific characteristics of the production processes are taken into account when developing production scheduling. In an article by ^{Stefansdottir et al. (2017)}, the authors present a general classification for setups and cleanings and propose a general model to consider the stops for these two purposes in a flowshop production system, aiming to minimize the makespan. These characteristics can make these problems even more difficult to model and solve, resulting in many studies that apply heuristic solution methods to real problems, such as in ^{Furlan et al. (2015)}, who applied the metaheuristic genetic algorithm to a problem in the paper and pulp industry; ^{Mateus et al. (2010)} and ^{Menezes et al. (2016)} who used hierarchical decomposition heuristics for the lot sizing and scheduling problem; the latter was used in a bulk cargo problem; and ^{Xiao et al. (2013)} who solved a problem in a semiconductor company using matheuristics.
There are various studies in the literature that deal especially with beverage production planning and scheduling. Studies carried out by ^{Guimarães et al. (2012)}, ^{Christou et al. (2007)} and ^{Gunther (2008)} address longterm production planning in the soft drink and/or beer industries. ^{Sel & Bilgen (2014)} studied production planning from a stochastic approach. Inspired by a real case, ^{Ferreira et al. (2009}, ^{2010}, ^{2012}) present mixed integer programming (MIP) models to solve the lot sizing and scheduling problem found in soft drink production, besides proposing heuristics for solving real instances. ^{Toledo et al. (2015)} also present a model soft drink production, but for a more general production process. The model proves difficult to be solved even for small instances. ^{Baldo et al. (2014)} present a Mixed Integer Problem (MIP) for the lot sizing and scheduling problem in brewing industries and propose MIP heuristics to solve it.
Unlike other beverages, research on fruitbased beverage scheduling is more recent and there are few papers in the literature. In addition to the characteristics found in beverage production that influence production scheduling which were pointed out above, in fruitbased beverage production, there are specificities that differentiate this production process from those of other beverages. They are the following: buffer tanks between the beverage preparation and filling stages (which have a direct impact on the synchrony between these two stages); and the need for temporary cleanings that must be done after a certain period of time without any cleaning (^{Toscano et al., 2019}). Further details of this production process are presented in Section 2. Some examples of studies on fruitbased beverage production scheduling appear in ^{Pagliarussi et al. (2017)}, but only consider the second stage of production in modeling. To solve the problem, the authors propose models based on the Capacitated Lot Sizing Problem (CLSP) (^{Drexl & Kimms, 1997}) and the General Lot Sizing Scheduling Problem (GLSP) (^{Fleischmann & Meyr, 1997}) that consider discretized time. As only one production stage is considered, temporal cleanings are controlled by establishing maximum lots. Another example appears in ^{Toscano et al. (2019)}, who addresses the problem of fruitbased beverage production scheduling considering the two stages of production. The authors studied a case where the changeovers are sequenceindependent and propose problem decomposition heuristics by stages.
This paper addresses the problem considering the two production stages, but unlike ^{Toscano et al. (2019)}, considers that the production lot changeovers in the first and second stages are sequencedependent which occurs in the production processes of some companies in the sector. A twostage heuristic is proposed to solve the problem. In the first phase, initially a mathematical model is solved to generate the lot sizing and their production scheduling in each one of the stages, but without considering the synchrony of production between the two stages. Then, the heuristic attempts to synchronize the production of the two stages of the model solution. In the second stage, the heuristic involves a phase and improvement, which seeks to obtain a good feasible solution for the problem from the solution of the first phase. In a study conducted by ^{Toscano et al. (2019)}, the proposed heuristic only searches for a feasible solution, not taking into account the improvement of that solution. In addition, the model proposed and used in the heuristic of this work considers information from the two production stages, whereas in ^{Toscano et al. (2019)}, the authors solved each stage separately by one model for each. Another difference of these studies is that the changeover times and costs in ^{Toscano et al. (2019)} were considered independent of the production scheduling, whereas in the present study they are sequence dependent. Notice that if the changeover costs and times are independent of the production sequence, the heuristics proposed here are also applicable.
While developing this research, five companies of the sector were visited to understand the production process better, as well as the difficulties in carrying out production scheduling. Data were collected from one of these companies, and based on these data, instances were created to run computational tests to validate the proposed solution approach. This paper is organized as follows: Section 2 presents a description of the problem addressed. The proposed heuristic is described in Section 3. In Section 4, the results of the computational tests are presented and analyzed. Finally, the conclusions and perspectives for future research from this work are discussed in Section 5.
2 Fruitbased beverage production process
As mentioned, fruitbased beverage production basically consists of two main production stages: the Preparatory Tank, responsible for beverage preparation and the Line, where the beverage is pasteurized, filled and packaged. The Line is composed of buffer tanks, pasteurizers and filling machines.
In the first stage, the ingredients are mixed with water in the preparatory tanks and, due to reasons of homogeneity, there is a minimum quantity that must be produced (minimum lot), up to a maximum quantity defined by the size of the preparatory tanks (maximum lot). Once ready, the beverages from the preparatory tanks are transferred to a buffer tank inside the line, releasing the preparatory tanks to prepare a new lot of beverages. Each preparatory tank is allocated to a production line. From the buffer tank, the beverage goes through a pasteurizer and goes to the filling machines, in the second stage. The final items are then packaged and sent to the stock. The preparation time of a lot in the preparatory tanks is fixed and the filling time of a lot varies according to the speed of the filling machines. The flavor and cost changeover times in both the preparatory tank and the line are dependent on the production scheduling and respect the triangle inequality.
Different from other types of beverage manufacturing, after a time limit without any cleaning, “temporal cleaning” (^{Toscano et al., 2019}) is required and mandatory. The maximum time for temporary cleaning is
To illustrate all the specificities that should be considered in fruitbased beverage production scheduling, a feasible production schedule for an exemplary illustration with only one period is presented in Figure 1. There are two items “a” and “b”, a preparatory tank and a Line. The dotted lines in Figure 1 show the instant the lot is being transferred from the preparatory tank to the Line.
The transfer time is considered with the preparation time of the beverage. Due to this, in Figure 1 the transfer is instantaneous between the stages. Some variables presented in this figure are used later in Section 3. It can be observed that at the beginning of the period, the first cleaning is done and that the time spent on this cleaning is different for the two stages. The time is shorter for cleaning the first stage. Note in the figure that temporal cleanings take place at different times at each stage and that the time elapsed between two cleaning times until
As shown in Figure 1, waiting times may occur in the preparatory tank when the line is not available to receive the prepared beverage lot, either because a line is being cleaned or because the line has not yet finished filling the previous lot. The waiting times in the figure are called (A), (B), (C), (D) and (E), more details about theses waiting can be see in ^{Toscano et al. (2019)}. For example, the preparatory tank has finished producing lot a1, while the first cleaning of the period in the line is still being performed; that is why there is a waiting time (A) after the representation of lot a1 in the preparatory tank. The waiting times in the line through the preparatory filling tank occur when the line has finished filling the lot and the preparatory tank has not yet finished preparing the next lot. For example (D), the line has finished filling lot a3, but the preparatory tank has not yet finished producing lot a4. Therefore, the two production stages are capacity constrained resources and can become bottlenecks if not scheduled correctly.
Therefore, considering all the specificities described above that influence production scheduling, the problem addressed in this work is to determine the production scheduling in fruitbased beverage companies in which the following specific characteristics must be taken into account: complete transfer of the lot from the preparatory tank to the line; the need for temporal cleanings; time and costs of flavor changeovers depending on the production schedule; and synchrony between the production stages.
3 Proposed heuristic
The heuristic proposed in this paper to solve the fruitbased beverage production scheduling problem is based on two phases. In the first phase, a mathematical model is initially solved, called Relaxed Model (RM), presented in Section 3.1. The RM is said to be relaxed because, although it contains information and considers constraints of the two production stages, the synchrony between these stages is not taken into account in this model. Therefore, a feasible solution for the RM may correspond to the one that is infeasible to the problem due to the lack of symmetry in the twostage production scheduling problem. This is then verified by the heuristic, which performs postprocessing in the model solution to find a feasible solution to the problem. In the second phase, the heuristic seeks to improve the feasible solution obtained in the first phase. Thus, the heuristic is called “Feasibility and Improvement Heuristic of the Relaxed Model Solution” (FIHRMS). In the feasibility stage, the FIHRMS searches for a feasible solution to the problem, from the solution of the RM model, initially without evaluating the quality of the solution found. Then, in the improvement phase, the objective is to improve the feasible solution obtained from the first stage, maintaining the feasibility thereof. In the following section, the RM and then the complete description of the FIHRMS are presented in Section 3.2.
3.1 Mathematical model
In this section, the RM is presented, a mixed integer linear optimization model, which is a relaxation for the problem of scheduling fruitbased beverage production in two stages. As mentioned, the model is considered as a relaxation for the problem, as it disregards the synchrony between the two production stages. Temporary cleanings are not explicitly included in the constraints. It is assumed that temporal cleaning in one of the stages necessarily generates a waiting time in the other stage. There are continuous decision variables that indicate the start and end of the processing of each production lot, but there is no decision variable that indicates the start or end of the cleaning. Thus, if temporal cleaning is performed at any of the stages, the model is not able to predict whether this event will generate a waiting time in the other stage, i.e., the model does not establish the dependence between the two stages explicitly. Based on the RM solution, it is necessary to carry out postprocessing to know if this solution is feasible, that is, if it respects the production capacity limits of the period. This postprocessing for synchrony of the two stages is performed by the algorithm presented in ^{Toscano et al. (2019)}, adapted for this study. The lots obtained in the model solution are inserted, one by one, into the production schedule, together with the waiting times and the temporal cleanings, ensuring synchrony between the two stages. At the end, it is observed if the solution obtained is feasible, i.e. if after including all the temporal cleanings and waiting times, the production capacities, in time, are still respected.
To construct the RM, time was considered continuously (^{Almeder et al., 2015}). Scheduling is done via flow restrictions and subtour elimination (^{Ferreira et al., 2012}), and each lot is considered a batch, that is, filling a tank with the quantity determined by the lot size (^{Camargo et al., 2012}). The RM is presented below. The sets, parameters and decision variables are described next.
Sets:
Parameters: .
Decision variables:
The RM is presented next by Equations (1) to (27).
subject to
Objective function (1) minimizes the total inventory, backorder, changeover and temporal cleaning costs. Constraint (2) performs the inventory and demand balance. Restriction (3) imposes the existence of the minimum production lot, and (4) imposes the maximum production lot, determined either by the maximum production limit (tank capacity) or by the maximum available time before temporary cleaning. Restriction (5) imposes that only the production in lot
Constraint (18) determines that if there is a changeover from item i to item j in stage I, the starting time of the first lot of item j must be after the end of the last lot
3.2 Description of FIHRMS
The FIHRMS heuristic is based on the resolution of the RM (1)(27) considering parameter
Since the first phase of the heuristic is intended to provide initial feasible solutions without ensuring high quality, the production capacity can be greatly reduced, forcing the model to generate many backorders, thus providing a feasible but lowquality solution. Thus, the second heuristic improvement stage is proposed to try to balance the tradeoff between feasibility and solution quality. By changing the value of α and resolving the RM, the feasibility of the obtained solutions can be modified. Suppose, for example,
Thus, in general, in order to find a feasible solution after synchrony, there must be a balance in the choice of parameter
The second variant used to reduce
If the new solution obtained,
4 Computational tests
To evaluate the performance of the FIHRMS heuristic, computational tests were run using instances based on real data from a company in the sector. The FIHRMSS and FIHRMSR heuristic variants were implemented in the AMPL modeling language and the solver used was the CPLEX 12.6.1. The computer used for testing was an Intel core i7 processor with 3.7GHz and 16GB memory. The objective was to compare the performance of the two variations of the proposed heuristic, FIHRMSS and FIHRMSR in various scenarios.
The runtime limit of the FIHRMS heuristic was 3600 seconds. While the FIHRMS heuristic was running, the RM was solved at each iteration. Thus, it is defined that the stop criterion in the RM resolution in each iteration of the FIHRMS is the optimality or the time limit of 300 seconds.
The value of
4.1 Instances
The computational tests were carried out with 14 sets of instances based on three instances containing real data (I1, I2 and I3). Instances I1 and I3 consist of 4 periods and I2 of 5 periods, totaling 42 instances. These data were collected in a typical fruitbased beverage factory located in the interior of São Paulo State, Brazil and is part of a worldwide network of beverage factories. The actual data for these instances are the demand for each product, the temporal cleaning times and changeover between products and the production capacities of the tanks and the filling machines. Each period of these instances corresponds to one week of production.
In the company we visited there are two production lines/preparatory tanks, therefore
Set  Instances (I1/I2/I3)  Modifications 

01  I101/I201/I301  Instances based on the company’s data 
02  I102/I202/I302  Filling speeds doubled 
03  I103/I203/I303  Filling speeds tripled 
04  I104/I204/I304  Filling speeds doubled and

05  I105/I205/I305 

06  I106/I206/I306 

07  I107/I207/I307 

08  I108/I208/I308  For period

09  I109/I209/I309  For period

10  I110/I210/I310  For period

11  I111/I211/I311  For period

12  I112/I212/I312 

13  I113/I213/I313 

14  I114/I214/I314 

Source: The authors.
4.2 Results
Table 2 presents the mean values of the objective and time function obtained by the FIHRMSS and FIHRMSR heuristics for each set of instances. The high objective function values presented in this table are due to the high costs (penalties) of backorders and inventory, which, as mentioned above, were set at 100 and 10, respectively.
Set of Instances  FIHRMSS  FIHRMSR  

Objective Function  Time (seconds)  Objective Function  Time (seconds)  
1  709,701.78  2,253.70  786,091.00  1,401.60 
2  23.67  601.01  23.67  600.85 
3  23.67  600.91  23.67  600.75 
4  2,320,791.67  1,421.55  2,420,923.36  885.80 
5  4,698,305.67  2,011.11  4,476,281.86  1,800.59 
6  11,344,844.55  3,601.14  12,335,577.83  1,600.43 
7  21,993,070.67  2,600.92  22,145,036.98  1,400.68 
8  35,486,463.11  3,000.66  36,288,029.67  1,200.41 
9  6,665,317.33  1,640.48  4,741,822.50  1,223.19 
10  2,458,900.39  2,800.87  2,586,598.34  1,783.41 
11  16,638,709.45  3,572.59  17,247,266.67  1,200.37 
12  694,423.67  2,452.33  786,091.00  1,354.07 
13  786,088.00  1,482.90  413,746.08  2,276.82 
14  25.00  266.60  25.00  264.22 
Average  7,414,049.21  2,021.91  7,444,824.12  1,256.66 
Source: The authors.
The CPLEX takes time to prove the optimality of the solutions obtained by it for the RM. Thus, for each iteration of the FIHRMSS and FIHRMSR heuristics, the time limit for the RM resolution is only 300 seconds, therefore it can be observed that the heuristics can present solutions, for most instances, before reaching the time limit.
In Table 2, the shortest mean time between the two proposed strategies is highlighted in bold. Except for the instances of set 13, where the FIHRMSS was faster than the FIHRMSR, and for the sets the instances of sets 02, 03 and 14, in which the heuristics practically tied, the random strategy proved to be faster than the step strategy.
Table 2 also shows that for the sets of instances 02, 03 and 14, the mean value of the objective function was the same for both strategies. As already mentioned, these instances are easy to resolve because they have a leeway capacity, since in instances 02 and 03, filling rates are doubled and tripled, and in instance 04 a super tank is considered, with double capacity of the available tanks and the filling speed is twice as fast as the current fastest line speed. The set of instance 14 was created to verify the possibility of this change of machinery in the factory we visited. This was a question raised by the decision maker, and heuristics show us that for the current demand of the company, it seems to be a good decision since for the three instances (I114, I214 and I314) it was possible to meet demand without backorders and without inventories, as can be seen later in Table 3. The sets of instances 02 and 03 also show that investing in faster filling machines may be a good option to avoid inventories and backorders in the production of this company with the current demand.
Set  FIHRMSR  FIHRMSS  

%Back  %Inv  %TC  %Cap  %Back  %Inv  %TC  %Cap  
01  0.59%  0.05%  3.36%  81.69%  0.54%  0.06%  3.38%  82.47% 
02  0.00%  0.00%  0.63%  47.73%  0.00%  0.00%  0.61%  47.42% 
03  0.00%  0.00%  0.57%  43.13%  0.00%  0.00%  0.44%  43.43% 
04  1.80%  0.00%  1.96%  89.18%  1.46%  0.01%  2.10%  89.67% 
05  3.97%  3.16%  4.10%  92.97%  3.24%  0.28%  3.73%  91.65% 
06  8.55%  8.12%  3.62%  88.23%  7.49%  1.16%  4.07%  96.88% 
07  3.09%  6.22%  3.25%  99.00%  14.66%  1.61%  3.73%  99.78% 
08  27.42%  4.57%  3.87%  99.01%  25.41%  5.25%  4.97%  99.78% 
09  5.09%  1.71%  4.37%  94.10%  3.21%  1.24%  3.78%  94.63% 
10  2.04%  0.25%  3.95%  92.06%  1.57%  0.37%  3.90%  92.73% 
11  12.27%  15.09%  3.09%  92.45%  11.49%  15.02%  3.91%  93.52% 
12  0.58%  0.05%  3.34%  81.75%  0.58%  0.01%  3.51%  82.52% 
13  0.64%  0.05%  3.12%  81.80%  0.35%  0.00%  3.19%  81.69% 
14  0.00%  0.00%  3.33%  80.01%  0.00%  0.00%  3.33%  79.83% 
Med  6.54%  2.80%  3.04%  83.08%  5.00%  1.79%  3.19%  84.00% 
%Back: average percentages of backorder demand. %Inv: average percentages of backorder stored. %TC: average percentages of the capacity available used in each instance for the temporal cleanings. %Cap columns are the average percentages of the capacity available used in each instance for the whole production process (production, changeover and temporal cleanings). Source: The authors.
The FIHRMSS heuristic obtains better solutions than the FIHRMSR heuristic for the following sets of instances: 01, 04, 06, 07, 08, 10, 11 and 12, that is, for 8 of the 14 sets. Figure 3 shows the percentage of improvement of the objective function of the FIHRMSS heuristic when compared to the FIHRMSR heuristic. This improvement is calculated based on the means of each set presented in Table 2. The improvement percent was calculated by formula
The explanation for these differences is that in the improvement phase, where
Table 3 shows some details of the solutions obtained for the 14 sets of instances. The columns called %Back and %Inv are the average percentages of backorder demand and are stored, respectively, for the instances of each set of solutions presented by each of the three solution strategies. The %TC and %Cap columns are the average percentages of the capacity available in each instance for the temporal cleanings and for the whole production process (production, changeover and temporal cleanings), respectively.
According to Table 3, the temporary cleanings consume on average 3% of the available capacity. For the instances of set 01, although the solutions show capacity utilization around 82%, on average, the backorders are around 0.6% of the demand. This behavior is due to instance I301, which has a much higher demand when compared to I101 and I201. With the decrease of the capacities in the instances of sets 05, 06 and 07, an increase in the capacity utilization can be observed, using almost 100% for the solutions obtained with the heuristics. For the instances in sets 06 and 07, in particular, the heuristics present, on average, 8.47% of the backorder demand. The same backorder increase can be seen for the instances in sets 08, 09, 10 and 11, which also restrict the capacity.
When the physical capacity of the preparatory tanks is reduced by 25% for the instances in set 12, there is practically no effect on the solution, which considers the tank completely. As the model scales the lots taking into account the two stages, this shows a bottleneck tendency for the filling machines in the data collected in the company. The same observation is valid for when the size of the tanks is doubled for the instances in set 13.
Both heuristics always find feasible solutions for the tested instances in a time less than the available 3,600 seconds, the FIHRMSS presents solutions in 2,021.91 seconds on average and the FIHRMSR in 1,256.66 seconds on average. In practice, the decision maker takes more than 3 hours to manually obtain a feasible solution. Thus, these heuristics show promising strategies for solving the fruitbased beverage production scheduling problem.
5 Conclusions
In this paper, the fruitbased beverage production scheduling problem was studied and a heuristic approach was presented to deal with it. Fruitbased beverage production scheduling involves a number of constraints that make it a complex task to be performed manually and efficiently, such as limiting the capacity of the preparatory tanks and filling lines, scheduling items to be produced, synchrony between the stages and also the consideration of temporal cleaning. In this study, it was considered that the changeover times at the two production stages may be sequence dependent, unlike previous studies in the literature. In order to test the proposed solution methods, data from a typical company in the industry were collected and several scenarios were created based on the data collected. Considering the obtained results, it can be concluded that the proposed heuristics are potentially good for systematization and support decision making in fruitbased beverage production scheduling. The heuristics are able to present good solutions in almost half the time that the decisionmaker takes to obtain a feasible solution. As shown in the computational tests, this allows the decision maker to test various scenarios and situations.
As a proposal for future research in the FIHRMS heuristics, other methods of modifying the
In addition, it would be interesting to create a friendly interface for the heuristic proposed in this paper, so that the decision makers of such factories could use and analyze the proposed heuristics in practice. Having the application of the heuristic in practice, a more detailed and indepth case study of the application of this solution proposal could be carried out.