Skip to content

A visualizer for pathfinding algorithms built with Python and Pygame. Features Breadth-First Search, Depth-First Search, and A* search, along with a random maze generator.

Notifications You must be signed in to change notification settings

JvFg92/Maze_Solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ—บ๏ธ Maze Solver Visualization ๐Ÿงฉ

This project provides a visual demonstration of popular pathfinding algorithms navigating through mazes. Watch Breadth-First Search (BFS), Depth-First Search (DFS), and A* (A-star) in action as they find the shortest path from a start to an end point in a dynamically generated or predefined maze!

โœจ Features

  • Visual Maze Representation: Displays the maze grid, walls, open paths, start (๐ŸŸข), and goal (๐Ÿ”ด) points.
  • Algorithm Visualization:
    • See visited cells (๐ŸŸง) as the algorithm explores.
    • Watch the final path (๐Ÿ‘ฃ/๐ŸŸฆ) being drawn.
  • Multiple Algorithms: Choose between:
    • ๐Ÿž Breadth-First Search (BFS)
    • ๐ŸŒฒ Depth-First Search (DFS)
    • โญ A* Search (using Manhattan distance heuristic)
  • Dynamic Maze Generation:
    • Starts with a predefined maze.
    • Generate new, random, solvable mazes with a click (๐Ÿ†•).
  • Interactive Controls:
    • Buttons to select algorithms.
    • Button to generate a new maze.
  • Step Counter: Track the number of steps (๐Ÿ”ข) each algorithm takes to find the solution or explore.
  • Step-by-Step Animation: Clearly visualizes the decision-making process of each algorithm, making it a great educational tool.

๐Ÿ“ธ Demo

Example placeholder:

Screencast-2025-07-07-14_58_06

๐Ÿ› ๏ธ Technologies Used

  • Python 3.12 (๐Ÿ)
  • Pygame (๐ŸŽฎ): For graphics, event handling, and the main game loop.
  • Asyncio (โณ): For managing the asynchronous main loop, allowing for smooth step-by-step visualization.
  • Standard Python libraries: collections.deque, heapq, random.

๐Ÿš€ Setup & Installation

  1. Clone the repository:

    git clone https://github.com/JvFg92/Maze_Solver
    cd Maze_Solver
  2. Install dependencies (Pygame is the main external library):

    pip install pygame

    (If you don't have pip, ensure you have Python installed and look up how to install pip for your system.)

โ–ถ๏ธ How to Run

Once Pygame is installed, navigate to the directory containing solve.py and run:

python solve.py

About

A visualizer for pathfinding algorithms built with Python and Pygame. Features Breadth-First Search, Depth-First Search, and A* search, along with a random maze generator.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages