DESIGN OF DISTRIBUTION OPTIMIZATION APPLICATION USING FIREFLY ALGORITHM

- The goal of this research was to optimize the distribution of goods and computerize. The method consisted of problem identification, analysis, implementation, and evaluation. Firefly algorithm was used as a method for optimizing the distribution of goods. The results achieved are the shortest distribution route of goods in accordance with the existing constraints and low cost of distribution. It can be concluded that the research can beused too ptimizethe distribution of goods and to minimize distributioncost.


I. INTRODUCTION
In this modern age, the economic activities can not be separated from the distribution of goods. Distribution of goods can be supported by various modes of transport such asland transportation, water transportation, and air transportation.If the distribution of goods is not done properly, it can increase the cost of goods distribution and also the prices of goods distributed (Onwubiko, 2000;Yang, 2010) To optimize the distribution of goods, the different methods such as particle swarm optimization, genetic algorithm, orfirefly algorithm can be used. The method sused to solve problems optimization of the distribution of goods in this research is firefly. Firefly Algorithm used is the development of discrete versions by updating firefly position with the name of discrete firefly algorithm with edge-based movement (Fister et al., 2013;Jati et al., 2013;Johari et al., 2013;Sayadi et al., 2013).
Discrete firefly algorithm with edge-based movement is used to cope with the distribution of goods by determining the shortest route. The movement in this algorithm also produces better movement than the random movement. The algorithm is in the form of a desk top application to solve the problems of optimization of the goods distribution to the stores. It is expected to distribute customer good easier and produce a more optimal distribution costs. (Pan et al., 2013;Pornsing, 2014;Yesodha, 2015).

II. METHODS
The methodology of this research consists of several steps as follows. First, this step is the identification of the main issues that will be discussed on the distribution cost optimization like how tominimize the cost of goods distribution. Identifying problems is done with the distribution in Christian Store with interviews and brainstorming. From problems, researchers determine the boundary problem that will be the scope of the research. Second, it is literature review. There searchers collect some of there ferences that can help in the research. The literature study is conducted on the books, journals, the Internet and other literature. From literature, it is expected to find the theoretical basis for data processing, model-making, selection of methods and making the program so that it can solve problems of goods distribution in Christian Store. The method used is discrete firefly algorithm with edge-based movement and program with a desktop-based application with the Python programming language. Third, by creating a cost from the goods distribution that is identified and based on the literature study in the form of a mathematical model, it can represent the real system. A mathematical model is adjusted with problem in the research. The distribution cost model is as follows.
Total Cost of Distribution = min (∑(fixed cost + variable cost)) (1) Fixed cost is the cost of vehicle maintenance and salary of driver and helper. Meanwhile,variable cost is the total cost of gasoline used.
Fourth, there is data collection. The researchers collect data in accordance with the scope of the problem processed to solve the problems of goods distribution. The relevant data in this research is the number, types, and volume of the vehicles used for distribution; the name and address of the depot and store; the costs distribution of operational expenses such as gasoline, vehicles maintenance, and salary of driver and helper; the distance between the depot and each store and the distance between each store; and other data that support the research. Fifth, it is the application of discrete firefly algorithm with edge-based movement in modeling cost distribution. Once the required data is obtained, the simulation of the calculations can be done. Formulation of a mathematical model created is implemented using discretefirefly algorithm with edge-based movement (Fister et al., 2013). Sixth, the designing and making application for a desktop-based application to optimizethe distribution of goods with discrete firefly algorithm with edge-based movement uses the Python programming language.The program is designed with prototyping development methods with the conditions. The program created stores the data with a file-based approach because the data is not many and fast regarding development. Seventh, the application program is tested whether the programisbug-free andin accordance withthe objectives of the identified problems. Eighth, the evaluation program is to determine whether it produces optimal results according to the calculations made as well as to see the suitability of the program to the needs of Christian Store,and the ease of operation. If the results are optimal, it will enter the implementation phase and prepare there ports. If it is no, it will be checked again on the implementation phase of the discrete firefly algorithm with edge-based movement to find optimal results. Ninth, there search objective is achieved, the program will be implemented, and the process is complete. Then, it is followed by drafting the report. Next, it is the mathematical model. The objective function is in Equation 2. (2) The barrier function defines each customer node that visits only one time by one vehicle (Equation 3) and definesthe number of vehicles entering and exiting the same depot (Equation 4). (3) If the customer visits the vehicle, the vehicle must come out. It uses Equation 5. Then, the number of vehicles can be calculated using Equation 6.
The objective function of the model is to minimize the total cost of distribution. One of the ways is by describing the total number of distribution costs. The description of the equation is as follows.
i, j = index of customers i = 1…n j = 1…n 0 as depot k = index of the vehicles k = 1…m c ij = distance between customer i and j di = order from customer i Q k = capacity of vehicle k p k = the price of fuel from vehicle k r k = the ratio of the fuel needs of vehicle k f k = maintenance costs as well as driver and helper salaries of vehicle k Then, the decision variables are Then, the researchers can idealize some of the flashing characteristics of fireflies to develop firefly-inspired algorithms. For simplicity in describing the new firefly algorithm, the researchers use three idealized rules. First, all fireflies are unisex, so one firefly will be attracted to other fireflies regardless of their sex. Second, attractiveness is related to the brightness. Thus, the less bright firefly will move towards the brighter one. The brightness decreases as its distance increases. If there is no brighter firefly than the particular firefly, it will move randomly. Third, the brightness of a firefly is affected or determined by the landscape of the objective function. For maximizing the problem, the brightness can be in line with the value of the objective function. The brightness can also be defined in a similar way to the fitness function in genetic algorithms.
Based on these three rules, the basic steps offirefly algorithm canbe summarized as the pseudo code shown in the algorithm below. In a certain sense, there is some conceptual similarity between firefly algorithm and the Bacterial Foraging Algorithm (BFA). In BFA, the attraction among bacteria is based on their fitness and distance. Meanwhile, in firefly algorithm, the attractiveness is linked to their objective function and monotonic decay of the attractiveness with distance. However, the agents in firefly algorithm haveadjustable visibility and more versatile in attractiveness variations, which usually leads to higher mobility. Thus, the search space can be explored more efficiently (Yang, 2009).

