User Tools

Site Tools


algorithms:bfs

Starting from an initial node, a breadth-first search [BFS] calculates the distances (number of hops) to every other reachable node in the network. The result is assigned to all the other nodes as a new property.

Input parameter Type Default Description
Starting node* text None Initial NodeLabel

* Required Field

In the following network we plot the initial node (red) and color the other nodes according to its BFS value. We can observe that, for our choice of initial node, most of the network is two or three hops away (orange and blue nodes) and the further node is 5 hops away (purple nodes).



References:

  • M.E.J. Newman, Networks, an introduction, Oxford University Press, 2010, ISBN: 978-0-19-920665-0, sec. 10.3.3.
algorithms/bfs.txt · Last modified: 2018/12/20 14:18 by systems