Professional Documents
Culture Documents
Dsa Review 3
Dsa Review 3
BY AN AIRCRAFT USING
DIFFERENT ALGORITHMS
Members:
Akshay Jaithalia 19BEC0704
Kashyap Bastola 19BCE2529
AIM
This study is a comparison based project comparing three popular algorithms whose concepts are used in
everyday computing tasks like GPS, aircraft navigation, etc.
These algorithms all help in finding out the shortest and the most efficient paths in a graph data structure
This project aims in demonstrating and comparing the time complexity of:
1. Bellman ford algorithm
2. Floyd warshall algorithm
3. Johnson’s algorithm
WHY THE NEED FOR SHORTEST PATH?
On web mapping websites like MapQuest or Google Maps, shortest path algorithms are used to
automatically find directions between physical locations, such as driving directions.
Fast specialised algorithms are available for this application.
A similar concept can be applied to air navigation, which is made up of a haphazard collection of
zones and waypoints which when interconnected will resemble a graph in a data structure with n
number of nodes
Hence, core concepts from algorithms like Dijkstra’s algorithm, Bellman ford algorithm, Floyd
Warshall algorithm and Johnson’s algorithm etc are used to code the navigation software for max
efficiency.
It saves time, money, energy, fuel and cost of operation.
BELLMAN FORD ALGORITHM
Each vertex is included one by one and is updated accordingly as more shorter paths are
found
“V - 1" is used to calculate the number of iterations. Because the shortest distance to an
edge can be adjusted V - 1 time at most, the number of iterations will increase the same
number of vertices.
After finding all possible shortest paths for the given graph the output is displayed in the
form of an adjacent matrix with the leading diagonal as 0s
This algorithm does not apply to graphs containing –ve cycle.
Sample calculation
JOHNSON’S ALGORITHM
(Dijkstra)+(Bellman Ford)
ANALYSIS ON TIME COMPLEXITY
We can conclude from the above outputs obtained from the execution of the codes with the same inputs that the Bellman
ford algorithm generates less time complexity than other algorithms.
Floyd-Warshall algorithm produces a time complexity that is lower than Johnson's but higher than bellman ford’s.
Bellman ford algorithm is more suited to dense graphs whereas johnsons algorithm is more suited to sparse and large graphs
In comparison to other algorithms, Johnson's algorithm generates the most time complexity.
The Bellman–Ford algorithm can detect and report the presence of negative cycles in a graph.
If negative cycles are present, they are converted to positive edges before the programme is executed in Johnson's algorithm.
This is why it is preferred to Dijkstra's algorithm.
POSSIBLE FUTURE WORKS