Skip to content

ShayF0x/MazeSolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧩 Maze & Graph Visualizer

A Python application created for educational purposes to visualize and understand mazes and graphs through interactive algorithms and animations.

app image


📚 Project Context

This project was developed as part of a university course aiming to demystify the concepts of mazes and graphs through interactive and visual tools. The goal was to create a pedagogical application that helps users understand:

  • How mazes can be generated using algorithms
  • How they can be modeled as graphs
  • How different pathfinding algorithms behave in real time

The emphasis was on interactivity, clarity, and educational value, making the tool suitable for students, teachers, and anyone curious about graph theory and algorithmic thinking.

The project was designed from scratch in Python using Tkinter for the interface and Pillow for image processing in a special "museum mode".

By combining algorithm animation, graphical customization, and an intuitive user experience, the project serves both as a learning support and a playground for experimentation.

Summary

(back to top)

🧠 What It Does

This application allows you to:

  • Generate mazes using the Randomized Kruskal’s Algorithm
  • Convert the maze into a graph and visualize the connections between nodes
  • Solve the maze using:
    • Depth-First Search (DFS)
    • Breadth-First Search (BFS)
    • A-Star (A*)
  • Customize and interact with the maze:
    • Pause the animation
    • Draw your own walls manually
    • Speed up / slow down the animation
    • Switch to a "Museum mode" for a themed visualization (Joconde, marble walls, etc.)

(back to top)


🖥 Interface Overview

  • The maze is displayed as a grid.
  • Green cell = Start
  • Red cell = End
  • Black cells = Walls
  • Use buttons on the left to select an algorithm or generate a maze.
  • Use the right panel to convert to a graph or reset.
  • Bottom-right has a delay slider and pause/play controls.

To exit or change display modes, go to SettingsExit or Modes.

(back to top)


🧩 Algorithms Explained

This method starts with all cells as walls and connects them step by step using a randomized union of cells that doesn't form cycles, creating a perfect maze (one path between any two points).

DFS explores as far as possible along one branch before backtracking. This results in a very "depth-oriented" path, which may not be the shortest.

  • Stack-based approach
  • Not optimal (may not find shortest path)
  • Fast and intuitive

BFS explores all neighbors at the current depth before going deeper. It guarantees the shortest path in an unweighted graph.

  • Queue-based
  • Guarantees optimal path
  • Slower than DFS in wide graphs

A* uses a heuristic to prioritize paths that are likely to lead to the goal quickly. It’s the fastest and most efficient for many cases.

  • Uses f(n) = g(n) + h(n):
    • g(n) = cost from start to current
    • h(n) = estimated cost to goal (Manhattan distance)
  • Optimal and efficient

Each algorithm is visualized step by step, so you can see it in action!

(back to top)


🎨 Museum Mode

Activate a themed view:

  • Start cell becomes a Mona Lisa
  • End cell becomes a museum door
  • Walls look like dark marble blocks
  • Paths are replaced with museum floor tiles

(back to top)


📦 Installation & Requirements

This project uses Python and relies on:

  • tkinter
  • Pillow

Install dependencies with:

pip install -r requirements.txt

Then run the app with:

python src/app.py

Recommended for Python 3.10+

(back to top)

📝 License

This project is under the MIT License.

(back to top)

About

A Program to show simply algorithms to generate and resolve some maze

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages