1 / 12

Search

Search. Exhaustive/Blind Search Methods Depth First Search Breadth First Search Heuristic Methods Hill Climbing Beam Search Best First Search…. Goal. You should be able to tell if search is the best way to solve a problem and If so, which search method is most suitable. Find a Path. 4.

xylia
Télécharger la présentation

Search

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Search • Exhaustive/Blind Search Methods • Depth First Search • Breadth First Search • Heuristic Methods • Hill Climbing • Beam Search • Best First Search…

  2. Goal • You should be able to tell if search is the best way to solve a problem and • If so, which search method is most suitable

  3. Find a Path 4 A B C 4 3 5 5 s G 4 3 F D E 2 4

  4. Find a Path • Shortest Path • Any Path • Blind Search • BFS • DFS

  5. Search Tree • List all possible paths • Eliminate cycles from paths • Result: A search tree • A special kind of semantic tree where each node denotes a path

  6. Search Tree – Terminology • Root Node • Leaf Node • Ancestor/Descendant • Branching factor • Complete path/Partial path • Expanding open nodes results in closed nodes

  7. Search Trees - Analysis • Exponential explosion of possible paths • Branching factor b, Depth d, how many possible paths?

  8. Depth First Search (DFS) • Form a one element queue consisting of a zero-length path that only contains root • Until the first path in the queue terminates at the goal node or the queue is empty • Remove the first path from the queue; create new paths by extending the first path to all neighbors of the terminal node • Reject all new paths with loops • Add the new paths if any to the FRONT of the queue • If the goal node is foundsuccess; else failure

  9. Breadth First Search (BFS) • Form a one element queue consisting of a zero-length path that only contains root • Until the first path in the queue terminates at the goal node or the queue is empty • Remove the first path from the queue; create new paths by extending the first path to all neighbors of the terminal node • Reject all new paths with loops • Add the new paths if any to the BACK of the queue • If the goal node is foundsuccess; else failure

  10. BFS or DFS • DFS is good when partial paths quickly reach dead ends or become complete paths. DFS is bad when there are long paths (infinite) • BFS works on trees that are effectively infinitely deep, bad when all paths lead to the goal node at more or less the same depth. BFS is not good when b is large

  11. NonDeterministic Search • Form a one element queue consisting of a zero-length path that only contains root • Until the first path in the queue terminates at the goal node or the queue is empty • Remove the first path from the queue; create new paths by extending the first path to all neighbors of the terminal node • Reject all new paths with loops • Add the new paths at RANDOM places in the queue • If the goal node is foundsuccess; else failure

  12. NDFS • When you do not have enough information to choose between BFS and DFS

More Related