Skip to content

madelinegtj/maze_simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Build a Maze Solver

Use Python and Tkinter to build a GUI that solves mazes.

Maze Solver

Description

This project implements a Maze Generator and Solver using a depth-first search (DFS) algorithm. The maze is created using randomized wall-breaking and can be solved using recursive backtracking. The project includes visualization features to show the process of both maze generation and solving.

Features

  • Randomized Maze Generation: Using depth-first search (DFS) to break down walls and generate a maze. The entrance is at the top-left corner (0, 0), and the exit is at the bottom-right corner (n-1, n-1).
  • Recursive Maze Solving: After generating the maze, the solver will attempt to find a path from the entrance to the exit using a recursive DFS method.
  • Visualization: The maze generation and solving steps are visualized, providing insight into the algorithm's process. Each move and backtrack will be visualized step by step

Technologies Used

  • Python: The core language for the implementation.
  • Recursive Algorithm: Both the maze generation and solving use depth-first recursive methods.
  • Random Module: Used for generating random directions during maze creation.
  • Visualization Library (Optional): Use any graphics library (e.g., Pygame, Tkinter) to visualize the maze.

Project Setup

1. Clone the repository:

git clone https://github.com/yourusername/maze-solver.git
cd maze-solver

2. Run the Program:

python main.py

3. Optional - Customize Parameters:

  • Modify the number of rows and columns to change the maze size.
  • Use the seed parameter in the constructor for deterministic random behavior (useful for debugging).

Ideas for Extending the Project:

  • Add other solving algorithms, like breadth-first search or A*
  • Make the visuals prettier, change the colors, etc
  • Mess with the animation settings to make it faster/slower. Maybe make backtracking slow and blazing new paths faster?
  • Add configurations in the app itself using Tkinter buttons and inputs to allow users to change maze size, speed, etc
  • Make much larger mazes to solve
  • Make it a game where the user chooses directions
  • If you made it a game, allow the user to race an algorithm
  • Make it 3 dimensional
  • Time the various algorithms and see which ones are the fastest

About

Python code that draws a randomized maze and then systematically solves it using recursive DFS algorithm.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages