




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





Adjacent List of above graph: S: A, B A: C, D B: E, G C: D, S D: B, G E: G G1: C, D G2: B Breadth-First Search a) Goal State: G b) States expanded: S, A, B, C, D, E c) Open and close list during breadth search Step 0 1 2 3 Open List {s} {A, B} {B, C, D} {C, D, E, G2} Close List Empty {S} {S, A} {S, A, B} Step 4 5 6 7 Open List {D, E, G2} {E, G2, G1} {G2, G1} {G1} Close List {S, A, B, C} {S, A, B, C, D} {S, A, B, C, D, E}
Depth-First Search a) Goal State: G b) State Expanded: S, A, C, D c) Open and Close List during depth-first search Step 0 1 2 3 4 5 Open List {s} {A, B} {C, D, B} {D, B} {G1, B} {B} Close List Empty {S} {S, A} {S, A, C} {S, A, C, D} {S, A, C, D} Best-First Search a) Goal State: G b) States Expanded: S, A, D Open List Close List Initial State {S} Empty After Expanding S {A, B} {S} After Expanding A {D, C, B} {S, A} After Expanding D {G1, C, B}
After return goal state
S 10 S 10 A 5 B 8 S 10 A 5 B 8 C 3 D 2 S 10 A 5 B 8 C 3 D 2 G 0 B 8
Expanding D B(20), G1(14), B(19), S, B(15)}
After return goal state
RBFS(using f=g+h) The search tree for RBFS search (Goal state is G1): (1). After expanding S, A, C, D : ∞ 7 3 15 6 1 11 4 2 11 6 3 (2). After unwinding back to A and expanding D D 11 G1 14 16 B 19 B^ G1 15 20 S 10 B 15=7+ A5 8=3+ D 11=3+6+ C3 7=3+1+ D 10=3+1+4+ S 16=3+1+2+ G1 0 14=3+1+4+ B 19=3+1+4+3+
∞ 7 3 15 1 6 14 6 3 (3). After switching back to C and expanding D. This time, because the best alternative path (through D or B) is 15, this expansion continues to G1. ∞ 7 3 15 6 1 15 4 2 15 6 3 15 SMA with open list is 3* a) Goal State: G b) Expanded State: S, A, C, D, D S 10 B 15=7+ A5 8=3+ C3 (^14) D 11=3+6+ G1 0 15=3+6+6 B 20=3+6+8+ S 10 B 15=7+ A5 8=3+ D2 (^15) C 14 D 10=3+1+4+ S 16=3+1+2+ G1 0 14=3+1+4+ B 19=3+1+4+3+
change to {G1(15), B(20), G1(14)} After return goal state
Compare RBFS and A. What are the main differences between the two algorithms? What are the weaknesses of each algorithm? Illustrate your claims by giving a particular example run of the particular algorithm that shows its weakness, if feasible. [ANSWER] RBFS and A main differences are as followings: A:* A* Expands nodes based on the f-value evaluation and keeps all the visited leaf nodes and their f-values; A* keeps all generated nodes in memory; RBFS: RBFS remembers the f-value of the best alternative path available form any ancestor of the current node. If the current node exceeds this limit, the recursion unwinds back to the alternative path. As recursion unwinds, RBFS replaced the f-value of each node along the path with the best f-value of its children; RBFS remembers only the f-value of the best leaf in the forgotten subtree; RBFS search uses only linear space , which is much less than A* search; RBFS will re-expand and re-generate the same the nodes. Example: Figure 4.3 page 98 of Textbook and Figure 4.6 page 102 of Textbook Weakness of RBFS:
Example: Figure 4.6 Textbook page 102. In step a) the algorithm expand the node “Rimnicu Vilcea”, and forget the nodes under “Rimnicu Vilcea” in step b). In step c) the algorithm need to expand the node “Rimnicu Vilcea” again.
Algorithm A* does not terminate until a goal node is selected for expansion. However, a path to a goal node might be reached long before that node is selected for expansion. Why not terminating as soon as the goal node is found? Illustrate your answer with an example! [ANSWER] When a goal node is reached along a path, the f-value of this goal state might not be the optimal. Until a goal node is selected for expansion, the f-value of this goal state is optimal. Example: Figure 4.3 page 98 of Textbook In step e), the goal node “Bucharest” is already reached, but its f-value is 450, which is not optimal. Until step f), the goal node “Bucharest” is selected to be expanded, the optimal f-value 418 is found and the algorithm terminate.