III. RESULTS AND DISCUSSIONS
In designing this program, the researchers use four UML diagrams for defining the structure of the program. Those are use case diagram, activity diagram, class diagram, and sequence diagram. The use case diagram of the application tobe developed is shown in Figure 1.

Figure 1 Use Case diagram
An activity diagram is another important diagram in UML to describe the dynamic aspects of the system. It is a flowchart to represent the flow from one activity to another activity. The activity can be described as an operation of the system. Then, the control flow is drawn from one operation to another. This flow can be sequential, branched, or concurrent.
Activity diagram designed in this research consists of six activity diagram. Those are the home activity diagram, store activity diagram, vehicle activity diagram, product activity diagram, order activity diagram, and calculate activity diagram. Home activity diagram is the activity that occurs when userrun the application and choose the Home menu. When the user presses the Home menu, the system displays the Home page on the screen. Meanwhile, store activity diagram is an activity when the user chooses the Store menu. When the user presses the Store menu, the system shows Store page on screen. On the Store page, the user needs to enter a name and the address of depot, name, and address of customer shops, and the distance data between the shop and shop depot before pressing the Save button to store data.
Similarly, vehicle activity diagram is when the user chooses the Vehicle menu. When the user presses the Vehicle menu, the system shows the Vehicle page on the screen. On the Vehicle page, the user needs toenter the name, volume, fuel ratio (Km/L), fuel price (Rp/L), maintenance cost (Rp) per one road of the vehicle, and salary of the driver and helper per one road (Rp) before pushing Save button to save data. Then, product activity diagram when the user selects the Product menu. Pressing the Product menu, the users can see the Product page on the screen. On Product page, users need to enter the name of goods and volume of goods before pressing the Save button to save data. Meanwhile, order activity diagram is an activity when the user selects the Order menu. When the user presses the Order menu, the system will check whether there is stored data of vehicles and goods to display the Order page on the screen. On the Order page, the user needs to select the store and enters the order amount of each item. Then, the user can press OK and continue with the next store until all orders are entered. Activity calculation diagram is when the user chooses to press Calculate on the order menu. The system will display the calculation result on the screen.
Next, class diagram models the static structure of a system. It shows the relationships between classes, objects, attributes, and operations. A brief description of each classis is shown in Figure 2. Sequence diagrams describe the interactions among classes regarding an exchange of messages over time. It is also called as event diagrams. A sequence diagram is a good way to visualize and validate various runtime scenarios. It can help to predict how a system will function and to discover responsibilities a class may need to have in the process of modeling a new system. Like activity diagram, the sequence diagram designed consists of six sequence diagrams. Those arehome sequence diagram, store sequence diagram, vehicle sequence diagram, product sequence diagram, order sequence diagram, and calculate sequence diagram. The example is shown in Figure 3.   Figure 4 shows the sequence when the user runs the setupUi via User_Interface. User_Interface invokes the show_store and displays the store along with the data from the Store. Users enter data store through User_Interface followed by User_Interface run set store in Store. Users also enter a store distance through User_Interface, and User_Interface runs the distance between stores in the Store. There are also options for delete, edit, delete all, and save that can be done by the users on User_Interface.  Figure 5 shows the sequence when the user runs the setupUi via User_Interface. User_Interface shows show_vehicle and displays the vehicle along with the data from Vehicle. Users enter the vehicle data through User_ Interface. Then, it input the vehicle set on the Vehicle. There are also options for delete, edit, delete all, and save that can be done by the users on User_Interface. Figure 6 shows the sequence when the user runs setupUi through User_Interface. Then, User_Interface invokes show_List_Store and displays the order along with the data from the store. The user selects the data stored on User_Interface followed by User_Interface invokes the show_order product and displays the detailed order along with the data from the product. Last, users enter data order through User_Interface by clicking the order set on Order. The order delivers the data to the User_Interface followed by displaying the return order. Figure 7 shows the sequence when the user runs show_result to see the calculation result through User_ Interface. User_Interface invokes calculate on firefly. Then, firefly runs distance between store on store. The store will give data to firefly, followed by running firefly to get all vehicles. The vehicle delivers the data to firefly. Data that has been processed is sentfrom firefly to User_Interface, which User_Interface. It shows the result to user. There is also an option to print and save in the form of PDF that can be done by the users on User_Interface. The applications arecreatedwith fivemain menus. Home is to see the initial page containing how to use the program. Then, store is to set the store and depot data. The vehicle is to set the vehicle data and Product is to organize product data. Last, Order is for users to enter the order data which is followed by calculations on the program that generates the data distribution costs. These select routes and distances.
For the simulation, the result uses a case solved using the firefly algorithm. There are five randomly selected customers from ten customer data. Table 1 is the name of the customer and order quantities of each type of goods. Then, Table 2 is the distance from one store to another. Table 3 is the volume of goods ordered in everystore. After the data in the simulation is calculated, the cost of the vehicle and volume of goods are known. Those are shown in Table 4 and Table 5.      The total volume of the delivered goods does not exceed the capacity of the vehicle (14:34<17,3). Thus, it can be sent. If it uses a route optimization with firefly algorithm edge-based movement, it will display the results as follows. To determine the legitimate or illegitimate route, it should be seen from the volume of each store's goods and the capacity of each vehicle. The capacity of the first chosen vehicle should be smaller and so on. The volume of goods is added to the first vehicle until it can not be added anymore because it exceeds the capacity of the vehicle. Then, the goods will be added to the next vehicle.
The next example uses iteration0, and fireflyA:1>5>2>3>4. The first selected vehicle is Toyota Dyna with a capacity of 14,4m3. Then, Tk. Aulia has goods about 2,86m 3 , so it still has capacity of 11,54m 3 to Tk. Hamim. Next, it carries goods about 3,18 m 3 from Tk. Hamim to Tk. H. Endin. The available capacity is 8,36 m 3 . Then, it will carry goods about 2,44 m 3 to Tk. H. Mahmud. The available capacity is 5,92 m 3 . It brings 2,68 m 3 volume of goods too. The last is to Tk. Sinar Prianganwith 3,18 m3. Thus, the available capacity is 0,06 m 3 and it uses only Toyota Dyna.
To determine the light intensity, it uses the objective function (Equation 1 and 2). After the iteration is complete, it can be seen that the optimal route is the Christian Store> . If the case study shows that the results of manual calculations are Rp423.000,00 with assumption as Rp352.000,00 + Rp71.000,00 and the calculations with firefly algorithm are Rp366.420,00. The Christian Store can save about Rp56.580,00. The example of the calculation in the program can be seen in Figure 8.
Total Cost = f k + Average the use of gasoline on manual calculation (9)

IV. CONCLUSIONS
The processing time by using the discretefirefly algorithm with edge-based movement on vehicle routing problem solve the problem faster than with the manual process. It can be obtained by optimal route in distribution of goods.This application can help shops to solve problems in the number of customers, requests for different item seach customer, the difference in volume, the ratio of fuel, the price of fuel, maintenance of each vehicle, salaries of driver and helper, and the distance between the customer with the depot. This application can help the store to determine vehicles and routes taken as the minimum total distribution costs. Based on the theories that have been discussed and the test results in this application, some suggestions can be used to increase thefurther development of the application. It is recommended to add features in the programs, so it can enter distance data more easily, display the estimated travel time and the route in detail, and use maps.