- [15 points]
You are given the following heuristic function for the Traveling
SalesPerson Problem (TSP):
h(n) = distance to the closest unvisited city.

Answer the following questions:- Is this heuristic admissible? Explain your reasoning.
- Show an example of a TSP where the Greedy-Best-First algorithm with this heuristic finds an optimal solution.
- Show an example of a TSP where the Greedy-Best-First algorithm with this heuristic does NOT find an optimal solution.
- Is Greedy-Best-First search with an admissible heuristic guaranteed to find an optimal solution?
- Propose an admissible heuristics for the TSP, different from the heuristics given above.

- [10 points] What are the disadvantages of using a heuristic function for A* which is NOT consistent?
- [15 points] The terms g and h each play a different role in A*. What are those roles? What happens when you emphasize or de-emphasize one of them by using different weights in f(n)? Consider the case in which f(n) = (1 - w)g(n) + wh(n), with 0 ≤ w ≤ 1. Be specific and analyze what happens for different values of w.
- [10 points] Why any heuristic which is an optimal solution to a relaxed problem is admissible and consistent?
- [10 points]
In A* the nodes that have been generated but not yet expanded
are sorted according to the value of f(n) = g(n) + h(n), i.e. the
sum of the
cost from the start to node n plus the estimated cost from n to
goal using admissible heuristic h(.).
Nodes that have the same f(.) value are ordered arbitrarily.

Propose a domain independent criterion that could be used to order the nodes with the same f(.) value. Explain your answer. - [15 points]
Discuss the possible advantages of the following state-space search
strategy: obtain by some method a path to a goal node and
its associated cost f(Goal)=C.
This cost is not necessarily minimal but it gives
an upper bound on the minimal cost. Now use A* with an admissible $h$
function and discard immediately any OPEN nodes reached
whose f values are greater than C.
- Explain if the modified A* algorithm with this strategy is guaranteed to find an optimal solution if one exists or not. Be short but precise.
- Explain if the fact that the algorithm discards some of the OPEN nodes (i.e. nodes in the frontier) means that fewer nodes are expanded. Be short but precise.
- Does this strategy reduce the total storage requirements? Explain your reasoning.

For this programming assignment you will use the Romanian map shown in the texbook and already defined in the aima code.

- [6 points]
Compare the performance of the following uninformed search algorithms:
- breadth_first_tree_search,
- breadth_first_search,
- depth_first_graph_search,
- iterative_deepening_search,
- depth_limited_search,

- find a path from Arad to Bucharest
- find a path from Oradea to Neamt
- find a path from Eforie to Timisoara

`compare-search-algorithms`

or the python function`compare_graph_searchers()`

. - [8 points] Add or modify the code in the search functions to compute the cost of the solution found by each algorithm and print the cost for each algorithm when you compare the algorithms.
- [11 points] Compute the average cost and standard deviation of the cost of the paths found by the different algorithms used when you compared their performance. Write the code so that it will work for any number of algorithms and will print the average and standard deviation at the bottom of the table printed by the comparison function.
- [5 points -- extra credit] Print the solution path found by the search functions.

Department of Computer Science and Engineering. All rights reserved.

Changes and corrections are in red.