**Article 1**

**Firefly Algorithm: Minimizing Cost on Single-Level Lot-Sizing Problem**

Siti Hafawati Jamaluddin\*, Nurul Azleeka Zulkipli, Norwaziah Mahmud, Nur Syuhada Muhamat Pazil.

Faculty of Computer and Mathematical Sciences

Universiti Teknologi MARA Cawangan Perlis, Kampus Arau, Malaysia.

Faculty of Computer and Mathematical Sciences

Universiti Teknologi MARA Cawangan Melaka, Kampus Jasin, Malaysia.  
<hafawati832@perlis.uitm.edu.my>, <nurulazleeka96@gmail.com>, <norwaziah@perlis.uitm.edu.my>, syuhada467@uitm.edu.my.

*Abstract*

*Nowadays, the industrial company plays a very important role to our country. However, the manufacturer industry has big issues in the production planning which called planning horizon where, the lot-sizing problem is one of the most important issues in the production planning area. In lot-sizing problem, the manufacturers are facing the problems in determining the setup cost when there is no consistency and efficiency in organizing the production plan. From the problem emerge, the minimum of production cost is determined by using firefly algorithm. From the minimum production cost obtained, the optimal setup cost on single-level lot-sizing problem is defined. In this study, the result is obtained by using MATLAB R2017a software to minimize the production cost on single-level lot-sizing problem where the minimum production cost is are for one month is $154 while, the minimum production cost for 12 months is $1760.89. From those minimum total cost obtained by using firefly algorithm, the optimal setup cost for one month is $86.83 while optimal setup cost for 12 months are $86.51, $86.81, $88.30, $95.39, $112.01, $102.92, $93.30, $85.90, $106.50, $85.77, $99.46 and $115.30 respectively. As a conclusion, firefly algorithm is applicable to use in minimizing production cost on single-level lot-sizing problem since the result obtained gives the better solution compared to the exact solution.*

*Keywords: Firefly algorithm, Single-level lot-sizing, Setup cost, Production cost*

**Introduction**

The great extent of a country is measured by the industrial development. To be the best manufacturing firm, a firm should have a good production planning that can make the planning of production and manufacturing modules in a company or industry to be on track which utilizes the resource allocation of activities of employees, materials and production capacity in order to serve different customers. The features taken into account by the model are depending on the complexity of lot-sizing problems. The production planning is very important not only in terms of operating cost but also in customer service quality because it has a strong impact for manufacturing firms.

Lot-sizing problem is one of the most important issues in the production planning area. According to Karimi et al. (2003), decision in lot-sizing are important for a manufacturing firm to win the competition between other manufacturing firms and the decision affect directly the production system performance and productivity. However, most of the researchers did not taking into account the time-varying production conditions that may change timely in some industrial applications, but only the problem in a steady environment is considered (Zhang et al., 2015).

The lot-sizing are divided into two types in terms of the number of the level in product structure which are multi-level lot-sizing problem and single-level lot-sizing problem. In Single-Level Lot-Sizing (SLLS) problem, the end product by raw materials is changed after processed by a single-level operation. However, in Multi-Level Lot-Sizing (MLLS) problem, the final product by raw materials is changed after several operations with predefined product structures. Multi-Level Lot-Sizing (MLLS) problem is accessible as an extension of the big bucket single-level capacitated lot-sizing problem where the big bucket problems allow producing many times at the same time period without taking into account sequencing issues (Toledo et al., 2011). Between these two levels, Multi-Level Lot-Sizing (MLLS) is more difficult to control because the manufacturer needs to control many operations at the same time to get the end products. Single-Level Lot-Sizing (SLLS) which consist of a single production process, or where all production can be considered as a single operation, such as some medical or chemical industries where the applicability of Single-Level Lot-Sizing (SLLS) arises commonly in operation.

In this paper, the production cost of Single-Level Lot-Sizing (SLLS) problems will be optimized by finding the optimal setup cost using firefly algorithm since in classical Capacitated Lot-Sizing Problems (CLSP), the assumption where demand is deterministic and the backlog cost is greater than every other cost such as unit stock holding cost, unit production cost and setup cost. With these assumptions, the solution with no backlog quantities is optimized (Li et al., 2015).

**Lot-Sizing Problem**

