This repository contains a C++ implementation of the A* pathfinding algorithm. A* is a widely used algorithm for finding the shortest path between two points on a graph, considering both the cost to reach the point and a heuristic that estimates the cost from the point to the goal.
- A* ensures an efficient and optimal pathfinding algorithm.
- Users can easily customize the heuristic function according to the specific requirements of their application.
- The implementation supports various graph representations, allowing users to adapt it to different scenarios.
C++ compiler (supporting C++11 or later)
git clone https://github.com/amandeepsirohi/A-Star-CPP.git
cd A-Star-CPP
g++ a_star.cpp -o astar
./astar
To customize the heuristic function, modify the heuristic function(calcHVal) located in a_star.cpp.
double calcHVal(int row, int col, Pair dest)
{
return ((double)sqrt((row - dest.first) * (row - dest.first) +
(col - dest.second) * (col - dest.second)));
}