This repo consists of the code for implementing a shortest path using heuristic approach called A* and dijkstra. SFML is used to visualize the operation of searching and tracing the shortest path in the grid map.
Use a following command to clone the repository.
git clone https://github.com/love481/A_Star-Algorithm.git
sudo apt install cmake
Navigate to the folder and run:
cmake .
make && ./a_star
In order to run as dijkstra algorithm go to file aStar.cpp and comment line 81 and uncomment line 82 as :
//f_map[i][j] = g_map[i][j] + calculateHeuristicValue(i, j); //A* algorithms
f_map[i][j] = g_map[i][j]; //Dijkstra algorithms
A_Star-Algorithm
Dijkstra-Algorithm
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.