Fast Heuristic Algorithm For Travelling Salesman Problem
Fast Heuristic Algorithm For Travelling Salesman Problem
Problem
Nana Rahmana Syambas Shasa Salsabila Galura Muhammad Suranegara
School of Electrical Engineering School of Electrical Engineering School of Electrical Engineering
and Informatics and Informatics and Informatics
Institut Teknologi Bandung Institut Teknologi Bandung Institut Teknologi Bandung
Indonesia Indonesia Indonesia
[email protected] [email protected] [email protected]
Abstract— The Optimization of a large-scale Traveling of all visited nodes and the computation time required by the
Salesman Problem (TSP) especially in telecommunication program.
networks, which is a well-known NP-hard problem in
combinatorial optimization, is a time-consuming problem. In this The performance of proposed algorithm is measured by
paper, the proposed heuristic algorithm is designed for fast comparing it with other algorithm with two keys component,
computing. The result will be compared with two keys the total cost and the computational time. This proposed
parameter, accuracy and computation time. Proposed algorithm algorithm was compared with other algorithms that are
has been compared with brute force and Ant colony optimization commonly used, brute force and Ant Colony Optimization
(ACO) which known as an algorithm that is used to determine (ACO). Ant colony optimization (ACO) which known as an
the shortest path and best cost at minimum iterations possible for algorithm that is used to determine the shortest path and best
a random data set on the basis of Euclidean distance formula. cost at minimum iterations possible for a random data set on
Proposed algorithm takes only 0.0074 seconds to provide shortest the basis of Euclidean distance formula [8].
path solution with 50 nodes combination. The proposed
algorithm has 5% less accuracy from brute force and provide
6.69 % better solution from ACO for 33 nodes through 50 nodes. II. RELATED WORK
Brute force is known as the best algorithm to decide
Keywords— travelling salesman problem; shortest path value; smallest minimum total cost (value). Basically, brute force
ring topology; brute force; ant colony; heuristic algorithm; the calculates every single possible combination and compares its
shortest route value. So brute force can solve TSP with exactly the minimum
cost desired. However, brute force has limitation with its
I. INTRODUCTION computational time. The computational time of brute force is
Traveling salesman problem (TSP) is a problem that has raising exponentially with the number of nodes combination.
widely observed [1][2][3] even there is an implementation on So, it is needed a new heuristic algorithm to develop. This new
robotic using Genetic Algorithm in TSP [4]. The point of TSP heuristic algorithm must able to solve TSP problem with good
in telecommunication networks is to find the smallest value of total minimum value and fast computational time.
all nodes combinations that have been visited. So, the nodes are There are many other algorithms that have been developed
connected to form a ring topology. This ring topology will be to solve TSP problem, among them Ant Colony Optimization
considered to be used as the initial design of a network. [1], Genetic Algorithm [2], Swarm Intelligence [3], Bee
The main challenge of TSP is how to determine the Colony [5], Maximum Entropy [6], Penguin Search [7] etc.
combination of vertices (nodes) with smallest cost (value) of Even the hybrid method has been done by combining most of
each visited nodes and fast computational time. popular algorithm together such as [2][8]. The logical
consequence of this combination is raised its computational
In this paper, TSP problem with random assigned link cost time but end with better expected results.
and symmetric values will be solved using proposed algorithm.
Where the value of node A to node B is always the same as the Today most widely used heuristic algorithm for solving
value of node B to node A and not allowing loop. Therefore, TSP problems is Ant Colony Optimization (ACO). Therefore,
the loop value in each node is always zero. So, in this case this paper will compare the capabilities of the proposed
symmetric matrix is used as comparation between each algorithm with brute force and ACO for cost accuracy and
algorithm. computation time.
To solve the problem, we designed an algorithm and then The algorithm we created, is designed as simple as possible
write it into code in Python programming language. The output to aim the fastest computation time but still consider the
of this program is the combination of the nodes, the total cost accuracy cost of the resulting ring topology.
III. PROPOSED ALGORITHM After all the step above there are three nodes connected
This proposed algorithm is made with the aim to find the already, assuming A wrote on the center, the two smallest
best combination with minimum value to solve symmetrical nodes wrote on its left and right side. And then the next node
TSP with fast computation time so the result can be must be decided connected to the left or right side. The
implemented as a design for ring topology in decision made by counting the smallest node both side and
telecommunication networks. compare the result and then the smallest value is picked by
discarding the bigger ones. After that, the counting is continued
To find out the performance of proposed algorithm, we until the nodes remains three left. The last three nodes then
compared the result with brute force and ACO Algorithm. counted with brute force by counting one by one and compare
Brute force and ACO algorithms are available for free and can the result and the pick the minimum value. The pseudocode for
be accessed online via GitHub [9] [10]. proposed algorithm and the flowchart for TSP is shown below:
Proposed algorithm coded with Python 2.7 language and
running on Ubuntu 16.04 platform. In the experiment of
finding algorithm to get the minimum distance/weight/cost to
form ring topology is by analyzing the distance/cost matrix.
First approach is connecting some nodes (vertices) with two
minimum distance elements. Table 1 is 12 x 12 sample
distance matrix we used to test proposed algorithm:
V. CONCLUSION
From figure 5 smaller shortest path cost can be found by [1] Dorigo, Marco., Gambardella, L.M., “Ant Colony System : A
proposed algorithm compared to the Ant colony optimization Cooperative Learning Approach to the Traveling Salesman Problem,”
(ACO) starts from nodes 33. For nodes number below 33 we
IEEE Transactions on Evolutionary Computation, Vol 1, No. 1, April [7] Mzili, I., Bouzidi, M., Riffi M.E., “A Novel Hybrid Penguins Search
1997. Optimization Algorithm to Solve Travelling Salesman Problem,” IEEE
Third World Conference on Complex Systems (WCCS), November
[2] Ansari, A.Q., Ibraheem., Katiyar, S.,“Comparison and Analysis of 2015.
Solving Travelling Salesman Problem Using GA, ACO and Hybrid of
ACO with GA and CS,” IEEE Workshop on Computational Intelligence: [8] Jaiswal, K., Nagar, S., “Estimation of Cost Rate Percentage for
Theories, Applications and Future Directions (WCI), December 2015. Travelling Salesman Problem Using Hybridized ACO Algorithm,” IEEE
International Conference on Recent Advances and Innovations in
[3] Cao, Y., Xiao, M.H., Zhang, J., “Dynamic Swarm Intelligence Engineering (ICRAIE), December 2016.
Algorithms with Reuse Strategy for Dynamic Travelling Salesman
Problem,” IEEE 7th International Conference on Information Science and [9] Trevlovett, "https://github.com," 31 October 2012. [Online]. Available:
Technology, Vietnam, April 2017. https://github.com/trevlovett/Python-Ant-Colony-TSP-Solver. [Accessed
7 October 2017].
[4] Nelson, A.S.O., Fernando, D.L.R.R., “Path Planning and Following
using Genetic Algorithms to Solve the Multi-Travel Salesman Problem [10] Westphahl, https://gist.github.com/westphahl/432876. [Accessed online
in Dynamic Scenarios,” Proceedings of the 2017 18 th International 7 October 2017].
Conference on Advanced Robotics (ICAR), Hong Kong, China, July
2017. [11] Supriadi, B., Budi, B., “Comparison of Proposed Algorithm to Ant
Colony Optimization Algorithm to Form a Ring Topology with
[5] Shi, P., Jia, S., “A Hybrid Artificial Bee Colony Algorithm Combined Minimum Path Value,” IEEE International Conference on Recent
with Simulated Annealing Algorithm for Traveling Salesman Problem,” Advances and Innovations in Engineering (ICRAIE), December 2016.
IEEE International Conference on Information Science and Cloud
Computing Companion, 2013.
[6] Baranwal, M., Roehl, B., Salapaka, S.M., “Multiple Traveling Salesmen
and Related Problems: A Maximum-Entropy Principle based Approach,”
American Control Conference,USA, May 2017.