COMP 590-096 Fall 2011Assignment 1: Maze SearchDue date: September 27, 11:59PM![]() This assignment is adapted from Berkeley CS 188 projects. Part 1: Basic pathfindingTo begin with, you will consider the problem of finding a path through a maze from a given start state to a given goal state. This scenario is illustrated in the figure above, where the start position is indicated by the "Pacman" icon and the goal state is a dot. The maze layout will be given to you in a simple text format, where '%' stands for walls, 'P' for the starting position, and '.' for the goal (see sample maze file). For this part of the assignment, all step costs are equal to one.Implement the following search algorithms for solving different mazes:
Run each of the above algorithms on the small maze, medium maze, big maze, and the open maze. For each problem instance and each search algorithm, report the following:
Part 2: Search with different cost functionsIn general, we may want to penalize the agent differently for going to different maze cells. Consider the medium maze and these two cost functions:
Part 3: Search with multiple goalsNow we consider a harder problem of finding the shortest path through a maze while hitting multiple goals (that is, you want to make the Pacman, initially at P, eat all the dots). Here is a sample problem instance. Once again, in this part, we assume unit step costs.Revise your code from Part 1 to deal with this scenario. This will require changing the goal test (have you eaten all the dots?) and the state representation (besides your current position in the maze, is there anything else you need to know?). Run the four search algorithms from Part 1 on the tiny search, small search, and tricky search. For each search method and problem instance, report the solution cost and number of nodes expanded. You will be surprised how inefficient the uninformed searches are even on the very small problems! For the uninformed searches, feel free to put some reasonable upper limit on the number of nodes expanded, and quit without reporting a solution if this limit is exceeded. To be able to find a solution in a reasonable amount of time, it is crucial to design a good heuristic. You should spend some time thinking about this. In the report, discuss the heuristic that you chose and explain why it is admissible. Feel free to propose multiple heuristics and show results for all of them. For reference, my implementation of A* search on the tricky search found a path of length 61 after expanding around 7600 nodes. Try to design a heuristic that will do even better! Part 4 (bonus): Suboptimal searchSometimes, even with A* and a good heuristic, finding the optimal path through all the dots is hard. In these cases, we'd still like to find a reasonably good path, quickly. Write a suboptimal search algorithm that will do a good job on medium search and big search. To get bonus points, you should be able to find a path of length around 350 on the big search after expanding around 700 nodes (of course, you're welcome to try to do even better than that!).Tips
Submission InstructionsYou will need to turn in the following:
Submit both your files through Blackboard as follows:
Late policy: You lose 25% of the points for every day the assignment is late. If you have a compelling reason for not being able to submit the assignment on time and would like to make a special arrangement, you must let me know at least a week before the due date (any genuine emergency situations will be handled on an individual basis). Academic integrity: Feel free to discuss the assignment with each other in general terms, and to search the Web for general guidance (not for complete solutions). Coding should be done individually. If you make substantial use of some code snippets or information from outside sources, be sure to acknowledge the sources in your report. |