You are on page 1of 1

DEPARTMENT OF INFORMATION TECHNOLOGY, NITK SURATHKAL

IT255 AI Assignment - 1

Due Date: 06.03.2024 Marks: 10


Semester: IV Academic Year: 2023 - 2024

Maze Solver:
The maze problem has roots as deep as the Greek myth about Theseus who was sent
into a maze to kill the minotaur. Theseus used a ball of thread to help him find his
way back out again once he had finished off the beast. The problem we want to solve
is to guide a special agent through a maze (given below), beginning at source
location S and reaching some destination location D, taking a shortest path. Based on
a pre-processed satellite images of the maze, where the walls of maze are stored as
'#' and the paths are stored as ' ', you want to provide the directions that the special
agent, who has been air-dropped to the source location within the maze, can take to
reach the destination location with the shortest distance because time is critical. The
agent can only move upwards, downwards, leftwards and rightwards and can only
move to walkable path. The agent cannot move outside the grid as he may be shot by
the attackers.
Write programs that calculate the shortest path for the agent to move from source S
to destination D using Depth-First Search (DFS), A* Search, and Greedy Search
algorithms. Analyze their performance.

### #########
# ################### # #
# #### # # # #
# ################### # # # #
# # # # #
##################### # # # #
# ## # # # #
# # ## ### ## ######### # # #
# # # ##D# # # #
# # ## ################ # # #
### ## #### # # #
### ############## ## # # # #
### ## # # # #
###### ######## ####### # # #
###### #### # #
S ######################

You might also like