Skip to content

Repository files navigation

AI Pathfinding Visualizer (Python)

An interactive pathfinding visualizer implemented in Python with Pygame.

What Changed

This project has been migrated from a JavaScript/React app to a Python desktop app. The algorithms and behavior are preserved, including:

  • BFS, DFS, A*, Hill Climbing, Best First, MiniMax
  • Best, Average, and Worst case modes
  • Interactive wall drawing and Start/End placement
  • Animated visited order and final path
  • Runtime metrics and time-complexity panel

Tech Stack

  • Python 3.10+
  • Pygame

Setup

  1. Create and activate a virtual environment (recommended):
python3 -m venv .venv
source .venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the visualizer:
python pathfinding_visualizer.py

Controls

  • Mouse Left: Draw/apply selected tool on grid
  • Mouse Right: Erase wall
  • 1-6: Select algorithm
  • B / A / W: Best / Average / Worst case mode
  • D / S / E: Tool = Wall / Start / End
  • Space: Visualize
  • C: Clear path animation
  • R: Reset entire grid
  • Up / Down: Increase or decrease animation speed
  • V: Show/hide heuristic values
  • Esc: Quit

Project Structure

.
├── pathfinding_visualizer.py
├── requirements.txt
├── assets/
├── ai-pathfinding-visualizer.jsx   # legacy JS source
├── src/                            # legacy JS source
├── package.json                    # legacy JS metadata
└── README.md

Notes

  • The Python app is now the primary implementation.
  • Legacy JavaScript files are kept for reference and can be removed later if you want a Python-only repository.

About

Interactive React-based pathfinding visualizer with BFS, DFS, A*, Hill Climbing, Best First, and MiniMax algorithms, featuring animated grid exploration, wall editing, and results analysis.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages