Unformatted text preview: ICS 171, Summer 2000: Midterm Prepartion
Stephen D. Bay 1 Consider the following graph representing the state space and operators of a navigation problem:
1 3 A 2 5 S 4 3 D 4 B 6 G 0 2 2 2 0 F 2 3 C E 4 The path cost is shown by the number on the links; the heuristic evaluation is shown by the number in the box. There are two goal states at G and F. When placing expanded child nodes on a queue, assume that the child nodes are placed in alphabetical order i.e. if node S is expanded the queue will be: A B Assume that we never generate child nodes that appear as ancestors of the current node in the search tree. a What is the order that best rst search will expand the nodes? SACEDF b What is the order that hillclimbing search will expand the nodes? SACE Hill climbing will get stuck at E. 1 c What is the order that uniform cost search will expand the nodes?
0 S 2 A 3 B 4 C 7 C G 9 8 B 6 D 8 E 9 A 9 D E 11 14 G 8 F 1. Q = fSg 2. pull S, test S for goal, expand S, add children A B to Q, Q = fA2, B3g 3. pull A, test A for goal, expand A, add child C to Q, Q = fB3, C4g 4. pull B, test B for goal, expand B, add children C G to Q, Q = fC4, C7, G9g 5. pull C, test C for goal, expand C, add children B D E to Q, Q = fD6, C7, B8, E8, G9g 6. pull D, test D for goal, expand D, add child F to Q, Q = fC7, B8, E8, F8, G9g 7. pull C, test C for goal, expand C, add children A D E to Q, Q = fB8, E8, F8, A9, D9, G9, E11g 8. pull B, test B for goal, expand B, add child G to Q, Q = fE8, F8, A9, D9, G9, E11, G14g 9. pull E, test E for goal, expand E, E is deadend, Q = fF8, A9, D9, G9, E11, G14g 10. pull F, test F for goal success 2 d What is the order that A* search will expand the nodes?
0+5 = 5 S 2+3 = 5 A 3+4 = 7 B 4+3=7 7+3=10 C C G 9+0 = 9 8+4 = 12 B 6+2 = 8 8+0 = 8 F D 8+1=9 E 1. 2. 3. 4. 5. 6. 7. Q = fSg pull S, test S for goal, expand S, add children A B to Q, Q = fA5, B7g pull A, test A for goal, expand A, add child C to Q, Q = fB7,C7g pull B, test B for goal, expand B, add children C G to Q, Q = fC7, G9, C10g pull C, test C for goal, expand C, add children B D E to Q, Q = fD8, E9, G9, C10, B12g pull D, test D for goal, expand D, add child F to Q, Q = fF8, E9, G9, C10, B12g pull F, test F for goal success 3 e What is the order that IDA* search will expand the nodes? With IDA* we search with DFS up to an fcost limit. Note that in the Q we recorded the fcost for each of the nodes but we do not sort the Q by fcost. We operate the Q as in DFS, which is LIFO last in rst out. Iteration 1: fcost limit is 5
5 S 3+4 = 7 A 2 + 2 + 3 =7 C B 2+3 = 5 1. 2. 3. 4. 5. Q = fSg pull S, test S for goal, expand S, add children A B to Q, Q = fA5, B7g pull A, test A for goal, expand A, add child C to Q, Q = fC7, B7g drop C, since fcostC is greater than 5, Q = fB7g drop B, since fcostB is greater than 5, Q = f g We set the fcost limit for the next iteration to 7, because that was the next value on the Q greater than our current limit of 5. 4 Iteration 2: fcost limit is 7
5 S 2+3 = 5 A 4+3 = 7 C 7+3 = 10 C G B 3+6+0 = 9 3+4=7 8+4=12 B D 6+2=8 E 8+1=9 1. Q = fSg 2. pull S, test S for goal, expand S, add children A B to Q, Q = fA5, B7g 3. pull A, test A for goal, expand A, add child C to Q, Q = fC7, B7g 4. pull C, test C for goal, expand C, add children B D E to Q, Q = fB12, D8, E9, B7g 5. drop B, since fcostB is greater than 7, Q = fD8, E9, B7g 6. drop D, since fcostD is greater than 7, Q = fE9, B7g 7. drop E, since fcostE is greater than 7, Q = fB7g 8. pull B, test B for goal, expand B, add children C G to Q, Q = fC10, G9g 9. drop C, since fcostC is greater than 7, Q = fG9g 10. drop G, since fcostG is greater than 7, Q = f g Set the fcost limit for the next iteration to 8. 5 Iteration 3: fcost limit is 8
5 S 2+3 = 5 A 4+3 = 7 C B 3+4=7 8+4=12 B 6+2=8 D E 8+1=9 F 8+0 = 8 1. 2. 3. 4. 5. 6. 7. Q = fSg pull S, test S for goal, expand S, add children A B to Q, Q = fA5, B7g pull A, test A for goal, expand A, add child C to Q, Q = fC7, B7g pull C, test C for goal, expand C, add children B D E to Q, Q = fB12, D8, E9, B7g drop B, since fcostB is greater than 8, Q = fD8, E9, B7g pull D, test D for goal, expand D, add child F to Q, Q = fF8, E9, B7g pull F, test F for goal success 6 2 Shown below is a game tree where the root node is a MAX node.
MAX MIN MAX 6 2 0 8 4 3 1 1 2 9 0 2 Assume that: the tree is explored by minimax in a left to right manner the tree is explored to depth 3 and no further the numbers beneath the leaves of the tree are the evaluation function values for the corresponding states Write in the boxes the minimax values for each state. Indicate the move chosen by MAX the computer as its rst move. 7 2 This move chosen. MAX 2 1 2 MIN 2 8 4 1 9 2 MAX 6 2 0 8 4 3 1 1 2 9 0 2 8 ...
View
Full Document
 '
 NoProfessor
 Graph Theory, Minimax, Tree structure, Guitar tunings

Click to edit the document details