Lot-sizing problem has received major amount of attention of the researchers all over the world, particularly after introduction of Wagner Whitin algorithm for uncapacitated lot-sizing problem in last five years (Verma et al., 2010). An important subprfoblem of material resource planning is lot-sizing where over a planning horizon of multiple periods, a decision maker has to decide the production costs over the planning period (Ziebuhr et al., 2015).

Lot-sizing decisions give rise to the problem of identifying when and how much of a production should be set to produce such that the total cost, including setup cost and inventory cost, is minimized (Zhang et al., 2015). Lot-sizing also deals with the production planning and control of a single product involving combined manufacturing and remanufacturing operations (Zouadi et al., 2015). Both new and manufactured products can satisfy the demand for items. The rising number of environmentally conscious countries and consumers, legislations in many countries imposed stringent measures to protect the environment. This allows technology advancement in processes such as recycling, refurbishing, remanufacturing, and repairing which gave rise to new business terms: reverse logistics and green supply chain (Zouadi et al., 2015).

Zhang et al. (2015) have been applied the Time-Varying Single-Level Lot-Sizing (TV-SLLS) problem and analyzed the properties of the model and describe it as dynamic programming and did the optimization. The researchers introduced a time-dependent setup cost and made the TV-SLLS. In the primary single-level lot-sizing model, the variables only include inventory cost and setup cost. So it is easy to build a dynamic recursive model. To solve the SLLS problem within polynomial time, Wittrick-Williams (WW) algorithm, which is a kind of Dynamic Programming (DP) method, is considered. In order to solve the TV-SLLS problem, the researchers proposed improved WW algorithm. By computational experiments, the researchers evaluate the solution approach and optimality. For the optimal program in period, setup cost has a linear positive correlation with time interval between the last arranged production periods.

**Firefly Algorithm**

Firefly Algorithm (FA) is a bio-inspired algorithm simulating the flashing behaviour of fireflies (Qi et al., 2017). FA developed and proposed by She Yang, the behaviour of flashing of fireflies is simulated. FA consists of two elements, namely brightness and attractiveness. The attractiveness of a firefly is determined by its brightness (Li et al., 2017). The important factor in attracting insects and hunting them where from the stronger fireflies by showing more ability to illuminate (Mohammadiyan et al., 2017).

All the fireflies are unisex where the attractive of fireflies is related to the brightness. The less bright firefly always flies toward the brighter one for any two fireflies (Qi et al., 2017). This insect through a chemical reaction in their bodies area able to produce, appealing light and emit dazzling which causes the escape of invading insects, the attraction of the species of the same type for reproduction and the attraction of the prey (Mohammadiyan et al., 2017). The search pattern of FA is motivated by the behavior of flashing mating fireflies where FA is competitive to other similar swarm intelligence algorithms when some latest researches are demonstrated.

The overview of FA can be described in flowchart (Figure 1) below.

![](89-1-178-1-4-20180829_media/media/image1.png)

Figure 1: Flowchart of Firefly Algorithm

(Source: Wong et al., 2014)

FA has been widely used in resources research where it is an innovative swam intelligence algorithm since firefly algorithm has the multiple promising areas can be searched in parallel and has the property to be divided into multiple groups in the search process of the best solution set. FA is expected to be able to search efficiency by exploiting the properties it possessed for Superior Solution Set (Wang et al., 2017).

Other than that, FA has a good performance on optimization the problem where FA does not demand a good initial position to ensure convergence unlike some iterative numerical techniques such as the Gauss-Newton method. Moreover, FA is simple and easy to implement yet less required parameters (Li et al., 2017).

**Mathematical Description of Firefly Algorithm**

The firefly needs to advance towards the fireflies emit. The light intensity of the flashing firefly decreases as the distance from source *r* decreases where *I* is inversely proportional to the square of the distance:

(1)

where, *r* is distance and is the light intensity emitted by the firefly *i* at the source point (r = 0). is the space distance between firefly *i* and *j*. The brightness changes with the objective function value, it can be described as follows:

(2)

where, while *r **= ***0, it is related to the value of the objective function, a larger value means better brightness. is a fixed light intensity absorption coefficient.

The attractiveness is defined as:

(3)

where, is brightness while the distance between two fireflies is zero.

