Artificial Intelligence I – Tutorial
Weeks 5/6 – Optional Exercises

1. Here is a graph of some cities of Europe. Each city c in the graph is annotated with a value h(c) indicating a heuristic estimate of the city's distance from Zagreb. We would like to find an optimal path from Prague to Zagreb.

  1. Is this heuristic admissible?

  2. Is this heuristic consistent?

  3. If we use a greedy best-first search, will we necessarily find an optimal path? Might we find an optimal path?

  4. If we use A*, how many nodes will be expanded in the search?

2. (Russell & Norvig, ex. 3.14) In chess, a rook can move any number of squares horizontally or vertically, but cannot jump over other pieces. Is Manhattan distance is an admissible heuristic for the minimum number of moves to move a rook between two given squares with a certain set of pieces on the board?

3. True or false?

  1. Depth-first search always expands at least as many nodes as A* with a consistent heuristic.

  2. Uniform-cost search always expands at least as many nodes as A* with a consistent heuristic.

  3. A* always expands nodes in decreasing order of h(n).

  4. A* always expands nodes in increasing order of f(n).

  5. Whenever A* expands a node, it has found the optimal path from the start node to that node.

4. Is the heuristic function h(n) = 0 consistent? How will A* behave using this heuristic function?

5. Consider a heuristic function h(n) that returns the exact cost of the cheapest path from a node n to a goal state. Is h consistent? How will A* behave using this heuristic function?

6. True or false?

  1. The maximum of two admissible heuristics is admissible.

  2. The maximum of two consistent heuristics is consistent.

  3. The sum of two admissible heuristics is admissible.

7. Prove that every consistent heuristic is admissible.

8. In A* we use a cost function f(n) = g(n) + h(n), where g(n) is the total cost of the path from the start node to node n, and h(n) estimates the cost of the path from n to the goal. Consider the optimal path from the start node to the goal. As we walk along this path, how will f(n) change from node to node? Will it be (a) increasing, (b) decreasing, (c) non-increasing, (d) non-decreasing, or (e) not necessarily any of these? What about g(n)? h(n)?

9. (Russell & Norvig, ex. 3.25) Consider a version of best-first search that uses f(n) = (2 – ω) g(n) + ω h(n) for some constant ω. What kind of search does this perform for ω = 0, ω = 1, and ω = 2? For which values of ω is the search optimal, assuming that h is admissible?