(HK1 2425 - CSC14003) Project 1 - Search
(HK1 2425 - CSC14003) Project 1 - Search
(HK1 2425 - CSC14003) Project 1 - Search
Project 1. Search
Ares’s adventure
1 Introduction
According to legend, hidden deep in a faraway kingdom is a gate that leads to mysterious treasure.
It’s said that to open the gate, one must solve a maze by moving heavy stones onto secret switches.
Though this may sound simple, many have tried and failed, as the maze is very tricky, and moving
the large stones through tight spaces is tough. Even a small mistake could trap the challenger in
the maze forever.
One day, a young adventurer named Ares decided to face this challenge. He knew that success
would need careful planning, paying attention to every move, every details, and never giving up.
Your task is to help Ares on his adventure. Using the search algorithms you have learned in the
Introduction to Artificial Intelligence course, you must guide him through the challenging maze,
finding the path and positioning the stones on the switches to unlock the treasure gate.
Do you have the skills to help Ares conquer the maze and uncover the legendary treasure?
Begin the journey and show your intelligence!
2 Description
The maze is depicted as a grid of size n × m, where each cell represents either a free space, a wall,
a stone, or a switch. Ares (represented as an agent) can move one square at a time in 4 directions:
Up, Down, Left, and Right. He cannot pass through walls or stones.
If there’s a stone in the next space and the space beyond is free, he can push the stone there.
He cannot pull stones, and stones cannot be pushed into walls or other stones.
Figure 2: Ares pushing stones: (a) Valid move, (b) and (c) Invalid moves.
Each stone has a different weight, which means Ares must consider the most efficient way
to push the stones onto switches. Pushing heavier stones take more effort and limit his movement.
This introduces the need for an optimal strategy when deciding which stones to push and where.
The movement cost of Ares is calculated as follows:
• Each step Ares takes without pushing a stone incurs a base cost of 1.
• Pushing a stone increases the move’s cost according to the stone’s weight.
The objective is to push all stones onto the switches. Every switch can be activated by
any stone of any weight, and the number of stones always equals the number of switches.
3 Requirements
3.1 Input
Students are required to design at least 10 different input files, named according to the structure
input-01.txt, input-02.txt, ..., input-10.txt. Each input should have different parameters
such as the number of stones on the maze, the weight of each stone, or the structure of the maze.
The format of the input file is as described below:
• The first line contains list of integers representing the weights of each stone, in the order
they appear in the grid, from left to right and top to bottom.
• The following lines describe the grid itself using the following characters:
For example:
Figure 3: Example of a maze layout (left) and its corresponding input file (right).
3.2 Output
The output must be both visualized using a Graphical User Interface (GUI) to display the process
and saved as an output file. Below are the detailed output requirements:
• Output file:
The output files should be named following the format output-01.txt, output-02.txt, etc.
The content of each output file must include the following information:
For example:
BFS
Steps: 16, Weight: 695, Node: 4321, Time (ms): 58.12, Memory (MB): 12.56
uLulDrrRRRRRRurD
DFS
...
– The GUI must provide a visual representation all elements on the maze.
– The GUI must animate step-by-step the process of Ares moving through the maze and
pushing stones according to the solution sequence generated by the algorithm.
– Display statistics during, including the step count and the weight being pushed.
– A button should be provided to start or pause the animation, as well as a reset option
to restart the process. And a button to choose which algorithms for visualization.
3.4 Report
• Member information (Student ID, full name, etc.)
• Work assignment table, which includes information on each task assigned to team members,
along with the completion rate of each member compared to the assigned tasks.
• Description of the test cases and experiment results (memory usage, time complexity, etc.)
Highlight challenges and compare overall behavior of your algorithms.
• The report needs to be well-formatted and exported to PDF. If there are figures cut off by
the page break, etc., points will be deducted.
• In the video, students should start from compiling or running their code, then walk through
the key steps of the program’s execution to make it easy to follow.
3.6 Submission
• Your report, source code and test cases must be contributed in the form of a compressed file
(.zip, .rar, .7z) and named according to the format StudentID1 StudentID2 ...
• If the compressed file is larger than 25MB, prioritize compressing the report and source code.
Test cases may be uploaded to the Google Drive and shared via a link.
4 Assessment
No. Details Score
1 Implement BFS correctly. 10%
2 Implement DFS correctly. 10%
3 Implement UCS correctly. 10%
4 Implement A* correctly. 10%
5 Generate at least 10 test cases for each level with different attributes. 10%
6 Result (output file and GUI). 15%
7 Videos to demonstrate all algorithms for some test case. 10%
8 Report your algorithm, experiment with some reflection or comments. 25%
Total 100%
5 Notices
Please pay attention to the following notices:
• Any plagiarism, any tricks, or any lie will have a 0 point for the course grade.