Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
163 views2 pages

Best First Search

Best First Search

Uploaded by

smce.ramu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
163 views2 pages

Best First Search

Best First Search

Uploaded by

smce.ramu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Best First Search (Informed Search)

 Difficulty Level : Easy


 Last Updated : 18 Jul, 2022

 Read

 Discuss
In BFS and DFS, when we are at a node, we can consider any of the adjacent as the next node. So
both BFS and DFS blindly explore paths without considering any cost function.
The idea of Best First Search is to use an evaluation function to decide which adjacent is most
promising and then explore.

Best First Search falls under the category of Heuristic Search or Informed Search.
Implementation of Best First Search:
Illustration:
Let us consider the below example:

 We start from source “S” and search for goal “I” using given costs and Best First search.

 pq initially contains S
 We remove s from and process unvisited neighbors of S to pq.
 pq now contains {A, C, B} (C is put before B because C has lesser cost)

 We remove A from pq and process unvisited neighbors of A to pq.


 pq now contains {C, B, E, D}

 We remove C from pq and process unvisited neighbors of C to pq.


 pq now contains {B, H, E, D}

 We remove B from pq and process unvisited neighbors of B to pq.


 pq now contains {H, E, D, F, G}
 We remove H from pq.
 Since our goal “I” is a neighbor of H, we return.

You might also like