ADS PPT A Division Grp18

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 19

BRACT’s Vishwakarma Institute of Information Technology

Advanced Data Structures (ADUA_22202)


Group 18

Name Roll number PRN number

Tejas Ware 271060 22010447

Vidhyapati Shelke 271072 22120037

Anurag Siddhanti 271078 22120116

Shruti Jadhav 271079


22120119

Payal Chandile 271080 22120121


Topic

Shortest Path
finder using A*
algorithm in a
Graph
Problem Statement

To find the shortest path in a graph using A* algorithm and draw


comparison between A* algorithm and Dijkstra’s algorithm
Introduction

The shortest-path problem, one of the


fundamental quandaries in computing and
graph theory, is intuitive to understand and
simple to describe. In mapping terms, it is
the problem of finding the quickest way to
get from one location to another. Expressed
more formally, in a graph in which vertices
are joined by edges and in which each edge
has a value, or cost, it is the problem of
finding the lowest-cost path between two
vertices.
A* algorithm simplified

A* algorithm has 3 basic components:


g : the cost of moving from the initial cell to the
current cell. Basically, it is the sum of all the cells
that have been visited since leaving the first cell.
h : also known as the heuristic value, it is the
estimated cost of moving from the current cell to
the final cell. Hence, h is the estimated cost.
f : it is the sum of g and h. So, f = g + h
Algorithm:

Step 1: Place the starting node into OPEN and find its f (n) value.

Step 2: Remove the node from OPEN, having smallest f (n) value. If it is a goal node then stop and
return

success.

Step 3: Else remove the node from OPEN, find all its successors.

Step 4: Find the f (n) value of all successors; place them into OPEN and place the removed node into

CLOSE. The algorithm makes its decisions is by taking the f-value into
account. The algorithm selects the smallest f-valued cell and moves to
Step 5: Go to Step-2. that cell. This process continues until the algorithm reaches its goal
cell.
Step 6: Exit.
Djikstra’s vs A* algorithm

Djikstra’s algorithm is an uninformed algorithm that finds the shortest distance between 2
points in a graph which takes into consideration all the neighbors of the current node at any
given point and therefore has to deal with more unnecessary data. Especially in cases where
the graph is very big and there are lot of nodes, dijkstra's algorithm is inefficient.

Complexity: O(E + nlogn)

A* algorithm is an informed search algorithm which uses heuristics approximations at every


step to find out optimum f value to choose the next vertex which reduces the number of
nodes to cover and makes the algorithm more efficient than djikstra’s algorithm.

Complexity: N(log n)
Code Implementation
Demonstration

Orange spot: It marks the start position.


Blue spot: It marks the end position.
Red spot: These are the closed spots.
Green spot: These are the spots in open
queue.
Purple spots: It marks the shortest path
found.
Black spots: Walls in the graph through
which the final path cannot pass.
Software Requirements

● Preferred IDE that supports python:

VSCode
● Pygame library(python) to visualise the working
Applications

● Game Development
● Natural Language Processing
● Financial Trading System
● Space Explore
● Maps are implemented using graphs
● In cab services portal where source and destination are given by the user
Result

From this experiment we were able to demonstrate the working of a* algorithm


and also see how a* algorithm helps us to find the shortest path in a graph with
obstacles in between.

Also we saw how a* algorithm is better than djikstra’s algorithm to find the
shortest between 2 vertices as we do not have to calculate all possible paths but
only paths that seem appropriate.
Advantages of A * Search

● It is optimal search algorithm in terms of heuristics.


● A* is faster than using dijkstra and uses best-first-search to speed things up.

● It is used to solve complex search problems.


● There is no other optimal algorithm guaranteed to expand fewer nodes
than A*.
Conclusion

According this study we can say that the A* algorithm is perform better then
the Dijkstra algorithm in all the case (obstacle and without obstacle) except in
uninformed search. The A* algorithm has generated the best shortest path for
other algorithm so that it is the best shortest path search algorithm.
Research Paper Summary

The shortest paths, sets of paths with the shortest distance between a single initial
(source) point and all other destination points, as well as between all pairs of points, are to
be found. For each of these approaches, individual algorithms with specific features have
been worked out over the past decades. Graph-like data appears in many applications,
such as social networks, internet hyperlinks, roadmaps, etc. and in most cases, graphs are
dynamic, evolving through time.In this Project We Try to find the shortest path in a graph
using A* algorithm and draw comparison between A* algorithm and Dijkstra’s algorithm.
Bibliography

● https://en.wikipedia.org/wiki/A*_search_algorithm#Applications
● http://www.hindex.org/2014/p520.pdf
● https://iopscience.iop.org/article/10.1088/1742-6596/1566/1/012061/pdf#:~:t
ext=A*%20algorithm%20is%20just%20like,just%20explore%20all%20possible%
20ways
.
● http://www.ccpo.odu.edu/~klinck/Reprints/PDF/wikipediaNav2018.pdf
Thank You

You might also like