Let say the firefly *i* is in the point and the firefly *j* located in the point .

The distance between these two fireflies *i* and *j* is represented based on the Euclidian distance as in equation (4) below:

(4)

where, is the *k*-element of the *i*-th firefly position within the search-space, and *d* is the number of the space coordinates of each firefly.

If the firefly in the point *j* is brighter than the firefly located in point *i,* the firefly *i* will fly towards the firefly *j*. The equation that firefly *i* moves to *j* can be expressed as:

(5)

where, is the randomization parameter, and are the two different fireflies and , and *rand* is a random number within \[0,1\] drawn from a Gaussian distribution. In this study, the typical value used are as follows: =1, and = 0.8 (Naidu et al., 2013).

**Research Model**

The objective function in this study is to minimize the sum of setup and inventory-holding cost over the entire planning horizon, denoted by Total Cost (TC) that was proposed by **Zhang et al. (2015).**

> (6)
> 
> where,
> 
> : index of periods, t=1,2,…,n
> 
> : unit inventory-holding cost in period t
> 
> : setup cost in period t
> 
> : inventory quantity at the end of period t
> 
> : a binary variable that assumes value 1 if the product is produced in period t and 0, otherwise.

The production at the first month must be arranged as out of stock is not allowed in the model. Therefore the value of is set as 1.

**Results and Discussions**

**To accomplish the minimum cost, this study used secondary data which is obtained from Zhang et al. (2015) which consist of demand in period t, , inventory holding cost in period t, , and setup cost in period t, , for entire 12 months. Table 1 lists an example of 12 periods of Single-Level Lot-Sizing (SLLS) Problem obtained from Zhang et al. (2015).**

Table 1: Data of Example

| **Month**   |          |           |       |
| ----------- | -------- | --------- | ----- |
| **1**       | **69**   | **85**    | **1** |
| **2**       | **29**   | **102**   | **1** |
| **3**       | **36**   | **102**   | **1** |
| **4**       | **61**   | **101**   | **1** |
| **5**       | **61**   | **98**    | **1** |
| **6**       | **26**   | **114**   | **1** |
| **7**       | **34**   | **105**   | **1** |
| **8**       | **67**   | **86**    | **1** |
| **9**       | **45**   | **119**   | **1** |
| **10**      | **67**   | **110**   | **1** |
| **11**      | **79**   | **98**    | **1** |
| **12**      | **56**   | **114**   | **1** |
| **Average** | **52.5** | **102.8** | **1** |

Source: Zhang et al. (2015)

## *Minimum Production Cost*

**The minimum cost on Single-Level Lot-Sizing Problem for one month is $154 meanwhile the minimum cost of Single-Level Lot-Sizing Problem for 12 months is $1760.89.**

The results obtained have compared with the exact solution from (**Zhang et al., 2015**) to determine whether FA is suitable to use in solving SLLS problem. **Both values for one month and 12 months of total cost from the real data and firefly algorithm can be expressed as in Table 2 below.**

> **Table 2: Minimum Cost of Exact Solution and FA**

|                    | **Total Cost ($)** |               |
| ------------------ | ------------------ | ------------- |
|                    | **One Month**      | **12 Months** |
| **Exact Solution** | **155.3**          | **1864**      |
| **FA**             | **154**            | **1760.89**   |

**From the Table 2 above, the comparison between the exact solution of real data and FA shows that FA technique have a better minimum total cost on Single-Level Lot-Sizing (SLLS) problem. For that reason, FA technique is applicable to use in minimizing total cost on Single-Level Lot-Sizing (SLLS) problem.**

## *Optimal Setup Cost*

**The optimal setup cost for one month is $86.83. Meanwhile, the optimal setup cost for 12 months is described as in Table 3 with the minimum cost of $1760.89.**

Table 3: Optimal Setup Cost

| **Month (t)** | **Setup Cost ($)** | **Month (t)** | **Setup Cost ($)** |
| ------------- | ------------------ | ------------- | ------------------ |
| **1**         | **86.51**          | **7**         | **93.30**          |
| **2**         | **86.81**          | **8**         | **85.90**          |
| **3**         | **88.30**          | **9**         | **106.50**         |
| **4**         | **95.39**          | **10**        | **85.77**          |
| **5**         | **112.01**         | **11**        | **99.46**          |
| **6**         | **102.93**         | **12**        | **115.30**         |

