Skip to content

A Python maze solver that uses both DFS (stack) and BFS (queue) to find a path from start to goal. It compares efficiency by tracking explored states and visualizes the final solution with a generated PNG output.

Notifications You must be signed in to change notification settings

iamrealadil/Python-Maze-Solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Python Maze Solver

A Python program that solves mazes using Depth-First Search (DFS) with a stack and Breadth-First Search (BFS) with a queue. It tracks explored states, finds the path from start to goal, and visualizes the solution as a PNG image.

Features

  • Solve mazes using DFS (stack) and BFS (queue)
  • Counts and displays the number of explored states
  • Visualizes the maze and solution path as an image
  • Easy to use with a text-based maze input

Usage

  1. Prepare a maze file (maze.txt) with:

    • A as the start point
    • B as the goal
    • # for walls
    • Space ( ) for open paths
  2. Run the solver:

python maze.py maze.txt

About

A Python maze solver that uses both DFS (stack) and BFS (queue) to find a path from start to goal. It compares efficiency by tracking explored states and visualizes the final solution with a generated PNG output.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages