Professional Documents
Culture Documents
Output 2
Output 2
Output 2
Afshan Bilal
Department of Computer Science
National College of Business
Administration and Economics
Lahore, Pakistan
afshan.belal@gmail.com
ORCID: 0009-0007-5658-5203
Abstract—Extensive study has been conducted on the problem study: Iterative Deepening A* (IDA*), Uniform Cost Search
of finding the shortest path in a graph, leading to the creation of (UCS), Breadth-First Search (BFS), Depth-First Search (DFS),
several approaches. The effectiveness of the following algorithms Dijkstra’s, and Bellman-Ford.
in finding the shortest path is compared and contrasted in this
Due to its consideration of more complex data structures
and heuristics, the A* algorithm performs better than the produces optimal results, other algorithms, such as IDA*
Greedy method. Dijkstra’s approach may be used to find the and UCS, may have applications based on certain network
shortest route in weighted graphs in an optimum and efficient characteristics.
manner. The Bellman-Ford approach, which handles negative
edge weights, is also taken into account in the study. We will discuss these algorithms’ analyses and performance
To find the shortest paths, we explore the potential of the graph assessments in detail in the following sections, looking at their
traversal algorithms BFS and DFS. Whereas IDA* efficiently benefits, drawbacks, and applications in finding the shortest
determines the optimal solution by fusing DFS with heuristic path.
approximations, UCS expands Dijkstra’s method to incorporate
edge cost information. II. LITERATURE REVIEW
By comparing them, the study aims to provide insight into
the capabilities and suitability of these algorithms in different For many years, scholars have been interested in the topic
scenarios. The best approach depends on several factors, includ- of finding the shortest path in both weighted and unweighted
ing the graph’s characteristics, the presence of negative weights, graphs. Applications for it are found in many fields, including
and the availability of heuristic information. Every approach has telecommunications, urban planning, computer science, and
benefits and drawbacks that determine which use cases are best
suited for it.
transportation.
In summary, a variety of techniques for locating the shortest A. Early Developments
path in a graph are offered by the IDA*, BFS, DFS, Bellman-
Ford, Dijkstra, and A* algorithms. When selecting a technique, It was during the 1950s and 1960s in particular that
it is important to take into account the unique requirements significant advances in shortest-path algorithms occurred in
and constraints of the present problem. the second half of the twentieth century. An algorithm that
Keywords: Bellman-Ford algorithm, Dijkstra’s approach, systematically finds the shortest path from a source vertex to
shortest route, A* algorithm, BFS, DFS, UCS, IDA*. every vertex in a weighted network was first described by
Index Terms—component, formatting, style, styling, insert Dijkstra in his landmark work [13]. Meanwhile, the Bellman-
Ford algorithm was developed, which differed from Dijkstra’s
approach in that it could handle networks with edges that had
I. I NTRODUCTION negative weight [14], [15].
Finding the shortest path in a graph is an important problem
B. Advancements in Heuristic Methods
that has been extensively studied in many different domains.
It may be applied to fix real-world issues and enhance system Heuristic search strategies saw a breakthrough with the
performance. The objective is to determine the shortest path invention of the A* algorithm by Hart, Nilsson, and Raphael
between a source and a destination using the graph’s edges in the 1960s. This strategy improved efficiency, particularly in
and vertices. To overcome this problem, several different algo- large graphs, by factoring in both the current and future costs
rithms have been developed, each with unique characteristics to reach the target [16].
and trade-offs. C. Comparative Studies and Real-world Applications
Two popular techniques for figuring out the shortest path
are the Dijkstra and A-Star (A*) algorithms. More complex From the late 20th to the early 21st centuries, shortest-path
data structures are used with heuristic functions in the A* algorithms were the subject of intense scientific investigation.
algorithm to get superior outcomes. Situations requiring quick Prominent studies focused on comparing the effectiveness,
and effective route finding are a good fit for the A* method[1]. applicability, and usability of these algorithms in various
The effectiveness of this method in wireless sensor network scenarios. For example:
(WSN) routing, especially when heuristics are employed[2]. • Bidirectional Searches: Research on the bidirectional
Of the methods mentioned above, Dijkstra’s algorithm is subtleties of the A* and Dijkstra algorithms produced en-
the most consistently effective[3], especially when it comes to couraging findings. In some situations, these bidirectional
scenarios such as evacuation route selection [4]. This indicates algorithms can increase speed and efficiency by decreas-
that Dijkstra’s algorithm-based energy-saving method can im- ing the search space by functioning simultaneously from
prove results[5] by accounting for edge and node weights in both the source and the destination [22, 23].
graphs generated from SDN topology. • Handling Dynamic Graphs: The adaptability of algo-
The effectiveness of the shortest route algorithms created by rithms to dynamic graphs, where edge weights vary over
Dijkstra and A* is contrasted and compared in this work. It time, was another focus area. In real-world applications
will also look at other relevant route-finding algorithms, such like traffic management, where road conditions and traffic
iterative deepening a* (IDA*) and uniform cost search (UCS). volumes may change, such flexibility becomes crucial
Through a thorough evaluation and comparison of these [24, 25].
algorithms, we want to provide insight into their functional- • Graph Types and Challenges: Scholars have also ex-
ity, performance, and suitability for different scenarios. The amined the distinct difficulties posed by different kinds
optimal approach depends on the specific parameters and of graphs, including sparse vs dense graphs, and the
constraints of the given network or path. Although A* pro- performance of each method in these situations [26, 27].
vides prompt responses and Dijkstra’s algorithm consistently
Furthermore, real-world applications highlighted how im- technique works with weighted graphs, in which there is a cost
portant these algorithms are to a wide range of businesses. or distance associated with each edge. The basic idea behind it
For example, effective data routing is essential in telecom- is to relax all nearby nodes and iteratively choose the node that
munications. Network dependability is increased and data is farthest from the initial location. Until the algorithm reaches
transmission times are shortened when improved algorithms the target node, this procedure keeps on. As long as the edge
are used [23]. weights are non-negative, the shortest path is guaranteed by
Dijkstra’s algorithm.
D. Real-world Applicability of Shortest Path Algorithms
Dijkstra’s algorithm is important since it may be used in
The vast real-world ramifications of shortest-path algorithms many different disciplines. It is essential to route planning in
match their theoretical depth. the fields of logistics and transportation because it makes sure
• Transportation: GPS navigation devices are essential in that cars follow the most direct path possible while taking
the field of transportation. They mainly rely on Dijkstra’s into account a variety of factors including traffic and road
and A* algorithms to provide drivers with the quickest conditions. It supports routing protocols like OSPF and IS-
routes in real-time [28]. This lessens travel time while IS in computer networks, enabling effective data transfer.
simultaneously lowering fuel consumption and reducing The method is a vital tool for any application that needs
wear and tear on the vehicles. to determine the best path because of its universality and
• Telecommunications: Data transfer must be quick and dependability.
effective in the digital age. Shortest-path algorithms are
useful in this situation because they provide the best data A* Algorithm:
flow channels and reduce latency [29].
• Financial Networks: Financial systems may present
The A* algorithm, introduced by Peter Hart, Nils Nilsson,
chances for arbitrage, especially in the fields of forex and and Bertram Raphael in 1968, builds upon the principles of
high-frequency trading. With its ability to manage nega- Dijkstra’s algorithm but enhances efficiency by incorporating
tive weights, the Bellman-Ford algorithm plays a crucial heuristics. A* aims to find the shortest path while also
role in these situations, assisting traders in identifying considering an estimate of the remaining cost to reach the
and seizing these fleeting chances [30]. target. It does this by evaluating nodes using a combination
• Urban Planning: As cities become smart hubs and urban
of the known cost from the starting node (similar to Dijkstra’s
centers grow, effective management of people and trans- approach) and a heuristic estimate of the cost to reach the
portation becomes essential. To ensure the convenience goal. This estimation is usually based on a distance or time
and safety of residents, BFS and DFS algorithms might heuristic, such as the Euclidean distance in a grid.
be crucial in the design of evacuation routes or the Because it achieves a balance between efficiency and com-
optimization of public transportation routes [31]. pleteness, A* is noteworthy. Heuristics are used to steer the
• Aviation: Algorithms like UCS or IDA* are useful for
search toward the objective, frequently resulting in a consid-
skillfully managing the complexities of flight schedules, erable reduction in the number of nodes explored—especially
which involve several cost factors ranging from fuel to in big networks. Because of this, A* is very effective and
airspace costs. These enhancements guarantee punctual useful for real-time applications such as GPS navigation, video
departures, economical fuel use, and decreased overhead games, and robots. In these applications, A* offers fast and
for aviation enterprises [32]. precise pathfinding solutions, enabling GPS systems to quickly
This concrete meeting point of theory and practice empha- choose the best course, robots to traverse their surroundings,
sizes how shortest-path algorithms’ usefulness extends beyond and gaming characters to map out their itineraries.
academic boundaries and finds resonance in the systems and To sum up, the A* and Dijkstra algorithms are essential to
technology that we rely on in our daily lives. pathfinding. Dijkstra is a flexible solution for a wide range
E. Significance and Popularity of Dijkstra and A* Algo- of applications due to its simplicity and dependability, but
rithms A* uses heuristics to increase efficiency and is thus the best
choice for large-scale and real-time pathfinding issues. These
Two of the most well-known and often applied pathfinding
algorithms have been widely used throughout sectors, demon-
algorithms are Dijkstra’s and A*, both of which are essential to
strating their value and continuing to inspire breakthroughs in
many different applications. The ability of these algorithms to
computer science, graph theory, and optimization.
determine the shortest path between two locations in a graph
or network is often praised. Let’s take a closer look at the
F. Recent Trends
fundamental ideas and importance of these algorithms.
Newer studies have focused on using modern computational
Dijkstra’s Algorithm: methods to improve classical algorithms. There have been
attempts to use quantum computing and parallel processing
Edsger W. Dijkstra, a Dutch computer scientist, created the to speed up shortest-route methods [20]. Moreover, dynamic
well-known and adaptable Dijkstra’s algorithm in 1956. The algorithms that adjust in real-time to changing network dy-
namics are becoming increasingly important as the Internet of f. Explore all the unvisited surrounding vertices of the
Things (IoT) age develops [21]. dequeued vertex.
g. Mark each surrounding vertex as visited and enqueue it
into the queue.
III. HYPOTHESIS AND RESEARCH QUESTION
h. If the objective vertex is located during the exploration,
A. Hypothesis halt the process.
It is hypothesized that algorithms that use heuristic infor- i. If the queue gets empty and the target vertex is not
mation, like the A* search, are probably more computationally discovered, end the process unreachable).
efficient when the heuristic is precisely represented, based on
the thorough examination of many shortest-path algorithms
on the network. Their capacity to direct investigation in
the direction of more promising avenues, hence limiting the
number of expanding nodes, accounts for this efficiency. In
contrast, heuristic-free algorithms like BFS and Dijkstra’s
technique guarantee completeness and optimality even though
they may be more comprehensive in their search. Heuristic-
based techniques could exhibit more noticeable savings on
a dense network with plenty of nodes and edges, while the
difference might be insignificant on sparse graphs. Addition-
ally, the applicability and effectiveness of methods such as
Bellman-Ford become more noticeable in graphs with dynamic
edge costs or where negative weights may exist.
B. Research Question
Building on the knowledge gained from the analysis, the
work presents an important research question: ”What effects
do edge weight dynamics and graph density and structure have
on the accuracy and efficiency of shortest-path algorithms?”
Furthermore, in what particular circumstances do approaches Fig. 1. Example of BFS
based on heuristics demonstrate noteworthy computational
benefits? The arrows in the following image show the nodes’ Path
This part summarizes the research’s foundations and lays order throughout the BFS traversal from Start to Goal. Starting
the groundwork for more investigation, testing, and verification at node ’A’, the BFS algorithm looks at ’B’ and ’C’ as its
based on the hypothesis and question that are posed. neighbors first. It then distributes ”B” and locates ”D” and
”C,” which are its neighbors. As ’C’ has already been visited,
IV. RESEARCH METHOD it is not put in the queue once more. The extension of ’D’
and an analysis of its lone neighbor ’F’ follow. ’E’ is finally
A. Breadth-First Search (BFS)
expanded, but it is alone. The procedure continues until node
A graph traversal technique called breadth-first search ’C’, the objective, is reached. Following the path from the start
traverses every vertex in a graph in breadth-first order, that node to the destination node, the outcome ’A’, ’B’, and ’C’ is
is, it visits every vertex at one level before moving on to the attained.
next. BFS visits every neighbor of the current vertex, starting
from a certain source vertex, and then moves on to their B. Depth-First Search
neighbors. It is frequently used in network analysis and graph Another method for traversing a graph that goes over each
algorithms, and it may be used to find the shortest path in an vertex in depth-first order is called Depth-First Search. It starts
unweighted graph [6]. at a specific source vertex and proceeds along each branch
as far as is practical before turning around. Implementing
DFS often makes use of a stack data structure or recursion.
1) Algorithm & Example : It is used in a variety of applications, including graph cycle
a. Choose a beginning vertex as the source and mark it as recognition, maze solving, and topological sorting[6].
visited.
b. Create a queue data structure to hold the vertices to be 1) Algorithm & Example:
processed. (a) Choose a beginning vertex as the source and mark it as
c. Enqueue the source vertex into the queue. visited.
d. While the queue is not empty, repeat steps e-h. (b) Create a stack data structure to hold the vertices to be
e. Dequeue a vertex from the queue and process it. processed.
(c) Push the source vertex onto the stack. g(n) + h(n), where g(n) is the cost incurred thus far to reach
(d) While the stack is not empty, continue steps f-i. node n and h(n) is the estimated cost from node n to the
(e) Pop a vertex off the stack and process it. destination, the approach assesses the total cost of a route[8].
(f) Explore all the unvisited surrounding vertices of the The A-Star approach has been widely used in applications
popped vertex. like labyrinth solving and route planning[9] and performs
(g) Mark each surrounding vertex as visited and put it onto well in a variety of circumstances.
the stack.
(h) If the objective vertex is located during the exploration, 1) Algorithm & Example :
halt the process.
(a) Select a starting vertex as the source and mark it as
(i) If the stack gets empty and the target vertex is not
visited.
located, end the algorithm (goal is unreachable).
(b) Create a priority queue data structure to house the ver-
tices to be processed. The priority queue is determined
by the predicted cost from the current vertex to the
destination vertex, as well as the cost from the beginning
vertex to the present vertex.
(c) Place the source vertex in the priority queue.
(d) Rep steps (e)-(i) until the priority queue is empty.
(e) Dequeue and process a vertex with the highest priority
(lowest predicted cost) from the priority queue.
(f) Investigate all unvisited surrounding vertices of the
dequeued vertex.
(g) Calculate the anticipated cost from the initial vertex to
the nearby vertex, as well as the predicted cost from
the neighboring vertex to the destination vertex, for
each surrounding vertice. Add these costs together to
determine the priority of the next vertex.
(h) Mark each surrounding vertex as visited and enqueue it
into the priority queue.
(i) If the objective vertex is located during the exploration,
halt the process.
(j) If the priority queue gets empty and the target vertex is
not identified, end the algorithm (goal is unreachable).
The arrows in the image above show the nodes’ path order
from start to goal during the DFS traversal. Starting with node
’A’, the DFS algorithm investigates ’B’, its neighbor. Growing
’B’, it finds its neighbor ’D’, then stretches ’D’ and locates its
neighbor ’F’. After that, it goes back to ’D’ and investigates
’E,’ its final neighbor. It goes back to ’B’ once again and looks
inside the last neighbor, ’C’. At finally, it circles back to ’A’
and looks into the final neighbor, ’C’. The procedure continues
until node ’C’, the objective, is reached. As the route from the
start node to the destination node is followed, the result ’A’ -
’B’ - ’D’ - ’F’ - ’G’ - ’C’ is obtained.
C. A-Star Algorithm
A popular path-planning method used in several
applications, such as configuration space metrics and
topologies, is the A-Star method, sometimes referred to
as A*[7]. To find the best route from a starting node to a
target node, it mixes heuristic search and shortest route-based
searching techniques. Using an evaluation function f(n) = Fig. 3. Example of A-Star Graph
The path from start node ’A’ to destination node ’E’ is
determined using the A* technique with heuristic cost (cost)
in the preceding figure. The total cost, which is the sum of
the actual cost from the start node and the heuristic cost to the
destination node, is the basis on which the algorithm evaluates
nodes. The procedure starts with node ’A’, extends node ’C’
(since it has the lowest total cost), and then expands node
’E’, which is the target node. Based on the A* algorithm, the
optimum path from the start node to the destination node is
represented by the result ’A’ - ’C’ - ’E’.
D. Dijkstra’s Algorithm
Since it looks at every vertex in the network, breadth-first In conclusion, while each method has distinct time and
search (BFS) is a comprehensive approach that guarantees that, space challenges, BFS, UCS, A*, Dijkstra’s algorithm, and
should a solution exist, it will be found. Similar to this, as they Bellman-Ford are all complete and optimum. While IDA*
examine every path that is viable in the graph, Bellman-Ford, and DFS are neither flawless nor comprehensive, their space
A*, Dijkstra’s algorithm, and Uniform Cost Search (UCS) complexity is lower than that of the other methods.
are all comprehensive algorithms. However, since they could
become stuck in never-ending cycles or miss certain paths in
the graph, Depth-First Search (DFS) and Iterative Deepening
A* (IDA*) are incomplete.
Graph: