Skip to content

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

 
 
 

Contributors

Languages