This project features the implementation of two distinct architectural strategies for a Depth-First Search (DFS) reflex agent designed to navigate and solve maze environments within the UC Berkeley Pacman AI framework.
Note: This framework is natively built using Python 2. Running the simulation using Python 3 will result in a
SyntaxError: Missing parentheses in call to 'print'. Please ensure you have Python 2.7 installed on your machine to execute the agents successfully.
- Concept: Implements standard depth-limited DFS using pure recursion.
- Mechanism: Tracks visited nodes and leverages the implicit system call stack to manage backtracking behaviors across maze branches.
- Concept: Implements DFS using an explicit stack array.
- Mechanism: Simulates recursion manually by managing an explicit Python
listas a stack structure, allowing control over memory boundaries and deeper maze state evaluations.
- Both strategies are integrated into a unified agent execution loop.
- A runtime toggle is supported via standard command-line arguments.
Both configurations were execution-tested 10 times across multiple maze topologies (open, medium, and tiny layouts) to benchmark:
- Total visited nodes and routing paths.
- Execution runtime efficiency.
- System call stack depth vs. explicit memory footprint.
git clone [https://github.com/MariamAshraf25/recursive-vs-stack-dfs-reflex-agent.git](https://github.com/MariamAshraf25/recursive-vs-stack-dfs-reflex-agent.git)Mariam Ashraf | Computer Engineering Student | Faculty of Engineering - Capital University (Formerly Helwan)
LinkedIn Profile