Visualize, bechmark and play with different pathfinding algorithms in a highly customizable grid layout.
This project aims to provide a fancy graphical visualization for pathfinding algorithms while providing highly customizable case layout. New commers to the field of A.I., particularly pathfinding problems, can use this application to help them with not only visualizing how the algorithms work but also with identifying the strengths and weaknesses of each algorithm. This way one can know whe to use algorithm X instead of algorithm Y.
Pathfinding problems are especially interesting in game developement. This application can help you understand how these algorithms work and how different parameters affect their performance.
This project provides a graphical grid layout on which each case can be either:
- a wall : a wall case is a blocking case, the pathfinding algorithm cannot pass through such case.
- NOT a wall : the pathfinding algorithm can pass through such case.
Depending on the chosen algorithm, its goal can be to find either:
- shortest path to target case.
- any path to target case.
The algorithm cannot pass to a neighboring diagonal case. It can only pass to adjacent neighboring cases as the picture below shows.
The cost of moving from one case to another adjacent case is 1.
-
case layout (size and walls placement) is customizable. Currently only limited to square layouts.
-
option for random wall placement is provided in case the user doesn't want to place walls.
-
user choses the starting case and target case.
-
user can chose between numerous pathfinding algorithms. Currently supported algorithms are:
- DFS
- BFS
- A* (with custom heuristic function)
-
if benchmark option is enabled, stats about the algorithm are shown once execution ends. In order for benchmarking to be accurate, this option disables a lot of other features such as: speed of execution, graphical updates, etc...
-
if becnhmark option is disabled, the speed of execution of the chosen algorithm is modifiable. This is helpful to graphically show the step-by-step progress of the algorithm.
-
install SDL2.0 (see official webpage for the how-to)
-
run these commands in root directory:
make pathfinder ./pathfinder
Any contribution are more than welcome! Add an issue or open a pull request 🙂.
MIT. See LICENSE for details.