Application of the Firefly Algorithm for Optimal Production and Demand Forecasting at Selected Industrial Plant

Many production companies continue to face financial difficulties. The main purpose of this paper is to present an effective method for these companies to maximize profits and minimize production costs. The problem presented here is initially developed as a linear programming model. To achieve the best results, the firefly algorithm (FA) is applied to solve the model and obtain an optimum solution. In order to test the efficiency of the algorithm, Lindo software is used, and the results of both algorithms are compared. A sensitivity analysis is applied to determine which products a company should produce in order to maximize profits. The result reveals that the FA, when compared with Lindo, can help achieve maximum profits by producing only one product, thus minimizing production costs. For demand forecasting, the moving average technique is used to determine future customer demand. The mean squared error method is used to choose the best forecast based on the historical data collected.


Introduction
Several kinds of production optimization problems have been solved using exact techniques, such as Linear Programming (LP) (Karterakis et al., 2007), Integer Linear Programming (Tsai et al., 2008), and Mixed Integer Linear Programming (Koné et al., 2013). However, these exact optimization techniques cannot achieve an appropriate solution in a reasonable run time. In this context, a metaheuristic algorithm is applied to an optimization problem to reach an appropriate solu-tion with a high search space.
Several researchers have applied metaheuristic algorithms to solve optimization problems, including Ant Colony Optimization (Selvi & Umarani, 2010), Particle Swarm Optimization (PSO) (Shi, 2004), and Artificial Bee Colony (ABC) (Karaboga, 2005). The main goal of this paper is to present a method for optimizing production line using a metaheuristic algorithm based on the firefly algorithm (FA). One of the benefits of metaheuristic algorithms over exact optimization techniques is the capacity to discard bad optimal solutions when the model is running and use the best solutions.
According to Yang (2009Yang ( , 2010, the FA is able to solve constrained and non-constrained optimization problems and achieve the best optimal solution in a reasonable run time. A review of the existing literature reveals that this algorithm has been improved by some researchers to solve different optimization problems. As an example, Khalifehzadeh and Fakhrzad (2019) modified the FA to optimize a multi-stage network with stochastic production capacity. Xiao et al. (2016) proposed a modified FA to improve the forecasting capacity in reaching an appropriate optimal solution. Memari et al. (2019) proposed a new modified FA to optimize a supply chain problem. In this present work, the standard FA, as developed in 2008 by Yang (2009), is implemented to solve a production optimization problem.
The main objective of this research is to address the capability of a metaheuristic algorithm based on the FA to optimize the production line operation in a bottling company in order to maximize profits. In order to solve the model, Lindo software and the FA are used to test the efficiency of the latter and to compare the results of both algorithms. A case study for the bottling company was conducted to implement the model. The main objective of the bottling company is to achieve maximum profits by using appropriate limited resources.
Sensitivity analysis is a powerful technique for testing the efficiency of an optimization algorithm. This technique helps us to find more interesting results by altering the parameters of optimization algorithms in order to improve the optimal solution and determine the effect of the solution. This paper describes how this technique is applied to reach more interesting optimal solutions for the presented model.

Firefly Algorithm
The firefly algorithm (FA), developed by Yang (2010), is one of the most power-A. Altherwi Open Journal of Business and Management ful metaheuristic algorithms that can be used to solve optimization problems. This algorithm relies on the flashing behavior of fireflies according to three different characteristics, as adapted from Yang: • The gender of all fireflies is unisex.
• The flashing of all fireflies can be affected by the degree of flashing. Less bright fireflies move to those fireflies that have brighter flashing.
• The objective function can affect the brightness of fireflies based on the optimization problem (maximum or minimum optimization problems). The firefly algorithm has been applied to many industries to solve the complex optimization problems. For example, according to Zhu et al. (2018), the firefly algorithm able to minimize the number of workstations and maximize the rate of smoothing related to disassembly line problems. The firefly algorithm is also applied to solve the optimization problems related to operation of reservoirs production. It has been compared with different metaheuristic algorithms, such as genetic algorithm to get the optimal solution of operation of reservoir with irrigation supply (Garousi-Nejad et al., 2016). It also applied to solve the optimization problem related to production scheduling problems (Li & Ye, 2012) and optimize power production of hydropower (Hammid et al., 2017).
The optimization problem that is considered in this research is a maximization problem. Hence, the objective function is proportional to the brightness of fireflies (Yang, 2010). The main parameters of the FA are: light intensity (I); attractiveness ( β ); and the light absorption coefficient ( γ ). According to Yang (2010), the light intensity (I) can be determined in (1) as follows: where r is the distance between fireflies and 0 I is the light intensity at distance ( 0 r = ). According to Yang (2010), the attractiveness of fireflies is defined by (2) as follows: where 0 β is the attractiveness of a firefly at distance ( 0 r = ). If a firefly (i) has less brightness, the movement towards the brighter firefly (j) can be determined by (3) as follows (Yang, 2010): where i X is a less bright firefly and j X is a brighter one. The pseudo of the standard FA is shown in Figure 1.

Problem Statement and Mathematical Modeling
The company that features in this study produces various kinds of differently flavored soft drinks, namely: Bario (apple, strawberry, and peach flavors); Mountain Dew; Apple, Lemon, and Mango Peach Cocktail Frutz; Mirinda (orange, green apple, strawberry, and pineapple flavors); 7UP; and Pepsi. Due to insufficient resources, this company needs to determine which products should Open Journal of Business and Management consisting of objective function, constraints, and decision variables, can be drawn on to solve the problem. The soft drinks produced by this company are considered as the decision variables. The objective function is to maximize profits and determine how many products should be produced by the company to obtain an optimal solution for the maximum profit. This is determined by Equation (4) as follows: where Q is the quantity of raw material needed for each soft drink. All decision variables should be non-negative.

Results and Discussion
The main objective of this research is to determine the capability of a metaheuristic algorithm, based on the FA, to optimize production line operations so that a bottling company can maximize its profits. The model is solved using Lindo and the FA to test the efficiency of the latter and to compare the results of both algorithms. A case study of the bottling company is conducted to implement the model. The main objective of the bottling company is to identify the appropriate limited resources required to gain maximum profit. MATLAB is used to run the model using the FA. Table 1 shows the best solution and objective obtained by the FA. In addition, the model is run using Lindo. Figure 2 shows the best solution for the decision variables obtained by the FA, based on 500 iterations. The result demonstrates that the FA can be considered as a powerful tool in solving the model and gaining maximum profits when compared with the Lindo result.
The profit obtained by the FA is greater than that obtained by Lindo, which indicates that the FA is the best algorithm for solving this model. Figure 3 shows the result of the model using Lindo.
The results reveal that the FA is recommended because the company is able to gain profit from all kinds of soft drinks and should produce more Bario-Peach drink (indicated by X 3 ) to save production costs, as shown in Figure 2. The Lindo result shows that the company is able to gain profit from only two kinds of soft drinks, namely Bario-Peach (indicated by X 3 ) and Mirinda-Green (indicated by X 9 ), so the company needs to produce more of these two products.
Therefore, the FA offers the best solution when compared with Lindo, as shown in Figure 3. The objective function obtained by the firefly algorithm is 4.000000000000005e+15 while the objective function obtained by Lindo is 1,855,757, as shown in Figure 3. Therefore, the result shows that the objective function obtained by the firefly algorithm is higher, which indicates that that the firefly algorithm solution is better.

Demand Forecasting
Demand forecasting is a technique that helps many industries to estimate expected future demand from customers. Based on collected historical data, the bottling company is prepared to select the best forecasting period that results in lower production costs. In this research, the moving average technique is applied to calculate the demand forecasting for each period of 3, 5, 7, 9, and 11 days for one month. Figure 4 shows the tracking of the moving average for periods during a month, which indicates the future demand for products to meet customer satisfactions. The mean squared error (MSE) is used to identify the best demand forecasting.
The best demand forecasting is that which has the smallest MSE. Figure 5 indicates that the demand forecasting (N = 9), where N is the number of day periods, is the most appropriate.

Sensitivity Analysis
Sensitivity analysis is a powerful technique for testing the efficiency of optimization algorithms. This technique helps to identify more interesting results by altering the parameters of optimization algorithms to improve the optimal solution and determine the effect of the solution. The profit on BARIO-Apple would need to increase by $0.59 before it would be profitable to produce any BARIO-Apple crates. Similarly, the profit on BARIO-Strawberry would need to increase by $0.74 before it would be profitable to produce any BARIO-Strawberry crates.
The same considerations can be drawn for the remaining decision variables.

Conclusion
This paper introduces the ability of the firefly algorithm to obtain the best results for optimization problems (maximization or minimization). A bottling company, which produces various kinds of differently flavored soft drinks, is the focus of this study, in which the problem is developed as a linear programming model.
To test the efficiency of the firefly algorithm, the model is run using Lindo software and the results of both algorithms are compared. Using the firefly algorithm enables the company to decide whether products can still be produced according to the availability of raw materials. This research can be extended to build a model based on different factors related to the inventory control using different algorithms. It is also extended to do the comparison of the solution of each algorithm and choose the best one.

Conflicts of Interest
The author declares no conflicts of interest regarding the publication of this paper.