Copyright © 2018 Andysah Putera Utama Siahaan et. al. This is an open access article distributed under the Creative Commons Attribution
License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
International Journal of Engineering & Technology, 7 (4) (2018) 3654-3661
International Journal of Engineering & Technology
Website: www.sciencepubco.com/index.php/IJET
doi: 10.14419/ijet.v7i4.20606
Research paper
Comparative study of prim and genetic algorithms in
minimum spanning tree and travelling
salesman problem
Andysah Putera Utama Siahaan
1
*, Zulfi Azhar
2
, M. D. L. Siahaan
1
, Muhammad Iqbal
1
, Zuhri Ramadhan
1
,
Wirda Fitriani
1
, Zulham Sitorus
1
, Nova Mayasari
1
, Indri Sulistianingsih
1
, Dedi Purwanto
1
, R. F. Wijaya
1
,
Heri Kurniawan
1
, Rio Septian Hardinata
1
, Muslim Muslim
1
, Ressy Dwitias Sari
1
,
Mhd. Furqan
3
, Ali Ikhwan
3
, Muhammad Khahfi Zuhanda
4
, A. H. Lubis
4
,
Phak Len Eh Kan
5
, K. N. F. K. Azir
5
1
Faculty of Science and Technology, Universitas Pembangunan Panca Budi, Medan, Indonesia
2
Department of Information System, STMIK Royal Kisaran, Kisaran, Indonesia
3
Department of Computer Science, Universitas Islam Negeri Sumatera Utara, Medan, Indonesia
4
Faculty of Engineering, Universitas Medan Area, Medan, Indonesia
5
School of Computer and Communication Engineering, Universiti Malaysia Perlis, Pauh, Malaysia
*Corresponding author E-mail: andiesiahaan@gmail.com
Abstract
Optimization is the essential thing in an algorithm. It can save the operational cost of an activity. At the Minimum Spanning Tree, the
goal to be achieved is how all nodes are connected with the smallest weights. Several algorithms can calculate the use of weights in this
graph. Genetic and Primary algorithms are two very popular algorithms for optimization. Prim calculates the weights based on the short-
est distance from a graph. This algorithm eliminates the connected loop to minimize circuit. The nature of this algorithm is to trace all
nodes to the smallest weights on a given graph. The genetic algorithm works by determining the random value as first initialization. This
algorithm will perform selection, crossover, and mutation by the number of rounds specified. It is possible that this algorithm can not
achieve the maximum value. The nature of the genetic algorithm is to work with probability. The results obtained are the most optimal
results according to this algorithm. The results of this study indicate that the Prim is better than Genetics in determining the weights at
the minimum spanning tree while Genetic algorithm is better for travelling salesman problem. Genetics will have maximum results when
using large numbers of rotations and populations.
Keywords: Prim; Genetic Algorithm; Minimum Spanning Tree; Artificial Intelligent.
1. Introduction
Electricity is a significant resource [1]–[4] in the use of electronic
devces. Speed and security are the essential things in the delivery
of digital information [5]–[11]. Minimum spanning tree is a tree
that connects between nodes of the result of minimizing the
weights present in a complete graph. A graph is a mathematical
representation of a fact that is related to distance [12]–[14]. This
tree can be defined with a weighted graph. Directed graphs and
non-directional graphs are subgraphs that each node is connected
to one another. A graph can produce multiple ranges that have
different weights [15]–[17] The smallest weights are the minimum
spanning tree. The more branching in the tree, the more the differ-
ent ranges. Weighting is done by choosing the smallest weights on
each edge [18]–[20]. Each weight will be compared with the other
weights that lead to the next node. The smallest weight is the most
significant chance of choosing the next node. The minimum use of
spanning tree is mostly done in real life. It is related to the cost of
raw materials used to build a communication network. For
example, to install fiber optic cables between buildings or cities
requires proper optimization to avoid excessive use of cables
[21]–[23]. If there are savings made in cable purchases, the budget
used for the project is getting smaller. The economic principle
says, the less material used, the less financial expenditure [24]–
[32]. The following figure explains why a minimum spanning tree
is required.
Fig. 1: Multiple Possible Spans.