Skip to content

A small interactive program to visualize Dijkstra's algorithm, A* algortihm and Best first search algorithm.

License

Notifications You must be signed in to change notification settings

ishmamt/Pathfinder-Algorithm-Visualization

Repository files navigation

Pathfinder Algorithm Visualization

This project is made to understand how popular pathfinding algorithms work. Currently it can visualize:

  • Dijkstra's Algorithm
  • A* Algorithm
  • Best First Search Algorithm

It has a grid based system for drawing walls, placing starting and ending nodes or even generating a random maze.

Requirements

  • Install Python. I have used Python 3.8.1 but any version after Pyhton 3.5 would work. Download the latest version of Python from here.

  • Install Pygame library using pip. Use any command shell and use the following command:

    pip install pygame

  • If for some reason Tkinter is not installed in your system (usually it comes with Python). Use any command shell and use the following command:

    pip install tkinter

How to run it?

Compile and run main.py.

Features

  • A basic GUI that lets the user choose an algorithm, number of nodes in the grid and the speed of the visualization.

    The GUI implemented in the program to take user input

    User can choose one of three pathfinding algorithms.

    Dropdown for algorithm selection

  • It also provides a grid system where the user can:

    • Draw walls.
    • Draw start and end nodes.
    • Erase walls or start/end node.
    • Clear the grid
    • Generate random maze

    The grid system

    Drawing in the window is simplified for easier usage and intuitive.

    Drawing in the grid

  • The random maze generator randomly creates walls and paths. Usually the results are underwhelming as it's just random noise. Result of random maze generation

  • The path is highlighted if it is found. Path from start to end

Future Plans

I plan to implement better visualization measures to make it interactable in real-time. An online version of this would be nice as it would require no installations.

About

A small interactive program to visualize Dijkstra's algorithm, A* algortihm and Best first search algorithm.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages