You are on page 1of 5

1. Define informed/heuristic search strategy.

ANSWER

Inform search is known as the knowledge about the path or distance coverage for the guidance to reach the destination
and Heuristic search is the knowledge about the experts for reaching the goal effectively, on the contrary you can say it
the estimation about the cost of any specific goal.

2. What is the difference between


 Informed and Uninformed Search
 Greedy best first and A* algorithms

ANSWER

UNINFORMED SEARCHING INFORMED SEARCHING


Searching without knowledge Search with information
Time consuming Use domain knowledge about solution
More complexity(time , space) Quick solution
EXAMPLE DFS , BFS Less complexity (time , space)

3. Prove that Uniform-cost search is a special case of A∗ search.

ANSWER
UCS is a special case of A* which corresponds to having h(n)=0, h(n)=0, A heuristic function h which
has h(n)=0h(n)=0,  is clearly admissible, because it always "underestimates" the distance to the goal,
which cannot be smaller than 00, unless you have negative edges (but I assume that all edges are non-
negative). So, indeed, UCS is a special case of A*, and its heuristic function is even admissible!

4. Prove that if a heuristic is consistent, it must be admissible. Construct an admissible heuristic that is not consistent.

ANSWER
Ans. Let k(n) be the cost of the cheapest path from n to the goal node. We will prove by induction on the number of
steps to the goal that h(n) ≤ k(n). Base case: If there are 0 steps to the goal from node n, then n is a goal and therefore
h(n) = 0 ≤ k(n).
If n is i steps away from the goal, there must exist some successor n 0 of n generated by some action a is on the
optimal path from n to the goal (via action a) and n 0 is i − 1 steps away from the goal.

5. Are Greedy best first and A* algorithms optimal and complete?

ANSWER

In general, the greedy BST algorithm is not complete, that is, there is always the risk to take a path that
does not bring to the goal.
A* uses an admissible heuristic function, which essentially means that A* is optimal, that is, it always
finds the optimal path between the starting node and the goal node. A* is also complete (unless there are
infinitely many nodes to explore in the search space). 
6. What is the time and space complexity of Greedy best first and A* algorithms?

ANSWER

GREEDY BFS

  The time complexity is O (b m), where bb is the (maximum) branching factor and mm is the
maximum depth of the search tree. The space complexity is proportional to the number of nodes in the
fringe and to the length of the found path.
A STAR

The time complexity is O (b SQ m). However, A* needs to keep all nodes in memory while searching, not
just the ones in the fringe, 

QUESTION 7 GREEDY FIRST SEARCH


EXPEND NODE FRONTIER
Ø {(A,NIL): 240}

(A,NIL) not goal {(D,A):163 (E,A):170 (C,A):182 (B,A):186}

(D,A) not goal {(N,D):77 (E,A):170 (C,A):182 (B,A):186}

(N,D) not goal {(F,N):150 (G,N):165 (E,A):170 (C,A):182


(B,A):186}
(F,N) not goal {(I.F):120 (G,N):165 (E,A):170 (C,A):182
(B,A):186}
(I.F) not goal {(M,I):100 (L,I):104 (G,N):165 (E,A):170
(C,A):182 (B,A):186}
(M,I) not goal {(O,M):72 (L,I):104 (G,N):165 (E,A):170
(C,A):182 (B,A):186}
(O,M) not goal {(R.O):0 (P,O):65 (L,I):104 (G,N):165
(E,A):170 (C,A):182 (B,A):186}
(R.O) goal {(P,O):65 (L,I):104 (G,N):165 (E,A):170
(C,A):182 (B,A):186}

PATH : (R,O)-> (O,M)->(M,I)->(I,F)->(F,N)->(N,D)->(D,A)->(A,NIL)

: A -> D -> N -> F-> I-> M-> O-> R->

PATH COST = 163 + 77 +150 + 120 + 100 + 72 +O =682

DISTANCE COST = 89+ 89+ 84+31+ 20+ 50+72 = 435


QUESTION 8 A STAR SEARCH
F (n) = g (n) + h (n)
# OF nodes tested: 4, expanded: 3

EXPEND NODE FRONTIER

Ø {A: 56}

A not goal {K:50 , B:52}

K not goal {L:30 , F:47, B:52}

L not goal {M:15, F:40 , B:52}

M goal {F:40 , B:52}

PATH A, K, L, M
PATH COST = 30+15+0=45
DISTANCE COST = 20+15+15 = 60
WORKING

You might also like