Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧩 AI Pathfinding Visualizer (BFS Algorithm)

An interactive grid-based pathfinding visualizer built with Python and Pygame. This project demonstrates how the Breadth-First Search (BFS) algorithm explores a search space and guarantees finding the optimal (shortest) path in an unweighted grid, even when faced with complex asymmetrical mazes.


πŸš€ Features

  • Real-time BFS Visualization: Step-by-step exploration of nodes across the grid space.
  • Guaranteed Optimal Path: Highlights the shortest route from the start node to the destination.
  • Custom Maze Layouts: Implements asymmetrical wall structures to showcase the difference between optimal and suboptimal paths.
  • Interactive UI: Dynamic rendering of visited nodes, active paths, and final route using Pygame.

πŸ› οΈ Tech Stack

  • Language: Python 3.12+
  • GUI Engine: pygame-ce (Pygame Community Edition)
  • Data Structures: Queue (deque), NumPy arrays

πŸ“¦ Installation & Setup

  1. Clone the repository: git clone https://github.com/shresthajitendra/AI-Pathfinding-Visualizer-Pygame.git

  2. Go to project directory: cd AI-Pathfinding-Visualizer-Pygame

  3. Install dependencies: pip install pygame-ce numpy

  4. Run the visualizer: python main.py


πŸ“œ Next Steps

  • Add Reinforcement Learning (Q-Learning) agent for comparative pathfinding.
  • Implement A* and Dijkstra algorithms.

About

This project is a Python and Pygame visualizer that demonstrates pathfinding in a custom asymmetrical maze using the Breadth-First Search (BFS) algorithm. Built on an 8x8 grid with hardcoded wall obstacles, it calculates the optimal route from start to goal and animates the step-by-step path discovery in real-time.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages