Solving the Travelling Salesman Problem by Using Artificial Bee Colony Algorithm

Travelling Salesman Problem (TSP) is a list of cities that must visit all cities that start and end in the same city to find the minimum cost of time or distance. The Artificial Bee Colony (ABC) algorithm was used in this study to resolve the TSP. ABC algorithms is an optimisation technique that simulates the foraging behaviour of honey bees and has been successfully applied to various practical issues. ABC algorithm has three types of bees that are used by bees, onlooker bees, and scout bees. In Bavaria from the Library of Traveling Salesman Problem, the distance from one city to another has been used to find the best solution for the shortest distance. The result shows that the best solution for the shortest distance that travellers have to travel in all the 29 cities in Bavaria is 3974km


INTRODUCTION
Irish and British mathematicians, W. R. Hamilton and Thomas Kirkman have introduced Traveling Salesman Problem (TSP). TSP is the classic algorithmic mathematical problem that focused on optimisation in the field of computer sciences and operations research to find a better solution for the problem that is the shortest, fastest and cheapest. The easiest way to convey the TSP is by describing the location as a set of nodes.
From the previous research, each author has many TSP definitions. The first definition stems from Kaspi, Zofi and Teller (2019). TSP is defined as a list of cities that a salesperson has to visit all the cities that start and end in the same city to find the minimum cost, time or distance. The travelling salesman problem is defined as containing n for cities (vertices), and m for edges between 2 vertices is weight as travelling time or distance.
Moreover, the generalised TSP covers all variants of TSP, a set of cities that includes a depot and a subset. It covers some of the customers' satisfaction and the main objective is to find the shortest total distance travelled by the salesman (Pandiri & Singh, 2019). However, the article by Khan and Maiti (2019) said that TSP is the standard combinatorial discrete optimisation problem consisting of a set of N cities (vertices). So the objective of the problem is to find the shortest path that starts and visit all the vertices once and return to the starting vertex.
There are several solutions to solve the TSP but the result is approximate and not always optimal. The TSP can use the optimisation algorithm method to solve the problem faced by the salesman experiencing the problem, where the route distance that the salesman has to use to distribute the product from the original place and visited all the cities before returning to the original place. Besides that, the salesman also has to consider the cost of travel while distributing the product. In conclusion, the salesman must find the shortest distance to travel all of the city once and back to the place of origin.
The TSP can be formulated as an integer linear program. Miller-Tuckerm-Zemlin (MTZ) and Dantzig-Fulkerson-Johnson (DFJ) have proposed the formulation for TSP. The MTZ formulation is still useful in certain settings even though the MTZ formulation is not stronger than the DFJ formulation. Hence, in this study, DFJ formulation is used. The formulation can be defined as follows: where ij x is the path from city i to city j, is the distance from city i to city j and Q is the number of edges between the nodes. Based on the above equation, the shortest distance will be determined for the traveller to travel all of the city once and back to the origin place.

RELATED WORKS
In the report by O'Neil and Hoffman (2019), TSP investigates the shortest path for pickup and delivery such as meal delivery and ride-sharing is meaningful in on-demand last-mile logistics. Using low-width decision diagrams in assignment problem assumptions duals as primal heuristics can find a good result within scrupulous time budgets.
In the expert opinions of Akhand, Ayon, Shahriyar Siddique and Adeli (2019), TSP represents by all spider monkeys wherever Swap Operator (SO) and Swap Sequence (SS) primarily based operations are utilised in separate spider monkey optimisation that allows interaction among monkeys is getting the best result of TSP. An example of SOs is a global leader, local leader or randomly chosen from the spider monkey group that conveyance regarding the exploitation of the involvement of other members. The result of the experiment exposes the effectiveness of discrete optimisation of spider monkey for solving TSP.
Based on a basic genetic algorithm, combining crossover and dynamic mutation is an improved strategy that has been proposed to optimise mutation characters and gain population diversity. The advanced algorithm's convergence rate and best solution show that it is superior to the standard, prepared selection and adaptive crossover probability of genetic algorithm and a new method for TSP are provided (Xu, Pei & Zhu, 2018).
Based on the random method, to overcome the optimized locations of the exit door for a safer emergency evacuation, the ABC algorithm was proposed by Khamis et al. (2019). As a result, ABC has fewer control parameters to be tuned to find the foremost optimal locations of the exit door. In representing the group of dynamics, it used a crowd evacuation model supported by the Social Force Model (SFM) and became the premise for the optimizer of cost functions. By minimizing crowd evacuation times and increasing the number of individuals being evacuated, the optimum locations of exit doors for a multi-room situation can improve evacuation potency. It is additionally clearly incontestable that the optimized design style is impressive in rising the evacuation efficiency underneath the various desired speeds of the group to evacuate.

