Professional Documents
Culture Documents
Abstract
Geographic Information System, electronics problems,
The shortest path algorithm (SPA) is one of the most travelling problems and various computer applications
fundamental and important in combinational problems. [4].
SPA, a problem in graph theory, has commonly applied Our country, Myanmar, has varieties of interested
in communications, transportation, Artificial places concerned with culture, religion, villages,
Intelligence, Geographic Information System and ecotourism, historical buildings, temples and other
electronics problems. The problem of finding a path pleasure natural residences. They who want to visit or
travel from one place to another needs to recognize the
between two vertices (or nodes) in a graph is a key role effective and efficient ways. Thus we would like to put
of SPA tricky to minimize the weights of constituent on the points in graph theory as cities in Myanmar and
edges. Thus we would like to implement and highlight the the edges may be roads as the connected links using
advantages of a shortest path algorithm, Dijkstra’s weight value assigned with distance between two points.
Algorithm (DA), which has been widely used in The key tricky of this work is for finding the shortest path
engineering calculation such as in Google maps. In this through the network or the best way in travelling
processes.
paper, we approve the constancy of this algorithm, also
known as label algorithm, using only on positive weights This paper will provide the shortest paths from one
for travelling tracking process in Myanmar cities. The place to another by using Dijkstra‘s Algorithm in graph
criterion values are referred from Google map data. This theory [1] [5] [6]. Firstly, we will express the background
paper presents not only the implementation of applicable of study in section 1.1. In section 2, the objectives of this
tracking system but also the minimum cost of this applied paper is expressed and the methodology including the
algorithm with graph data structure including finite set case of shortest path problem, result and discussion, how
of vertices. Finally, we also present the review of Dijkstra‘s Algorithm do in problem and analytical
implementation in these ages as stated by complexity and solution is also explained with a case study in section 3.
where we can apply this algorithm as a future work. Thus we can see the optimal paths for travelling to the
designated city with shortest distance and minimum time
Keywords: Applications, Dijkstra’s Algorithm, Directed as a case study. Finally, we organize how to achieve the
Graph, Shortest Route implementation result and how we can go to future plan
with these groups of theories such as other shortest path
1. INTRODUCTION problems, graph theory section 4.
At first, we would like to explain about what is
shortest path in graph theory. In graph theory, the 1.1. Background of Study
problem of finding a path between two vertices (nodes) In paper [1], the author apply Dijkstra’s algorithm to
is the shortest path problem such as the sum of the provide the market problem for a tourism company in
weights of its constituent edges is minimized [2]. Graph Bali, one of many small island in Indonesia. There were
is a mathematical representation of a network including top ten tourist destinations to be implemented in this
the relationship among a finite number of points (nodes) paper. They use Java language for more reliable and
connected by lines (edges) [3]. This shortest path easier to maintain manage memory automatically with
problem can be modeled in a graph, where the vertices garbage collection discovery how the JVM provides
correspond to intersections and the edges correspond to portability and security.
road segments, each weighted by the length of the The evaluation and discussion of the general aspect
segment. Thus, graph theory is a key role for various of Dijkstra’s Algorithm is also presented for
modeling problems in real world such as demonstrating the functionality of this algorithm to
communications, transportation, Artificial Intelligence,
35
Journal of Computer Applications and Research, Volume 1, No 1, 2020
minimize the cost of routing the computer network [6]. comparison in the min-priority queue will be according
In this paper, there are four variables such as set of visited to vertices distances. The minimum distance from the
nodes, queue, graph and weight to be implemented with priority queue is popped; at first source may be the
Dijkstra’s Algorithm. In addition, the acceptable in terms popped vertex. The distances of the connected vertices to
of overall performance is the time complexity in this this popped vertex is then updated in case of “current
consequence by implementing the IP routings as nodes vertex distance + times < next vertex criteria” and then
and routing protocols as links. However, it has till some push the vertex with the new distance to the priority
major drawbacks about this application such as using queue. After that, if the popped vertex is visited before,
negative edges, leading to acyclic graphs, not obtaining just continue without using it. Finally the same algorithm
the right shortest path and highly centralized. But they is applied again until the priority queue is empty. [8]
said what these drawbacks may be taken care by some
other shortest path algorithm like Bellman-Ford and
FloydWarshall algorithms.
The comparison of time and space complexity about
three basic algorithms for finding shortest paths,
Dijkstra’s algorithm, Bellman-Ford algorithm and
FloydWarshall algorithm, is theoretically presented in
paper [5]. They conclude that the Dijkstra’s algorithm
applies spares graph and is always optimized in actual
application, like heap optimization. The time complexity
cuts to n*logn [7]. The time complexity of Dijkstra’s
algorithm is presented with a binary heap by using non-
negative weight in a directed graph [8]. Accordingly, we
are interested to compile an optimized shortest path
algorithm, Dijkstra’s algorithm, to provide a tourism
organization to be cost effective.
2. OBJECTIVES OF EMPLOYMENT
The following list gives the objectives of this research
paper:
• To understand how to determine and identify the
concepts of the shortest path problem in a same
graph.
• To determine the representation of graphs in
computer in order to solve the shortest path problem,
as well as to understand the different basic terms of
a graph.
• To explain the general concepts and the
implementations of Dijkstra’s Algorithm.
• To safe the transposition delay and cost.
Figure 1. Total traffic ways between Yangon and
3. METHODOLOGY Mandalay from Google Maps
3.1. The Shortest Path Problem
This paper is to find the shortest path from a given 3.2. Result and Discussion
city, called home, to another given city called destination The effectiveness of the application area is
by using Dijkstra’s algorithm. Why we use this algorithm governed for some cities in our country. Now we like to
for implementation is that this is the most efficient express how we get the shortest path between the most
algorithm compared with other types of shortest path famous two cities in Myanmar, Yangon as a source and
algorithms in. [1, 7] The length of a path is assumed to Mandalay as a destination. The graph data structure of
be equal to the sum of the lengths of links between possible traffic ways between Yangon and Mandalay
consecutive cities on the path. With no loss of generality according to Google map [9] is shown in Figure 2.
we assume that city 1 is the home city and city n is the
destination. [9] Some improvements on Dijkstra’s
algorithm are also done in terms of efficient
implementation. [3]
At first, in this algorithm implementation, the
Google maps shown in Figure 1 is used to set all vertices
distances as shown in Figure 2 and source vertex in a
min-priority queue in form (distance, times), as the
36
Journal of Computer Applications and Research, Volume 1, No 1, 2020
96mi (2hr 17min) m to n157mi (5hr 29min) l to Thus, we use the following simple set of instructions
n along with the concept of DA in section 3.1.
100mi (3hr 16min) h to N L 39mi (1hr 21min)
Step 1: Label the start vertex as 0.
90mi (2hr 9min) j to m Step 2: Box this number (permanent label).
89mi (3hr 3min) h to Step 3: Label each vertex that is connected to the start
M K
m vertex with its distance (temporary label).
136mi (4hr 7min) j to
107mi (3hr 9min) e to m Step 4: Box the smallest number.
k
J Step 5: From this vertex, consider the distance to each
H
12mi (25min) connected vertex.
22mi (48min) Step 6: If a distance is less than a distance already at
I 60mi (1hr 25min)
this vertex, cross out this distance and write in
G the new distance. If there was no distance at
99mi (2hr 54min) F 138mi (4hr 46min) c to the vertex, write down the new distance.
f Step 7: Repeat from step 4 until the destination
46 mi (1hr 3min) d to f
E vertex is boxed.
D
130mi (4hr 100 mi (2hr 16min)
18min) C 3.4. Analytical Solution to the Problem
B
c
39 mi (1hr
174 mi (5hr As in the above section 3.3, the evaluation of shortest path
A between two famous cities according to the first three steps of
31min)
DA as shown in Figure 3.
Figure 2. Total traffic ways between Step 1: Label A as 0
Yangon and Mandalay Step2: Box this number
Step3: Label value of 39mi (1hr 26min) at B,
In this paper, we present not only the implementation 174 mi (5hr 31min) at C
of Dijkstra algorithm as a National City traffic advisory
practice which can satisfy the passengers’ different
demand of travel but also providing some optimal 174 C B 39
decision. The identifications of implemented figures for
graphical representation, such as city names and related
nodes are shown in Table 1. A
0
Table1. Names of location and Nodes Identification Figure 3. Graph representation of step1-3 for
LOCATION NODES starting form source
Yangon A
In Figure 4, the node “B”, Bago is chosen as
Bago B a shortest path for starting from source according to the
Pyay C comparison of distance and time values with node “C”,
Phyu D Pyay. According to the needed of updating and
pushing the vertex with the new distance to the priority
Magway E
queue, the following step 4 and step 5 are done as
Taungoo F follow:
Bagan G Step 4: Box the 39 mi (1hr 26min) at B.
Pakokku H Step 5:From B, the connected vertices is D. The distance
Lewe I at these vertices are 139 mi (3hr 42min) at D (39+100)
Naypyitaw J mi and (1hr 26min +2hr 16min).
Kalaw K
Taungyi L
D 139
Meiktila M
Mandalay N 174 C B
39
37
Journal of Computer Applications and Research, Volume 1, No 1, 2020
I 245
I 245 403 G
F 185 312
312
304 E F 304 E
185 D 139
D
139 C
C 174 B
174 39
B
39
A 0
A
0
Figure 7. Graph representation of step 4-5 for Figure 8. Graph presentation of shortest path
choosing “I”, Lewe evaluated result from Yangon to Mandalay
38
Journal of Computer Applications and Research, Volume 1, No 1, 2020
39
Journal of Computer Applications and Research, Volume 1, No 1, 2020
40