Skip to content

love481/A_Star-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A* and dijkstra Algorithms

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.

Installation

Use a following command to clone the repository.

git clone https://github.com/love481/A_Star-Algorithm.git
sudo apt install cmake

Usage

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

Demo

A_Star-Algorithm

image

Dijkstra-Algorithm

Screenshot from 2022-02-11 14-02-45

Contributing

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.

License

Apache

About

This is a shortest path algorithm implemented using a 2d graph based occupancy grid map

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages