This repository contains an implementation of the A* (A-star) algorithm in C++. The A* algorithm is a widely used pathfinding algorithm that combines the best features of Dijkstra's algorithm and greedy best-first search to find the shortest path between two nodes in a graph.
This repository contains an implementation of the A* (A-star) algorithm in C++. The A* algorithm is a widely used pathfinding algorithm that combines the best features of Dijkstra’s algorithm and greedy best-first search to find the shortest path between two nodes in a graph.
To demonstrate the usage of the A* algorithm implementation, here’s an example run:
#define ROW 10
#define COL 10
int maze[ROW][COL] =
{
{0, 0, 0, 1, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 1, 0, 1, 0},
{0, 0, 0, 1, 0, 0, 1, 0, 1, 0},
{0, 0, 0, 1, 0, 1, 1, 0, 1, 0},
{0, 0, 0, 1, 0, 1, 0, 0, 1, 0},
{0, 0, 0, 1, 0, 1, 0, 0, 1, 0},
{0, 0, 0, 1, 0, 0, 0, 0, 1, 0},
{0, 0, 0, 1, 0, 0, 1, 0, 1, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 1, 0}
};

We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.