- Author: Quan Hoang Ngoc
- Course: Assignment 1
- Semester: HK2, 2024
This project explores the implementation of search algorithmsβDepth-First Search (DFS), Breadth-First Search (BFS), and Uniform Cost Search (UCS)βto solve the Sokoban game, which is modeled as a search problem. The main aim is to investigate their effectiveness through detailed experimentation and statistical analysis.
- Educational Purpose: To gain hands-on experience with classic search algorithms and their applications in solving real-world problems, specifically within the context of the Sokoban game.
- Comparative Analysis: To evaluate the strengths and weaknesses of DFS, BFS, and UCS in tackling Sokoban, with the goal of determining the most efficient algorithm.
This project is ideal for:
- Students: Those studying algorithms and AI who want a practical understanding of search techniques.
- Game Developers: Individuals looking to implement AI solutions in gaming.
- Hobbyists: Anyone interested in the intersection of algorithms and puzzles.
- Watch the video demonstration: Application DFS BFS UCS for Sokoban Game - Modeling Search Problem - [AI course - CS106 - UIT]
- RESOURCES: Contains project guidelines, documents, and reports.
- SOURCE CODE: Includes the implementation code.
- Backup: OneDrive Backup of Project Files
- Implementation: Developed the DFS, BFS, and UCS algorithms in Python, including comprehensive comments and documentation.
- Libraries Used: Integrated
pygame
andpyautogui
for interactive gameplay. - Experimental Framework: Conducted extensive experimentation and statistical analysis using Kaggle Colab P100 with 29GB RAM for optimal performance evaluation.
- Presentation: Compiled findings into a detailed project report outlining experiment goals and results.
- Download the source code from the repository.
- Run
Sokoban.py
to play the game. - Modify the configurations in
constants.py
for customized gameplay. - The project follows the MVC architecture: with the View defined in
Sokoban.py
and the Controller inGame.py
. - Alter algorithms in
solver.py
under theauto_move()
function to experiment with different approaches.
- Python >= 3.0
pygame
pyautogui
- Enhanced understanding of various search algorithms and their applicability to complex problems.
- Insights into performance trade-offs between different algorithms (DFS, BFS, UCS) when solving puzzles.
- Gained practical programming experience in Python, as well as collaboration skills through project structure and documentation.
- Successfully implemented and tested multiple search algorithms for the Sokoban game, with UCS identified as the most efficient.
- Developed a comprehensive experimental framework that highlights the importance of choosing appropriate algorithms based on problem constraints.
If you find this project useful, please consider giving it a star β to support further development. Your support inspires continued knowledge sharing and project enhancement. Thank you!