guuslammers / Pathfinder

Pathfinding algorithm visualizer. Allows the user to set start and end points and any obstacles in between. Implements Dijkstra's, A*, and Best First Search.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pathfinder

This is a visulaization tool that compares Dijkstras search, A* search, and Best First Search pathfinding algorithms.

It allows the user to place the start node (green), end node (red), and barriers (black) anywhere on the grid. When the algorithm is activated it attempts to find the shortest path between the start and end node. A picture showing the shortest path is shown below.

If you would like to see a visual of the search algoritms running there is a video in the video folder of this repository showing the algorithms searching through different mazes!

What I Learnt

  1. Used Pygame to build visualiztion GUI.
  2. Built graph by creating a custom Node class.
  3. Implemented the following path finding algorithms:
    • Dijkstra's (Breadth First Search).
    • A* (Guided search using manhattan heuristic).
    • Best First Search (Greedy search using manhattan heuristic).

User Instructions

  1. Download the main.py file and store it somewhere on your computer.
  2. To run the code you will need to create a Python environment and install pygame by opening your terminal and typing 'pip install pygame', this is the only external library you should need.
  3. Run the program from within your IDE or from the command line.
  4. To place the start node, end node, and barriers simply right click on the d=grid where you would like the node to be placed. To remove any nodes you can erase them by left cleft clicking.

About

Pathfinding algorithm visualizer. Allows the user to set start and end points and any obstacles in between. Implements Dijkstra's, A*, and Best First Search.


Languages

Language:Python 100.0%