This project implements various search algorithms to find the optimal path through a maze with bonus points.
The maze is represented as a 2D grid where:
S: Starting positionx: Walls (impassable)+: Bonus points (reduce path cost)exit: Goal position (unique)
The agent can move up, down, left, or right with equal cost.
- Depth First Search (DFS)
- Breadth First Search (BFS)
- Greedy Best First Search
- A* Search
Each maze file follows this structure:
- First line: Number of bonus points (n)
- Next n lines:
x y z(x,y coordinates and z value of bonus point) - Remaining lines: Maze layout
S: Start positionx: Walls+: Bonus points- The exit is implicitly defined (e.g., position [2,0] in the example image)
Run the algorithms using the following command structure:
-
For algorithms with heuristics:
python3 [algorithm].py [map].txt [heuristic]
-
For algorithms without heuristics:
python3 [algorithm].py [map].txt
-
For algorithms with heuristics:
python3 [algorithm].py [map].txt [heuristic]
-
For maps with bonus points:
python3 [algorithm].py [map].txt
Replace [algorithm], [map], and [heuristic] with appropriate filenames.
[Add installation instructions here]
[List any dependencies or system requirements]
[Add contribution guidelines here]
[Add license information here]
[Add any acknowledgements or credits here]
