Assignment5 Ques
Assignment5 Ques
A* Search
Instructions:
1. The assignment should be completed and uploaded by the deadline.
2. Please make a detailed report in PDF format for the assignment.
3. Markings will be based on the correctness and soundness of the outputs. Marks
will be deducted in case of plagiarism.
4. Proper indentation and appropriate comments are mandatory.
5. You should zip all the required files and name the zip file as:
roll_no_of_all_group_members.zip , eg. 2301cs11_2301cs03_2321cs05.zip.
6. Upload your assignment (the zip file) in the following link:
https://tinyurl.com/34kb4d5n
For any queries regarding this assignment, you can contact:
Utsav Kumar ([email protected])
—------------------------------------------------------------------------------------------------------------------
The Lost Artifact
Scenario Overview
The ancient city of Eldoria holds a powerful artifact hidden deep within its ruins. A group of
explorers, led by Agent X, is on a mission to retrieve it. The city is represented as a grid-based
map, where:
Agent X must find the optimal path using the A search algorithm*. The movement cost differs
based on terrain type:
Terrain(notation)(Cost)
Path (1)(1)
Water (W)(3)
Mountain (M)(5)
Output:
● Track the matrix at each time step.
● If a path exists, output the optimal path.
○ "Path exists, optimal path:"(e.g., [S → Location_1 → Location_2 → G]).
● If no path exists return a failure message.
○ “Path not found"
Sample Input:
N = 5, M = 6
grid = [
['S', '1', '1', '1', '0', 'G'],
['1', 'W', '0', '1', 'M', '1'],
['1', '1', 'M', '1', '1', '1'],
['0', '1', '1', '1', '0', '1'],
['1', '1', 'W', '1', '1', '1'],
]
Sample Output:
https://docs.google.com/document/d/1vsctqEhVuspdybkfOVfBFQJZt8DWUnqDVpcIiV6PE7s/edit?usp=
sharing
Question: