Download presentation
Presentation is loading. Please wait.
Published byCaitlin Nicholson Modified over 9 years ago
1
SE 420 1 Last time: search strategies Uninformed: Use only information available in the problem formulation Breadth-first Uniform-cost Depth-first Depth-limited Iterative deepening Informed: Use heuristics to guide the search Best first: Greedy search – queue first nodes that maximize heuristic “desirability” based on estimated path cost from current node to goal; A* search – queue first nodes that maximize sum of path cost so far and estimated path cost to goal.
2
SE 420 2 Exercise: Search Algorithms The following figure shows a portion of a partially expanded search tree. Each arc between nodes is labeled with the cost of the corresponding operator, and the leaves are labeled with the value of the heuristic function, h. Which node (use the node’s letter) will be expanded next by each of the following search algorithms? (a) Depth-first search (b) Breadth-first search (c) Uniform-cost search (d) Greedy search (e) A* search 5 D 5 A C 5 4 19 6 3 h=15 B FGE h=8h=12h=10 h=18 H h=20 h=14
3
SE 420 3 Depth-first search Node queue:initialization #statedepthpath costparent # 1A00--
4
SE 420 4 Depth-first search Node queue:add successors to queue front; empty queue from top #statedepthpath costparent # 2B131 3C1191 4D151 1A00--
5
SE 420 5 Depth-first search Node queue:add successors to queue front; empty queue from top #statedepthpath costparent # 5E272 6F282 7G282 8H292 2B131 3C1191 4D151 1A00--
6
SE 420 6 Depth-first search Node queue:add successors to queue front; empty queue from top #statedepthpath costparent # 5E272 6F282 7G282 8H292 2B131 3C1191 4D151 1A00--
7
SE 420 7 Exercise: Search Algorithms The following figure shows a portion of a partially expanded search tree. Each arc between nodes is labeled with the cost of the corresponding operator, and the leaves are labeled with the value of the heuristic function, h. Which node (use the node’s letter) will be expanded next by each of the following search algorithms? (a) Depth-first search (b) Breadth-first search (c) Uniform-cost search (d) Greedy search (e) A* search 5 D 5 A C 5 4 19 6 3 h=15 B FGE h=8h=12h=10 h=18 H h=20 h=14
8
SE 420 8 Breadth-first search Node queue:initialization #statedepthpath costparent # 1A00--
9
SE 420 9 Breadth-first search Node queue:add successors to queue end; empty queue from top #statedepthpath costparent # 1A00-- 2B131 3C1191 4D151
10
SE 420 10 Breadth-first search Node queue:add successors to queue end; empty queue from top #statedepthpath costparent # 1A00-- 2B131 3C1191 4D151 5E272 6F282 7G282 8H292
11
SE 420 11 Breadth-first search Node queue:add successors to queue end; empty queue from top #statedepthpath costparent # 1A00-- 2B131 3C1191 4D151 5E272 6F282 7G282 8H292
12
SE 420 12 Exercise: Search Algorithms The following figure shows a portion of a partially expanded search tree. Each arc between nodes is labeled with the cost of the corresponding operator, and the leaves are labeled with the value of the heuristic function, h. Which node (use the node’s letter) will be expanded next by each of the following search algorithms? (a) Depth-first search (b) Breadth-first search (c) Uniform-cost search (d) Greedy search (e) A* search 5 D 5 A C 5 4 19 6 3 h=15 B FGE h=8h=12h=10 h=18 H h=20 h=14
13
SE 420 13 Uniform-cost search Node queue:initialization #statedepthpath costparent # 1A00--
14
SE 420 14 Uniform-cost search Node queue:add successors to queue so that entire queue is sorted by path cost so far; empty queue from top #statedepthpath costparent # 1A00-- 2B131 3D151 4C1191
15
SE 420 15 Uniform-cost search Node queue:add successors to queue so that entire queue is sorted by path cost so far; empty queue from top #statedepthpath costparent # 1A00-- 2B131 3D151 5E272 6F282 7G282 8H292 4C1191
16
SE 420 16 Uniform-cost search Node queue:add successors to queue so that entire queue is sorted by path cost so far; empty queue from top #statedepthpath costparent # 1A00-- 2B131 3D151 5E272 6F282 7G282 8H292 4C1191
17
SE 420 17 Exercise: Search Algorithms The following figure shows a portion of a partially expanded search tree. Each arc between nodes is labeled with the cost of the corresponding operator, and the leaves are labeled with the value of the heuristic function, h. Which node (use the node’s letter) will be expanded next by each of the following search algorithms? (a) Depth-first search (b) Breadth-first search (c) Uniform-cost search (d) Greedy search (e) A* search 5 D 5 A C 5 4 19 6 3 h=15 B FGE h=8h=12h=10 h=18 H h=20 h=14
18
SE 420 18 Greedy search Node queue:initialization #statedepthpathcosttotalparent # costto goalcost 1A002020--
19
SE 420 19 Greedy search Node queue:Add successors to queue, sorted by cost to goal. #statedepthpathcosttotalparent # costto goalcost 1A002020-- 2B1314171 3D1515201 4C11918371 Sort key
20
SE 420 20 Greedy search Node queue:Add successors to queue, sorted by cost to goal. #statedepthpathcosttotalparent # costto goalcost 1A002020-- 2B1314171 5G288162 7E2710172 6H2910192 8F2812202 3D1515201 4C11918371
21
SE 420 21 Greedy search Node queue:Add successors to queue, sorted by cost to goal. #statedepthpathcosttotalparent # costto goalcost 1A002020-- 2B1314171 5G288162 7E2710172 6H2910192 8F2812202 3D1515201 4C11918371
22
SE 420 22 Exercise: Search Algorithms The following figure shows a portion of a partially expanded search tree. Each arc between nodes is labeled with the cost of the corresponding operator, and the leaves are labeled with the value of the heuristic function, h. Which node (use the node’s letter) will be expanded next by each of the following search algorithms? (a) Depth-first search (b) Breadth-first search (c) Uniform-cost search (d) Greedy search (e) A* search 5 D 5 A C 5 4 19 6 3 h=15 B FGE h=8h=12h=10 h=18 H h=20 h=14
23
SE 420 23 A* search Node queue:initialization #statedepthpathcosttotalparent # costto goalcost 1A002020--
24
SE 420 24 A* search Node queue:Add successors to queue, sorted by total cost. #statedepthpathcosttotalparent # costto goalcost 1A002020-- 2B1314171 3D1515201 4C11918371 Sort key
25
SE 420 25 A* search Node queue:Add successors to queue front, sorted by total cost. #statedepthpathcosttotalparent # costto goalcost 1A002020-- 2B1314171 5G288162 6E2710172 7H2910192 3D1515201 8F2812202 4C11918371
26
SE 420 26 A* search Node queue:Add successors to queue front, sorted by total cost. #statedepthpathcosttotalparent # costto goalcost 1A002020-- 2B1314171 5G288162 6E2710172 7H2910192 3D1515201 8F2812202 4C11918371
27
SE 420 27 Exercise: Search Algorithms The following figure shows a portion of a partially expanded search tree. Each arc between nodes is labeled with the cost of the corresponding operator, and the leaves are labeled with the value of the heuristic function, h. Which node (use the node’s letter) will be expanded next by each of the following search algorithms? (a) Depth-first search (b) Breadth-first search (c) Uniform-cost search (d) Greedy search (e) A* search 5 D 5 A C 5 4 19 6 3 h=15 B FGE h=8h=12h=10 h=18 H h=20 h=14
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.