Document Sample
hw2 Powered By Docstoc
					Course: ICS 171, Winter 2001
Instructor: Dmitry Pavlov,
Assignment: Homework 2
Date Due: Monday, February 5, 2001
 Don't forget to include your own ID number in the right upper corner (-5 points if
 Please, use separate sheets of paper for your answers, staple the sheets before
    turning them in.
 Show your work --- most of the problems ask for a solution, not for just an answer. If
    we think your solution is inappropriately short you will use points.
 The questions similar to the ones in the homework will be given on quizzes or exam.
 Solutions to this assignment will be discussed on the discussion section.
 The graded papers can be picked from the Distribution center.
 There is a total of 6 problems on 3 pages in this homework.

Problem 1. The following questions ask about the optimality of the algorithms we discussed in class. If
you answer “no” - give a counterexample, i.e. example of a state space where the algorithm you consider
fails to be optimal. If you answer “yes” - provide the space and time complexity of the corresponding

   Assume for now that all operators have the same cost:
        (a) will depth-first search be always optimal? Why?
        (b) will breadth-first search be always optimal ?Why?
        (c) will iterative deepening be always optimal ? Why?

   Now Assume that operators can have different costs:
       (d) will breadth-first search be always optimal ? Why?
       (e) will iterative deepening be always optimal ? Why?
       (f) will hill-climbing be always optimal ? Why?
       (g) will uniform cost be always optimal? Why?
       (h) will A* be always optimal? Why?
       (i) will IDA* be always optimal? Why?

Problem 2. Consider the state-space on the Figure 1 below. Provide an analysis of whether the following heuristic
functions are admissible or not for this state-space. Your proof should clearly show why a given heuristic function is
admissible or not.
                                                  S       A        B        G

                                  h1:               0        0        0        0

                                  h2:               2        3        5        0

                                  h3:               3        4        3        0

                                h4:          4      0     0      0
                                                    1                     5
                                           S                                       G

                                                       2                  4

                                                        Figure 1.
Problem 3. Consider the state-space on the Figure 2 below, where the operator costs are shown for each two connected
states. Define two admissible heuristics H1 and H2, satisfying the following properties

Both H1 and H2: No two values of either of these two heuristics coincide AND
Heuristic H1: best first search will find the optimal path using this heuristic
Heuristic H2: best first search will NOT find the optimal path using this heuristic

Please fill in your answers below. Note that this example shows that even if the heuristic is admissible it doesn't
guarantee that the best-first search algorithm will find the optimal solution.

                                     S         A           B         C        G

         Heuristic H1                __        __          __        __       __

         Heuristic H2                __        __          __        __       __


                                                                10                 10
                             S                     A                                         G

                                      10                                           20

                                                            Figure 2.

Problem 4. Are the following assertions true? Explain your answer in one-two sentences.

(a) for the A* algorithm, if h1(node) is always less than h2(node), where both h1 and h2 are admissible heuristics, then
A* with h1 will find the goal at least as fast as will A* with h2.
(b) the best possible heuristic for the A* search is to have h(node) = the true (minimum) path cost of going from start S
to goal G via that node, i.e. h will be admissible AND A* will expand the minimum possible number of nodes before
hitting the goal..
(c) if heuristic h is not admissible heuristic then IDA* will use exponential space.
(d) if h1 and h2 are two admissible heuristics then (h1+h2)/2 is admissible
(e) if h1 is admissible heuristic then 2*h1 is admissible
(f) if h1 and h2 are two admissible heuristics then max(h1, h2) is admissible
(g) if h1 and h2 are two admissible heuristics A* search with heuristic H=max(h1, h2) will find the goal at least as fast
    as with heuristic F=(h1+h2)/2
(h) if h1 and h2 are two admissible heuristics and a, b are two real numbers such that a>0 and b>0 and a+b=1, then
    IDA* is guaranteed to find the optimal solution with heuristic H=a*h1+b*h2

Problem 5. For the state-space below, the path costs are shown on the links. The start state is S and the
goal state is G. All search algorithms are assumed to obey the following rules:
- when a node is expanded in the search tree, the parent of the node is not added as a child
- when multiple nodes have the same cost on the Q, they are placed in the priority Q in alphabetical
    order (i.e., A goes in front of B, etc)
Otherwise, the search algorithms behave as defined in the pseudocode description in class.

                      A                         C

    S               2                               1

           1                      3
                     B                           G
Suppose that the following heuristic is defined for the state space above:
h(S) = 2; h(A) = 2; h(B) = 2; h(G)=h(C) = 0.

Write down the sequence of nodes as they will be expanded by
2a) A* Search
2b) Iterative Deepening A* Search;
2c) Best First Search
2d) Hill Climbing (Greedy) Search
Note that you only need to mention nodes that are being popped from the priority queue but not the whole
fringe. You should assume that on each iteration IDA* expands all nodes that less than or equal to the
current cost limit.

Problem 6. Suppose that you are doing a project that involves optimization in the high dimensional space (dimension
is the order of several hundreds). Such problems are typical, for instance, for neural networks during their training.
Based on the material presented on the lectures argue which optimization algorithms are suitable for the problem at
hand and which are not. Your write up should be at most one page in length with clear indications of which algorithms
you are talking about and reasons why you think they are suitable or not suitable. Please, try to be as precise as

Shared By: