Ant Colony Optimization algorithm for determining the shortest routes to reduce distribution costs

Distribution is an important activity that companies need to pay attention to. Improper planning for distribution activities can potentially waste both cost and time. Determining the shortest distribution route could help companies effectively reduce distribution costs. This research was conducted on a small and medium enterprise (SME) located in Rangkasbitung, Indonesia that sells various types of bread. Distribution activities carried out by Jaya Roti were found to be still conventional, while the distribution carried out to the city of Serang has many locations and complex route combinations. This research utilized the metaheuristic method of Ant Colony Optimization (ACO) with MATLAB software to determine the shortest route, which is included in the Travel Salesman Problem (TSP). The result of the shortest route determination was a total distance of 93,484 Km with an efficiency rate of 26.97% and a resulting cost of IDR 170,795.


Introduction
Small and Medium Enterprises (SMEs) in Indonesia have suffered from the COVID-19 pandemic, resulting in a decrease in their revenue margins. The weakening economic conditions during the pandemic have also affected the income development of SMEs. In such a devastated economic situation, businesses must make prudent decisions. One such decision is to make all existing activities more effective and efficient.
Distribution is the process of delivering products from manufacturing companies or manufacturers to consumers [1]. The speed, cost, and benefit of vehicle transportation are affected by the path to a certain extent [2]. Therefore, planning the optimal distribution path scientifically and reasonably, according to the actual distribution requirements and the characteristics of the goods, can not only increase the distribution speed but also reduce the distribution cost. This can strive for greater economic benefits for the distribution process, and vice versa [3].
With the development of optimization techniques, it is necessary to find the optimal distribution route according to the needs of the demand points, delivery cost, and delivery time. This forms a multi-objective optimization problem [4,5]. The determination of the shortest route to minimize the cost of distribution can be categorized as a Traveling Salesman Problem (TSP) [3,6].
TSP is a combinatorial problem in which a salesman must visit a number of cities, with the constraint that each city can only be visited once, and the salesman must choose the route so that the total distance traveled is minimized [7,8]. However, to date, there is no exact method that can find the optimal solution to this problem. Combinatorial optimization problems arise in many disciplines, including the basic sciences and applied fields such as engineering, economics, and social sciences [5,[9][10][11][12].
One of the most popular combinatorial optimization methods is Ant Colony Optimization (ACO) metaheuristic [13]. ACO is an optimization problemsolving algorithm inspired by the behavior of ants when traveling from nest to food source, and it is one of the metaheuristic approaches that can be used to solve TSP problems [6,14]. ACO has a much better performance than other algorithms in determining the shortest route, as it can produce optimal results with a small number of iterations based on the principle of approach. Its most significant feature is positive feedback that benefits Available online at: http://jurnal.untirta.ac.id/index.php/jiss

Industrial Engineering Advance Research & Application
from the pheromone left by ants, which can guide the solution construction process [6]. ACO has been used to solve NP-hard problems such as the Traveling Salesman Problem.
This research aims to determine the shortest route for Jaya Roti's distribution activities using Ant Colony Optimization, to obtain the order of distribution locations and find out the total distribution costs that can be minimized through the total distance produced by the shortest route. The benefits of this research are expected to be applied in Jaya Roti's distribution activities to produce effective and efficient distribution and save distribution costs. Jaya Roti is an SME focused on producing bread, and its demand has decreased up to 5,000 breads due to the pandemic. The company considers the carrying capacity and distribution location but ignores whether the mileage of the resulting route is minimal or not, resulting in less optimal routes and higher distribution costs. One of Jaya Roti's deliveries is made to Serang City and Regency, which has a complex combination of routes with 46 retail locations at varying distances. Improper location determination can lead to wasted distance and large distribution costs that should be minimized under current conditions. Based on the conditions outlined above, the determination of the shortest route carried out can help Jaya Roti to cut the necessary distribution costs so that Jaya Roti can make cost savings.

Optimization
Optimization is an effort to obtain the best results with the given conditions [5]. The main goal of optimization is to achieve maximum profit with minimal effort. Optimization becomes an important part of problem-solving in creating a system since it can minimize delivery or distribution while maximizing profits, minimizing processing time, and achieving other objectives. In troubleshooting with optimization techniques, there are three requirements: the ability to create mathematical models of the problems faced, knowledge of optimization techniques, and knowledge of computer programming [2].

Traveling Salesman Problem (TSP)
The Traveling Salesman Problem (TSP) is a common problem in combinatorial optimization, where a salesman must visit N number of cities, ensuring that each city is visited only once. Therefore, the salesman must choose a route that results in minimum mileage. This problem can be mathematically formulated as follows [2]: − + ≤ − 1, ≠ , = 2, … , , = 2, … , where is the distance between city i to city j and = 1 of there is a salesman's journey from city i to city j, 0 otherwise.

Graph theory
A G-directional graph is a set pair (V, E), where V is an infinite set of vertices with an infinite number of elements, and E is a set of dot pairs in V × V, which can be empty. Graphs are tools used to represent discrete objects as well as the relationships between them. TSP cases are typically represented by a weighted graph type. Figure 1 shows a graph G = (V, E) with a set of vertices V = {A, B, C, D, E, F} and a weight value assigned to each edge in E.
The shortest path is defined as the path with the minimum length from the starting point to the end point [4]. The determination of the shortest route is a problem that is a part of determining optimal solutions in TSP. TSP conditions typically use weighted graphs to solve the problem because the distance between the traveled cities is represented as a graph with weights assigned to its edges.

Ant Colony Optimization (ACO)
Ant colony optimization (ACO) belongs to the swarm intelligence group, which is a type of paradigm development used to solve optimization problems by drawing inspiration from the behavior of groups or swarms of insects [14,17]. Similar to the way ants search for food, this algorithm mimics the behavior of ants in determining the shortest path or route for carrying food back to the nest by leaving pheromone trails as markers for other ants. Pheromones left as trail marks become signals for other ants, and the shortest path will have a more concentrated pheromone, attracting more ants to pass through it. This happens because pheromones passed by many ants will evaporate slower than others.
After initialization, each ant fills the first element of the taboo list with the index of a specific city. Then, the status transition rules are carried out as a step in preparing the route for each ant's visit to each city. The random proportional rule for transition rules can be seen in the Eqs. (6)-(7).
where is the number of pheromones found on the edge between point r and point s, is the parameter that control the relative weight of pheromone, β is the distance control parameters ( , > 0), is the set of points that the k ants will visit which are at the r point.
After spreading out to each city, the ants will travel from the first city of each ant as the hometown to other cities as destination cities. In the second city, the ants will continue on to the next city but choose a city that is not on the taboo list as the next destination. This continues until all cities have been visited or the ants have returned to their hometown. Therefore, in Eqs. (6)-(7) above, we can choose a shorter edge even if it has a large amount of pheromone to determine the destination city.
After each ant has completed its task, the pheromone is renewed. The rules for global pheromone update can be seen in Eq. (8).
where ∆ = 1 if r, s is in tour done by ants and 0 otherwise, is the number of pheromones found on the edge between point r and point s, is the length of the tour traveled by ants k, (0 < ≤ 1) is the parameter of pheromone evaporation rate, and m is the number of ants.
ρ becomes a parameter for the rate of pheromone evaporation, where a decrease in the number of pheromones during the exploration stage provides the possibility of different trajectories or routes. This can also limit the possibility of choosing a less precise trajectory. Therefore, each ant is given a taboo list that can store the points it has already visited, so that it cannot revisit these points before completing the tour. When a tour is completed, the taboo list can also be used to calculate the solution found by the ants.  Jaya Roti incurs a total shipping cost of IDR 1,827/km per kilometer. This cost includes fuel costs of IDR 510/km, vehicle maintenance costs of IDR 62/km, depreciation costs of IDR 317/km, and driver's salary costs of IDR 938/km. If Jaya Roti makes a delivery to Serang regency and Serang city, based on the route carried out by the driver or employees of Jaya Roti, the total distance covered is 128 km. The total cost incurred for one delivery would be IDR 233,856.

Determination of the number of vehicles
To facilitate an efficient and effective delivery process, a certain number of vehicles are required to meet the demand needs. Once the vehicle requirements for delivering bread to Serang city and Serang regency have been calculated, one car is needed to carry 3,310 breads. The delivery requests are made once a week for the entire month, and each vehicle can accommodate up to 55 cans of bread. Each can contain 70 breads. Figure 3 displays the pseudocode used to perform ACO calculations in MATLAB for obtaining the results of the proposed shipping routes in this study. The optimal running result is the answer to the calculation of the shortest route determination using the ACO algorithm. The iteration is conducted 2,000 times along with some pre-set parameters [19]. Table A2 (see  Appendices) shows the results obtained using MATLAB.

Ant Colony Optimization Algorithm
Based on the results of the conducted experiment and calculations, the total distance covered by the existing process is 128 km, while the best ACO results cover 93.48 km. The difference in total distance covered is 34.52 km, with an efficiency rate of 26.97%. This difference is because the existing process still relies on conventional methods or employee instincts to determine the next location, resulting in suboptimal distance coverage.
With ACO, the process of determining the location is considered in detail, influenced by the probability obtained through the parameters set in each experiment. Wang and Yang's research [20] suggests that the usual standard combination to produce optimal results is = 1 and β = 5. According to this research, experiment 5 produces the most optimal results. However, in this case, ACO with = 0.1 and β = 5 produces the best route based on nine existing experiments. Experiment 3 requires more iterations than any other experiment, at 1,444 iterations. Experiment 9 only requires 139 iterations. These results illustrate that the effect of pheromone renewal when = 1 and β = 5, which provides additional pheromone to each point passed, is significant enough to increase interest in subsequent iterations. With an increasing value of pheromone in the i-j section, it is more likely that this section will be selected again in the next iteration. This makes experiment 9 require fewer iterations because the accumulated pheromone is significant enough that the ants' interest in finding the optimal route combination is faster.
However, in experiment 3, the parameters used were = 0.1 and β = 5. The resulting increase in pheromone was not significant enough to cause ants to explore the combination of routes thoroughly. As a result, the level of interest in the edges or points did not decrease significantly. This led to a high number of required iterations, reaching 1,444 iterations, which is far higher than the other nine trials. The set evaporation level is also instrumental because it allows the potential points that ants did not initially pass through to be selected. The evaporation of pheromone is not significant enough to make the points that the ants did not pass through lose enough pheromone. Therefore, some possible parameters can still produce a more optimal distance. The determination of the parameters above may not apply to certain conditions because it depends on the magnitude of the conditions and problems that need to be resolved. Wang's study also showed that the ACO algorithm could find a shorter path, and the simulation showed faster convergence speed [20].

Distribution cost calculation
To find out if ACO results are better than existing conditions, a comparison is required through cost and distance aspects. Table A3 (see Appedices) is a comparison of the route and cost of the best ACO results and existing conditions. Jaya Roti incurred distribution costs of IDR 233,856 using existing routes, covering a total distance of 128 Km. However, the best ACO result from experiment 3 resulted in a distribution cost of IDR 170,795, covering a total distance of 94.48 Km. Although the ACO result obtained a distribution cost that is more than the minimum distribution cost obtained by using the existing route, the efficiency level obtained was 36.92%, with a minimum cost of IDR 63,061 per shipment. The increasing distance will result in higher distribution costs, so it needs to be considered since the suboptimal route will affect the cost of distribution produced.

Conclusions
The total shortest route distance obtained by using ant colony optimization (ACO) was 93.48 Km, resulting in an efficiency rate of 26.97% and a cost of IDR 170,795 for one delivery. The minimum cost for one delivery was IDR 63,061.
The Hartono: Data curation and Reviewing.

Acknowledgement
The author's award is conveyed to the owner Jaya roti, who has helped during the collection of data and directions while in the field. Hopefully this scientific work is useful for companies in optimizing activities in the middle of the pandemic.

Disclosure statement
The author declares that we have no relevant or material financial interests that relate to the research described in this paper".