Pathfinding algorithms address the problem of finding a path from a source to a destination avoiding obstacles and minimizing the costs (time, distance, risks, fuel, price, etc.). Algorithm Visualization shows a continuous, movie-like presentation of an algorithm’s operations.
Explaining difficult pieces of algorithms code is a challenge in mathematical and computer education. Providing a view of the algorithms inner working details by visualization of algorithm steps aims at making it more understandable
This algorithmworks by propogating outwards until it finds the finish and then working its way back to get the path. It uses a priority queue to keep track of nodes that it needs to explore. Each node in the priorty queue is explored and all of its neighbors are added to the queue and once the node is explored it is deleted from the queue.
A* Search workds essentially the same as Dijkstra creating a priorty queue and propogating outwards until it finds the end however, A* builds in a heuristic of distance from any node to the finish. This means that nodes that are closer to the finish will be explored first. This heuristic is built in by sorting the queue according to the hops plus distance until the destination. Although being the best path finding algorithm around, A* Search Algorithm doesn’t produce the shortest path always, as it relies heavily on heuristics / approximations to calculate – h
Dashboard
Example when we visualize using Dijsktra Algorithm
Example when we visualize using A* Algorithm