Assigned: September 13, 2006
Due: October 2, 2006 (before class, via dropbox)
Give the initial state, goal test, successor function, and cost function for each of the following. Choose a formulation that is precise enough to be implemented.
(a) As some sort of "joke", your roommate placed your last bottle of soda at the very top of your highest bookshelf. Having somehow missed out on the tall genes in your family, you are not able to reach the bottle without a little help from your furniture. The only things not nailed to the floor are your mini fridge and a chair. You are thirsty and want to get your bottle down. The height of the mini fridge is 1 foot, the chair 2 feet, and the book shelf 9 feet. You are only 5 feet tall but can reach to 6 feet. You are at your door, and your items are not yet stacked on one another.
(b) Most of you who have been on a road trip have probably played the following 2-player game. You start with a set X of actors. The first player names an actor x1 who is an element of X, and the other player names an actor x2 who is also an element of X (but not x1) who has appeared in a movie with x1. The first player must then name an actor x3 who has appeared in a movie with x2, and so on. So the two players generate a sequence of actors such that each actor in the sequence has co-starred with the actor immediately preceding. A player loses when it's his or her turn to move, and s/he cannot name an actor of X who hasn't been named before. You are given a set of actors X, with complete information on who has appeared in a movie with whom, and you want to determine how to win the game.
Russell and Norvig problem 3.8 (page 90), parts (a) and (b) only
Consider a graph with nodes A, B, C, D, E, F, G, and S. The start state is S and the goal state is G. The edges in the graph are as follows: (A,B,4), (A,D,5), (A,S,2), (B,C,4), (B,E,6), (B,F,3), (C,G,1), (D,E,3), (D,S,3), (E,F,4), (F,G,5). (The notation (A,B,4) means that there is an edge between nodes A and B, and that the cost of traveling that edge is 4.)
Nodes should be expanded alphabetically if two or more nodes have the same evaluation cost. Use the following table for the heuristic function:
n | S | A | B | C | D | E | F | G |
h(n) | 10 | 7 | 3 | 1 | 5 | 4 | 2 | 0 |
(a) Use Uniform Cost search to
i. List the nodes in the order they would be generated.
ii. List the nodes that lie along the final correct path to the goal.
(b) Same as (a) but use Greedy Best First search.
(c) Same as (a) but use Recursive Best First search.
Consider a sliding block puzzle with the following initial configuration:
|B|B|B|W|W|W|E|
There are 3 black tiles (B), three white tiles (W), and an empty cell
(E).
The puzzle has the following moves:
The goal of the puzzle is to have all of the white tiles to the left of all the black tiles (without regard to the position of the blank cell). There are many possible ideas for a heuristic. One could be #white tiles to right of leftmost black tile.
(a) Is the given heuristic admissable? Why or why not?
(b) Using the given heuristic, show the first 10 generated nodes produced by the A* algorithm.
One goal of this assignment is to give you experience with heuristic search algorithms by comparing alternative search strategies and experimenting with heuristic evaluation functions. Another goal is to give you experience writing a report that logically argues for the relative strengths and weaknesses of algorithms for a problem, and clearly describes their properties. Your work will be graded for correctness, completeness, clarity, and the logic of your presentation.
Your report should first show that your implementation of the 8-puzzle works correctly. That is, demonstrate that your successor function, goal test, cost function, and heuristic functions work correctly by showing pieces of a script of your code running in a verbose mode (i.e., with extra print statements). Please include just enough to convince us your code works, and please be sure this is readable (add comments to the file to tell us what we are looking at, if it isn't obvious).
Your report should next present your results of running treesearch (not graphsearch) versions of iterative-deepening-search and A* search with the two heuristics noted above. To do this, your algorithms should be run on multiple start states, using the following code from Mahmoud:
Your report should compare the various search algorithms and heuristics, supporting your arguments with statistics and observations from your runs. Your statistics should minimally include the maximum fringe size and the number of nodes generated during a search process. In your report, you can report raw counts, averages, as well as averages as a function of optimal solution length (similarly to Figure 4.8 on page 107 of R&N).
Other ideas for discussion in your report: What are the properties of the problem? That is, how big is the search space? What is the average branching factor? What are the strengths and weaknesses of each algorithm for this problem, and why?