Presentation is loading. Please wait.

Presentation is loading. Please wait.

Informed Search Methods. Informed Search  Uninformed searches  easy  but very inefficient in most cases of huge search tree  Informed searches  uses.

Similar presentations


Presentation on theme: "Informed Search Methods. Informed Search  Uninformed searches  easy  but very inefficient in most cases of huge search tree  Informed searches  uses."— Presentation transcript:

1 Informed Search Methods

2 Informed Search  Uninformed searches  easy  but very inefficient in most cases of huge search tree  Informed searches  uses problem-specific information to reduce the search tree into a small one  resolve time and memory complexities

3 Definition Uninformed search strategies Generate states Test them With the goal Incredibly inefficient in most cases Informed search strategies Problem-specific knowledge Evaluation Find solution more efficiency Eval(State) ? Eval(Goal)

4 Informed (Heuristic) Search  Best-first search  It uses an evaluation function, f(n)  to determine the desirability of expanding nodes, making an order  The node with the best evaluation expanded first  The order of expanding nodes is essential  to the size of the search tree  less space, faster

5 Best-first search  Every node is then  attached with a value stating its goodness  The nodes in the queue are arranged  in the order that the best one is placed first  However this order doesn't guarantee  the node to expand is really the best  They are two kind:  Minimize estimated cost to reach a goal: Greedy Search  Minimize the total path cost: A*

6 Best-first search  The path cost g is one of the example  However, it doesn't direct the search toward the goal  Heuristic function h(n) is required  Estimate cost of the cheapest path  from node n to a goal state  Expand the node closest to the goal  = Expand the node with least cost  If n is a goal state, h(n) = 0

7 Greedy Search: Minimize estimated cost to reach a Goal  Function that calculates the cost to reach a goal is called, heuristic function, denoted by h:  h(n) = estimated cost of the cheapest path from state at node n to the goal state  Implementation: Function Best-First-Search(problem, h)

8 Example

9 This node takes to the best solution Sol ={Arad, Sibiu, Pagaras, Bucharest} Cost = 450 But the Best Sol ={Arad, Sibiu, Rimnicu Vilcea, Pitesti, Bucharest} Cost = 418 Contd…

10 Evaluation of Greedy-Search  Complete - No; we may expand the node with best evaluation, but doesn’t reach the goal!  Time Complexity  O(b d ) very poor evaluation function  O(b*d) Excellent evaluation function  Memory  O(b d )  Problem: The selection of the node is entirely based on the cost evaluation to reach the goal, and not on how much it cost the path expanding so far.

11 A* search  The most well-known best-first search  evaluates nodes by combining  path cost g(n) and heuristic h(n)  f(n) = g(n) + h(n)  g(n) – cheapest known path  f(n) – cheapest estimated path  Minimizing the total path cost by  combining uniform-cost search  and greedy search

12 A* search  Uniform-cost search  minimizes the cost of the path so far, g(n)  but can be very inefficient  greedy search + uniform-cost search  evaluation function is f(n) = g(n) + h(n)  [evaluated so far + estimated future]  f(n) = estimated cost of the cheapest solution through n

13 Romania with step costs in km

14 A * search example We start with our initial state Arad. We make a node and add it to the open list. Since it’s the only thing on the open list, we expand the node.

15 A * search example Add the three nodes we found to the open list.

16 A * search example Expand Sibiu, run into Arad again. Already expanded this node once; so, don’t add it to the open list again.

17 A* Search Example

18 A * search example

19

20

21

22

23

24

25 A* terminates with optimal solution  A* stops when you try to expand a goal state  A* always expands node with smallest f  Since heuristic is admissible, f is an underestimate  If there is a better goal state available, with a smaller f, there must be a node on graph with smaller f than current – so you would be expanding that instead!

26 More about A*  Completeness  A* expands nodes in order of increasing f  Must find goal state unless  infinitely many nodes with f(n) < f*  infinite branching factor OR  finite path cost with infinite nodes on it  Complexity  Time: Depends on h, can be exponential  Memory: O(b m ), stores all nodes

27 Heuristic Search (informed search) A Heuristic is a function that, when applied to a state, returns a number that is an estimate of the merit of the state, with respect to the goal. In other words, the heuristic tells us approximately how far the state is from the goal state*. Note we said “approximately”. Heuristics might underestimate or overestimate the merit of a state. But for reasons which we will see, heuristics that only underestimate are very desirable, and are called admissible.

28 Heuristics for 8-puzzle I The number of misplaced tiles (not including the blank) 123 456 78 123 456 78 123 456 78 123 456 78 NNN NNN NY In this case, only “8” is misplaced, so the heuristic function evaluates to 1. In other words, the heuristic is telling us, that it thinks a solution might be available in just 1 more move. Goal State Current State Notation: h(n) h(current state) = 1

29 Heuristics for 8-puzzle II The Manhattan Distance (not including the blank) In this case, only the “3”, “8” and “1” tiles are misplaced, by 2, 3, and 3 squares respectively, so the heuristic function evaluates to 8. In other words, the heuristic is telling us, that it thinks a solution is available in just 8 more moves. 328 456 71 123 456 78 Goal State Current State 33 8 8 1 1 2 spaces 3 spaces Total 8 Notation: h(n) h(current state) = 8


Download ppt "Informed Search Methods. Informed Search  Uninformed searches  easy  but very inefficient in most cases of huge search tree  Informed searches  uses."

Similar presentations


Ads by Google