A visual demonstration of maze-solving algorithms (DFS, BFS, and A*) built using SFML 3.0.0. It features random maze generation and a UI window to visualize how different algorithms explore and solve the maze.
- ✅ Uses only SFML 3.0.0 – no deprecated or 2.x APIs
- 🎲 Random maze generated every run
- 🧭 Choose from:
- DFS (Depth-First Search)
- BFS (Breadth-First Search)
- A Search*
- 🖼️ Visual representation of:
- Walls and free paths
- Visited cells
- Final path from start to end
- ⌨️ CLI selection with separate UI windows for input preview and final output
- Black: Wall
- White: Free path
- Green: Start
- Magenta: End
- Red (semi-transparent): Visited
- Blue: Final path
- Install SFML 3.0.0
- Link SFML include and lib directories in your C++ compiler (Visual Studio recommended)
- Compile with
sfml-graphics,sfml-window, andsfml-systemlinked
- C++ > General > Additional Include Directories →
SFML-3.0.0/include - Linker > Input > Additional Dependencies:
sfml-graphics.libsfml-window.libsfml-system.lib
- On running, an initial maze preview window opens for 6 seconds.(You can change it according to your preference)
- You are prompted in the CLI:
Choose Algorithm:
1 - Depth-First Search (DFS)
2 - Breadth-First Search (BFS)
3 - A* Search
Enter option (1/2/3): - The final maze solving visualization window opens.
- Press ESC to close the visualization.
- Explores deeply along one path until dead-end.
- Fast but may not find shortest path.
- Explores level by level.
- Guarantees shortest path in unweighted graphs.
- Heuristic + cost-based search (Manhattan distance).
- Balances exploration speed and path optimality.
main.cpp– core logic and rendering- SFML 3.0.0 – must be linked externally
Developed as part of a minor project using modern SFML.
- Maze is generated with multiple paths to allow variation in algorithm decisions.
- UI completely avoids SFML 2.x constructs like
sf::Event.