Breadth- first search - Wikipedia, the free encyclopedia. Animated example of a breadth- first search. Breadth- first search (BFS) is an algorithm for traversing or searching tree or graph data structures. It starts at the tree root (or some arbitrary node of a graph, sometimes referred to as a 'search key'. Moore, who used it to find the shortest path out of a maze. Lee as a wire routing algorithm (published 1. At the beginning of the algorithm, the distance of each vertex is set to INFINITY, which is just a word that represents the fact that a node has not been reached yet, and therefore it has no distance from the starting vertex. We could have used other symbols, such as - 1, to represent this concept. The parent attribute of each vertex can also be useful to access the nodes in a shortest path, for example by backtracking from the destination node up to the starting node, once the BFS has been run, and the predecessors nodes have been set. The NIL is just a symbol that represents the absence of something, in this case it represents the absence of a parent (or predecessor) node; sometimes instead of the word NIL, words such as null, none or nothing can also be used. Note that the word node is usually interchangeable with the word vertex. Breadth- first search produces a so- called breadth first tree. You can see how a breadth first tree looks in the following example. Example. If the graph is represented by an adjacency list it occupies . However, in the application of graph traversal methods in artificial intelligence the input may be an implicit representation of an infinite graph. In this context, a search method is described as being complete if it is guaranteed to find a goal state if one exists.
Breadth- first search is complete, but depth- first search is not. When applied to infinite graphs represented implicitly, breadth- first search will eventually find the goal state, but depth- first search may get lost in parts of the graph that have no goal state and never return. That is, give label 0 to the starting vertex, 1 to all its neighbors, 0 to those neighbors' neighbors, and so on. If at any step a vertex has (visited) neighbors with the same label as itself, then the graph is not bipartite. If the search ends without such a situation occurring, then the graph is bipartite. See also. The Algorithm Design Manual. A Work- Efficient Parallel Breadth- First Search Algorithm (or How to Cope with the Nondeterminism of Reducers)(PDF). IRE Transactions on Electronic Computers. Leiserson, and Ronald L. Leiserson, and Ronald L. Leiserson, and Ronald L. Artificial Intelligence: A Modern Approach (2nd ed.). Artificial intelligence illuminated. Jones & Bartlett Learning. Algorithms for Interviews. This is one of the important Graph traversal technique. BFS - Breadth First Search Traversal - Duration: 10:48. Mifta Sintaha 23,785 views. Breadth First Search (BFS): Graph Theory - Duration. I want to perform level-order traversal of a binary tree. C Program for Depth First Binary Tree Search using. The following C program, using recursion, performs a Depth First Search traversal. Sanfoundry Global Education & Learning.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
September 2016
Categories |