Assigned: October 2, 2017
Due: October 16, 2017
Suppose you are in an initial state where you have a stack of alphabet blocks, where B is the bottom black, A is the top block, and the full order of the blocks from bottom to top is B, C, D, E, F, G, H, A. The goal state is to have an alphabetized stack, such that A is the bottom block and H is on the top (e.g., the full order is A, B, C, D, E, F, G, H). To get from one state to another, you can move a block off the top of a stack to either the table, or to the top of another stack.
Let heuristic function H1 count +N for every block that sits on a correct stack of N things, and count -N for every block that sits on an incorrect stack of N things. The goal state has the value +28, and the initial state has the value -28.
Let heuristic function H2 count +1 for every block that sits on the correct thing, and count -1 for every block that sits on an incorrect thing. The goal state has the value +8, and the inital state has the value +4.
Assume you are doing Hill Climbing Search. Explain which heuristic is better. HINT: You should only have to expand a few nodes to answer this question.
(B ≠ 3) ^ (C ≠ 2) ^ (A ≠ B) ^ (B ≠ C) ^ (C < D) ^ (A = D)^ (E < A) ^ (E < B) ^ (E < C) ^ (E < D) ^ (B ≠ D)
(a) Apply backtracking search to the problem. Draw the search tree, labeling the nodes with current variable assignments and the order in which the nodes are visited. Consider the variables in the order A,B,C,D,E and the values in the order 1,2,3,4. Stop after 10 nodes have been added to the tree.
(b) Give an example where the use of each of the following would have been beneficial:
(c) Apply forward-checking search to the problem. Use the order mentioned in part (a). Fill in the table with the appropriate values:
Current assignment being considered | Domain A | Domain B | Domain C | Domain D | Domain E |
(d) Is there an example where the use of arc consistency would have been beneficial?
Consider a sliding block puzzle with the
following initial configuration:
WWEBB
1 2 3 4 5
There are two white checkers belonging to player 1, two black checkers
belonging to player 2, and an empty cell. The game ends when a
player moves all of his checkers to the opposite side of the
board. Player 1 moves first. If player 1 wins, 1 point is awarded
to player 1 and -1 points are awarded to player 2 and vice
versa. The legal moves for a player are:
If a player cannot make a move, the turn is forfeited and the other player may make another move. Player 1 can only move to the right and player 2 can only move to the left.
(a) Draw the complete game tree with the following conventions:
(b) Now label each node with its backed-up minimax value for player 1.
(c) Give a solution path that rational players would play.