**Conclusions**

From the result obtained in Chapter 4, it has shown that the minimum production cost on single-level lot-sizing problem by using FA technique is $154 for one month and $1760.89 for 12 months while the minimum production cost of exact solution from the real data for one month is $155.3 and the minimum production cost of exact solution from real data for 12 months is $1864. From those minimum production cost obtained by using firefly algorithm, the optimal setup cost for one month is $86.83 while optimal setup cost for 12 months are $**86.51,** $**86.81,** $**88.30,** $**95.39,** $**112.01,** $**102.92,** $**93.30,** $**85.90,** $**106.50,** $**85.77,** $**99.46 and** $**115.30 respectively.**

In conclusion, firefly algorithm is applicable to use in minimizing production cost on single-level lot-sizing problem since the result obtained gives the better solution compared to the exact solution.

**References**

Li, L., Song, S., & Wu, C. (2015). Solving a multi-level capacitated lot sizing problem with random demand via a fix-and-optimize heuristic. *2015 IEEE Congress on Evolutionary Computation, CEC 2015 - Proceedings*, (Liuxi Li), 2721–2728.

Li, L. (2017). Non-line-of-sight node localization based on firefly algorithm. *Eight International Conference on Intelligent Control and Information Processing*, 325–328.

Mohammadiyan, N. E. (2017). Enhancing the accuracy of firefly algorithm by using the reproduction mechanism. *2017 18th IEEE/ACIS International Conference on Software Engineering, Artifical Intelligence, Networking and Paralllel/Distributed Computing (SNPD).*

Naidu, K., Mokhlis, H., & Bakar, A. H. A. (2013). Application of Firefly Algorithm (FA) based optimization in load frequency control for interconnected reheat thermal power system. In *Applied Electrical Engineering and Computing Technologies (AEECT), 2013 IEEE Jordan Conference on* (pp. 1-5). IEEE.

Qi, X., Zhu, S., & Zhang, H. (2017). A hybrid firefly algorithm. *2017 IEEE 2nd Advanced Information Technology, Electronic and Automation Control Conference (IAEAC)*, 287–291.

Wong, L. A., Shareef, H., Mohamed, A., & Ibrahim, A. A. (2014). Optimal battery sizing in photovoltaic based distributed generation using enhanced opposition-based firefly algorithm for voltage rise mitigation. *The Scientific World Journal*, *2014*.

Wang, H., Tamura, K., Tsuchiya, J., & Yasuda, K. (2017). Firefly algorithm using cluster information for superior solution set search. *2017 IEEE International Conference on Systems, Man, and Cybernetics (SMC)*, 3695–3699.

Toledo, C. F. M., De Oliveira, R. R. R., & Franca, P. M. (2011). A hybrid heuristic approach to solve the multi level capacitated lot sizing problem. *2011 IEEE Congress of Evolutionary Computation, CEC 2011*, 1194–1201.

Verma, M., & Sharma, R. R. K. (2010). Solving multi-item multi-period capacitated lot sizing problem with considerations of backorders and setups. *2010 The 2nd International Conference on Computer and Automation Engineering, ICCAE 2010*, *4*, 18–22.

Zhang, J., & Dong, J. (2015). Research on single-level lot-sizing problem under the time-varying environment. *2015 IEEE International Conference on Industrial Engineering and Engineering Management (IEEM)*, (1), 489–493.

Ziebuhr, M., Buer, T., & Kopfer, H. (2015). A collaborative lot-sizing problem with production limitations. *Proceedings - 2015 IEEE Symposium Series on Computational Intelligence, SSCI 2015*, 1005–1012. Zouadi, T., Reghioui, M., EL Kadiri, K. E., & Yalaoui, A. (2015). Return multi sourcing lot-sizing problem in a hybrid manufacturing / remanufacturing system under carbon emission constraint. *2015 4th IEEE International Conference on Advanced Logistics and Transport, IEEE ICALT 2015*, 223–228.

Zouadi, T., Yalaoui, A., Reghioui, M., & El Kadiri, K. E. (2015). Lot-sizing for production planning in a recovery system with returns. *RAIRO - Operations Research*, *49*(1), 123–142.
