Presentation is loading. Please wait.

Presentation is loading. Please wait.

SE 420 1 Last time: search strategies Uninformed: Use only information available in the problem formulation Breadth-first Uniform-cost Depth-first Depth-limited.

Similar presentations


Presentation on theme: "SE 420 1 Last time: search strategies Uninformed: Use only information available in the problem formulation Breadth-first Uniform-cost Depth-first Depth-limited."— Presentation transcript:

1 SE 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 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 h=15 B FGE h=8h=12h=10 h=18 H h=20 h=14

3 SE Depth-first search Node queue:initialization #statedepthpath costparent # 1A00--

4 SE Depth-first search Node queue:add successors to queue front; empty queue from top #statedepthpath costparent # 2B131 3C1191 4D151 1A00--

5 SE 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 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 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 h=15 B FGE h=8h=12h=10 h=18 H h=20 h=14

8 SE Breadth-first search Node queue:initialization #statedepthpath costparent # 1A00--

9 SE Breadth-first search Node queue:add successors to queue end; empty queue from top #statedepthpath costparent # 1A00-- 2B131 3C1191 4D151

10 SE 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 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 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 h=15 B FGE h=8h=12h=10 h=18 H h=20 h=14

13 SE Uniform-cost search Node queue:initialization #statedepthpath costparent # 1A00--

14 SE 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 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 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 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 h=15 B FGE h=8h=12h=10 h=18 H h=20 h=14

18 SE Greedy search Node queue:initialization #statedepthpathcosttotalparent # costto goalcost 1A

19 SE Greedy search Node queue:Add successors to queue, sorted by cost to goal. #statedepthpathcosttotalparent # costto goalcost 1A B D C Sort key

20 SE Greedy search Node queue:Add successors to queue, sorted by cost to goal. #statedepthpathcosttotalparent # costto goalcost 1A B G E H F D C

21 SE Greedy search Node queue:Add successors to queue, sorted by cost to goal. #statedepthpathcosttotalparent # costto goalcost 1A B G E H F D C

22 SE 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 h=15 B FGE h=8h=12h=10 h=18 H h=20 h=14

23 SE A* search Node queue:initialization #statedepthpathcosttotalparent # costto goalcost 1A

24 SE A* search Node queue:Add successors to queue, sorted by total cost. #statedepthpathcosttotalparent # costto goalcost 1A B D C Sort key

25 SE A* search Node queue:Add successors to queue front, sorted by total cost. #statedepthpathcosttotalparent # costto goalcost 1A B G E H D F C

26 SE A* search Node queue:Add successors to queue front, sorted by total cost. #statedepthpathcosttotalparent # costto goalcost 1A B G E H D F C

27 SE 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 h=15 B FGE h=8h=12h=10 h=18 H h=20 h=14


Download ppt "SE 420 1 Last time: search strategies Uninformed: Use only information available in the problem formulation Breadth-first Uniform-cost Depth-first Depth-limited."

Similar presentations


Ads by Google