ARTIFICIAL BEE COLONY ALGORITHM
Based on the research done by Zuloaga and Moser (2017), Artificial Bee Colony (ABC) algorithm is one of the groups of "swarm intelligence" which refers to the collective behaviour of the decentralised and self-organised system, commonly composed of agents that follow uncomplicated rules where the communications lead to the evolution of intelligent behaviours.
In 2005, based on the honey bee swarm's intelligent foraging behaviour, Dervis Karaboğa introduced the ABC algorithm. As claimed by Mridula, Rahman and Ameer (2018), the colony of bees is divided into three types with different method that approaches the food: the employed bees, onlooker bees and scout bees. Employed bees have visited food beforehand and moved the honey bees to the source of food while onlooker bees are waiting at the area to decide the food source and scout bees move arbitrarily inside the chosen area.
All employed bees produced the initial sources of food. The steps have to be repeated until they meet all the requirements. In the first step, employed bees must find and determine the closest food source in their memory. After that, the food source has to evaluate because the employed bees should dance in the hive to tell the onlooker bees about the food source. Then, depending on the dance by employed bees, onlooker bees will choose one of their sources. The bees evaluated its nectar amount after choosing a neighbour around that. They are determined and replace the sources of food with the new sources of food discovered by scout bees. The best sources of food are found (Guo, Li, Tang & Li, 2017).
Food sources, employed bees and unemployed bees are the parts of bee honey's destructive behaviour and the behaviour patterns are unification and abandonment of source of food (Lvshan, Dongzhi & Weiyu, 2017). The distance between the honeycomb and the sources of food, the element of honey and the complication of takeout honey are the factors that affect the value of the food source. Each employed bee has a one-to-one concurrence with its matching food source where it can share information obtained with other bees. Scrutinising and utilising the food source is the main task for unemployed bees. After deciding whether to recruit or give up, detecting bees must analyse the new food source.
The four phases of the ABC algorithm are illustrated in Figure 1. Based on Figure 1, there are four phases in the standard ABC algorithm. The phases are the initialisation of the parameters and population phase, employed bees phase, onlooker bees phase and scout bees phase.
All the flow will repeat until all requirements are met. The elaboration of these phases for ABC is described below: x

Initialisation of The Parameters and Population
and parameters of ABC Algorithm are set as the colony size equal to 6, dimension of the problem equal to 2 and limit for scout is colony size multiple with dimension and divided into 2 which is equal to 6. Then, initialise the position of 3 food source SN/2 of employed bees randomly using uniform distribution in range (-5, 5). Then, the solution is calculated by the following equation:

Employed Bee Phase
In this phase, the employed bees will search for food sources throughout the whole space. Every source of food, i x is allocated to one and only employed bee and a new food source, i x' is generated for each employed bee in the neighbourhood of the food sources i x and k x its present position as follows: x , which is ( ) ' 1 x f = 11.2610 and fitness value is 0.0816. Then apply greedy selection to compare the value of fitness previous and new one. Since 0.0816<0.1045, the solution for the first food source could not be improved. Increase its trial counter. Apply the calculation for a second and third food source. The new values of f(x) are 8.5678, 2.2820 and 1.0714 and the fitness values for 3 food sources are 0.1045, 0.3047 and 0.4828.

Onlooker Bee Phase
Onlooker bees will evaluate the information of food sourced from employed bees and choose a source of food, i x based on its probability value i P as calculated in Eq (8)

Scout Bee Phase
The number of scout bees is not defined beforehand in the colony. If the source of food, i x cannot be improved through a predetermined number of trial "limit", the source of food, i x is to be abandoned and the corresponding employed bee becomes a scout. A new source of food, i x produced by the scout randomly as follows: where i is the index of the employed bees whose "trail" values reach the "limit" value firstly, The phase from 3.2 to 3.4 will repeat until the termination criterion is satisfied.

RESULTS AND DISCUSSION
To solve the TSP, the secondary data is used to implement. The data is adopted from the Library of Traveling Salesman Problem (TSPLIB) from Zuse Institute Berlin. The data set consists of 29 cities in Bavaria with a distance from one city to another city as shown in Table 1 and Table 2. In Table 1 below, X is the node of cities for the x-axis and Y is the node for the y-axis. Based on the node value in Table 1, the distance between these two nodes for 29 cities is obtained as in Table 2.  The ABC algorithm is used to get the optimum route for 29 cities with the shortest distance. Table 3 below shows the optimum route of 29 cities with a distance of 3974km. Based on the table below, the optimum route will start with city 1, then city 8,city 4,17,18,9,3,5,12,26,29,28,25,14,22,20,15,10,6,2,13,21,27,7,23,16,26,19,11 and end with city 1 back.

CONCLUSION
The Artificial Bee Colony (ABC) algorithm is a technique of optimisation that simulates honey bees' foraging behaviour and has been successfully applied to various practical issues. A set of honey bees can perform tasks successfully through social cooperation called a swarm. In the ABC algorithm, there are three types of bees: employed bees, onlooker bees, and scout bees. The employed bees will search for food around the sources of food in the memory and all the collected information will be shared with the onlooker bees. The onlooker bees tend to select the good food sources found by the employed bees. The food sources with higher quality and the best fitness value will have more chance for the onlooker bees to select the good source of food than the lower quality. The scout bees are translated from a few employed bees, which abandon their food sources and search for new ones.
In this study, the ABC algorithm has been used to solve the Travelling Salesman Problem (TSP) for the data collected from Library of Traveling Salesman Problem (TSPLIB) from Zuse Institute Berlin. The data set consists of 29 cities in Bavaria with nodes for every city and a distance from one city to another city. MATLAB software version R2015a is used to solve the TSP Traveller has to visit all 29 cities and return to the first city, City 1. The result shows that the best solution for the shortest distance travellers has to travel in all 29 cities is 3974km.