A* , Best First Search , Bidirectional BFS , Dijkstra , BFS , DFS
-
First, choose the source node "colored green"
-
Then, choose the destination node "colored blue"
-
After that, you can choose any number of nodes to be blocks "colored red" except the starting and ending nodes
-
Press
- 'A' to run A*
- 'T' to run Best First Search
- 'I' to run Bidirectional BFS
- 'J' to run Dijkstra
- 'B' to run BFS
- 'D' to run DFS
-
If there is a path from the source to the destination,
- After running DFS, the destination node will be colored yellow
- After running any other algorithm, all the nodes in the path will be colored yellow showing the exact shortest path
-
Wait until the current algorithm's visualization is finished
-
Then,
- If you want to run another algorithm on the same maze, press the letter of the wanted algorithm
- press 'R' to reset the maze
-
Change sleepingTime constant variables accordingly to increase/decrease the speed of the visualization of an algorithm or the speed of backtracking the path
-
It should be noted that shortest path algorithms here can simply be replaced by BFS because there are no weights, but the main purpose is to visualize the algorithms and get a better understanding of how they work.
-
Project was made using SFML C++
-
NOTE : Algorithms are visualized in the above order