From: baranskj@cecs.pdx.edu Sent: Monday, January 17, 2005 9:20 PM To: Marek Perkowski Subject: ECE478 HW # 2 Attachments: ece478hw2.lisp Dr. Perkowski, Overview: My print functionality is lacking. The solution is great, but I do not have great printing. Attached is my solution to homework # 2. It can be simulated by compiling the file & then making the following call: (run-breadth '(i j)) where i and j are the respecitve row and column coordinates where you want the robot begin. For the matrix & solution I generate in code a couple of starting points may be: (run-breadth '(3 1)) -or- (run-breadth '(2 1)) Algorithm: I decided to use the breadth-first search to get out of the maze. Basically begining at the starting node, each possible movement (north, south, east, & west) are evaluated. The robot then stores all possibilities in memory using parent-child coordinate pairs. Next the robot evaluates its next move from all of the good possibilities (0's at child coordinate locations). It recursively does this until it finds the path to the condition where there is 0 on the boundary of the maze. When it finds it's way out of the maze, it then recalls the correct solution by retrieving the parent node of the exit cell. The it retrieves that parent's parent, ect. until the starting node is found. Now the robot has escaped from the maze and recalled the minimum sequence of events that it used to get there (*minimum IT used, not the global min solution). In reality, it seems that an animal or human would use the depth first search following a path until either success or failure is reached & then backtracking & following the next path. I was going to implement depth-first as well as best search algorithms, but ran out of time due to deadlines in other classes as well as homework 3 for this class. The code won't need to be adapted much to implement depth-first, so I will do that if I have spare time in the term, or I will use this as a starting point should I need to implement depth-first elsewhere. Joey Baranski