Hello, Can anyone here help me with the term Breadth-Search Algorithm in AI? What is it?

Uhuh, i never heard before of this âBreadth-first searchâ ^^
After reading this post among the others i randomly chose a video from the fcc channel just to have an overview of what the video looks like while ending my coffee.
Guess what popped out?

Breadth first search and depth first search are very common algorithm for traversing trees and graphs. Itâs not something you encounter as a beginner but itâs rather fundemental. In fact, itâs common to see tree/graph traversal questions in coding interviews

Imagine you have a tree like this:

``````        A
|
+----+---+
|    |   |
B    C   D
|    |
E    F
``````

In a depth-first traversal, youâd visit nodes A, B, then E, then C and F, then D. Notice how you go try to go âdownâ the tree before you go âacrossâ it. Thatâs why itâs called âdepth-firstâ. In breadth-first, you go across before down, so youâd visit the nodes A, B, C, D, E, then F.

If you search Wikipedia for âBreadth First Searchâ, you can watch an animated example of BFS in action (itâs the second diagram down, on the right)

2 Likes

Basically, we need to start the root node search. And proceed first through neighboring nodes. In addition, it moves to the next level of nodes. In addition, it generates one tree at a time until the solution is found. This search can be carried out using the data structure of the FIFO queue. This method provides the solution with the shortest path. FIFO (first in the beginning). If the ramification factor (average number of child nodes for a particular node)= b and depth= d, the number of nodes at level d= bd. In the worst case the total number of nodes created is b + b2 + b3 + âŚ + bd.

1 Like