CSci 4511 - Homework 2

Homework 2 -- due Wednesday February 19

This homework will be graded out of 100 points. It will count 5% of the grade. Please submit it from the canvas page.

Written questions (75 points)

  1. [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:
    1. Is this heuristic admissible? Explain your reasoning.
    2. Show an example of a TSP where the Greedy-Best-First algorithm with this heuristic finds an optimal solution.
    3. Show an example of a TSP where the Greedy-Best-First algorithm with this heuristic does not find an optimal solution.
    4. Is Greedy-Best-First search with an admissible heuristic guaranteed to find an optimal solution?
    5. Propose an admissible heuristics for the TSP, different from the heuristics given above.
  2. [10 points] Explain with your own words why any heuristic which is an optimal solution to a relaxed problem is admissible and consistent.
  3. [10 points] What are the disadvantages of using a heuristic function for A* which is not consistent? Be precise and provide an example to support the points you are making.
  4. [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.
  5. [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 frontier nodes reached whose f values are greater than C.
    1. Explain if the modified A* algorithm with this strategy is guaranteed to find an optimal solution if one exists or not. Be precise.
    2. Explain if the fact that the algorithm discards some of the rrontier nodes (i.e. nodes in the frontier) means that fewer nodes are expanded. Be short but precise.
    3. Does this strategy reduce the total storage requirements? Explain your reasoning.
  6. [15 points] Answer these questions with your own words. Be precise.
    1. Does the fact that A* is ``optimally efficient'' mean that A* will never expand more nodes than any other algorithm?
    2. Why any node in the frontier with f(n) < f*(n) (the cost of the optimal solution path) will eventually be selected for expansion by A*?
    3. Is it true that all admissible heuristics are equal in the sense that A* will search the states in the same order no matter what the heuristic is?

Programming questions (25 points)

For this question we will use the aima software for the TSP problem.
  1. [5 points] Compare the performance of the following uninformed search algorithms:
    1. breadth_first_tree_search,
    2. breadth_first_graph_search,
    3. depth_first_graph_search,
    4. iterative_deepening_search,
    5. depth_limited_search with a depth limit of 10,
    on the Romanian map to solve these problems:
    1. find a path from Arad to Bucharest
    2. find a path from Oradea to Neamt
    3. find a path from Eforie to Timisoara
    To compare the performance, you can use the function compare_graph_searchers() in python or compare-search-algorithms in lisp.
  2. [5 points] Add or modify 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.
  3. [15 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.
You need to submit one or more files with your program and a file that shows the output. Do not modify the existing aima files, but create a new file with any changes you need.
Copyright: © 2018 by the Regents of the University of Minnesota
Department of Computer Science and Engineering. All rights reserved.
Comments to: Maria Gini
Changes and corrections are in red.