Shortest Path Algorithm
Shortest Path Algorithm
Nguyen Nguyen
Khoa Vo
Advanced Program in Computer Science Advanced Program in Computer Science Advanced Program in Computer Science
Faculty of Information Technology
Faculty of Information Technology
Faculty of Information Technology
University of Science, VNU - HCM
University of Science, VNU - HCM
University of Science, VNU - HCM
vtdkhoa13@apcs.vn
npnguyen@apcs.vn
tmbao@apcs.vn
I. I NTRODUCTION
A. Problem Statement
The shortest path problem is designed essentially to find
a path of minimum length between two specified vertices
of a connected weighted graph.[?] It has many real world
applications such as Very-large-scale integration (VLSI) design [?], etc. One of the most prominent applications is
finding the shortest path between two locations on a map.
The purpose of this paper focuses on the efficiency of the
proposed algorithms to solve the shortest path problem. For
this application, the authors propose the use of A*, Breadth
First Search, and Uniform Cost Search to solve the problem
and make comparisons between those search algorithms.
B. A* Search
The main idea of Best-first search is to follow the best
path available from the current position, rather than always
following the depth-first approach. At each node, the algorithm
uses an evaluation function f(n)to estimate the node quality.
A, perhaps the most widely known form of best-first search.
It is an algorithm that uses heuristic to guide search while
ensuring that it will compute a path with minimum cost. It
evaluates nodes by combining g(n), the cost to reach the node,
and h(n), the cost to get from the node to the goal: f(n) = g(n)
+ h(n), in which g(n) gives the path cost from the start node
C. Breadth-first Search
Breadth-first Search is implemented by expanding the root
node first then all of its successors, and so on. In other words,
the main idea of Breadth-first Search is to expand shallowest
unexpanded node. Breadth-first Search uses a FIFO queue in
order to expand the shallowest unexpanded node. As a result,
new nodes go to the back of the queue because they are deeper
than their parents, old nodes, which are shallower than the new
nodes, get expanded first. In Breadth-first Search, the goal test
is applied to each node when it is generated rather than when it
is selected for expansion. Also, because the nature of algorithm
is to discard any new path to a state already in CLOSED or
OPEN set). Thus, making the path to a found node is always
the shallowest in CLOSED.
The algorithm Breath-first Search is observed to be complete. Since the algorithm can always find the shallowest goal
node at some finite depth d, after generating all shallower
nodes (provided the branching factor b is finite). However, the
shallowest goal node is not necessarily the optimal one. Since
the condition for Breadth-first Search to be optimal is only if
path cost is a nondecreasing function of the depth of the node.
In term of time complexity, in the worst case scenario, if
each node has b child nodes, and their child nodes also have
b child nodes. Then the time it takes to find the goal node, the
last node generated at the solutions depth d is: b + b2 + b3 +
+ bd = O(bd ). In the case of space complexity of breadth-first
Search, every node generated remains in memory. As a result,
there will be O(bd 1) nodes in the explored set and O(bd ) nodes
in the frontier. Therefore, the space complexity of Breadth-first
Search is O(bd ).
The authors observes that Breadth-first Search is useful in
the following cases:
Space is not a problem;
The solution containing the fewest arcs;
Few solutions may exist, and at least one has a short path
length
Infinite paths may exist, because it explores all of the
search space, even with infinite paths . . .
R EFERENCES
[1] V. den Bulck J, Adolescent use of mobile phones for calling and for
sending text messages after lights out: results from a prospective cohort
study with a one-year follow-up. Sleep 2007, 30: 12203.
[2] Robert L. Sack, Alfred J. Lewy, Danielle L. Erb, William M. Vollmer,
and Clifford M. Singer, Human melatonin production decreases with
age, Journal of Pineal Research, vol. 3, 1986.
[3] Tamar Shochat, Ofra Flint Bretler, and Orna Tzischinsky, Sleep patterns, electronic media exposure and day time sleep related behaviours
among israeli adolescents, Foundation ActaPdiatrica, 2010.
[4] M. Dworak, T. Schierl, T. Bruns, and H. K. Strder, Impact of singular
excessive computer game and television exposure on sleep patterns and
memory performance of school-aged children, PEDIATRICS, vol. 120,
pp. 978 85, 2007.
[5] L. P. Macmillan, Macmillan Dictionary for Students. Pan Macmillan,
1981, p. 936.
[6] Dale Purves, George J Augustine, David Fitzpatrick, Lawrence C Katz
et al., Neuroscience, 2nd ed. Sinauer Associates, 2001.
[7] S. H, Rethinking sleep analysis: Comment on the aasm manual for
the scoring of sleep and associated events, Journal of Clinical Sleep
Medicine, pp. 99103, 2008.