Skip to content

A 2D visualizer using A*, UCS and Greedy algorithms to find a path to goal

License

Notifications You must be signed in to change notification settings

RandomUserUsingGitHub/PathPlanning2D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

Implementation of the a* algorithm alongside ucs and greedy algorithm

The a* algorithm is an algorithm used to find the best route in a subset of a graph. This algorithm is related to ucs, greedy algorithm and dynamic programming. It helps determine how to reach a target path in an efficient manner. Essentially, this algorithm can be used for pathfinding and finding the best solution to a problem.

In general, the a* algorithm is considered more efficient than ucs and greedy algorithm. However, there are situations where ucs and greedy algorithm are more efficient than the a* algorithm. For instance, if you are only looking for a short path from one node to another, the a* algorithm may not be as efficient as an initialized UC tree. However, for long paths or paths that lead to many nodes, the A*, greedy or random search algorithms may be more efficient.

Results

Alt Text

Options

6jILue.png

a* mode - - - - - - - - - - - - -> press 1
ucs mode - - - - - - - - - - - -> press 2
greedy mode - - - - - - - - -> press 3
remove walls - - - - - - - - -> press w
allow diagonal - - - - - - - -> press d
exit the app - - - - - - - - - -> press q

  • Total length from agent to goal, gets calculated (only if there is a possible route)
  • Total time taken by the execution of the selected algorithm gets calculated
  • You can also set the output ratio and size from the code on Visual.h

Requirements

Build

To compile and build the code, just put make in the terminal and press enter. To clean it up, just type make clean and you are good to go.

About

A 2D visualizer using A*, UCS and Greedy algorithms to find a path to goal

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published