Breadth-First Search (Beta)
Breadth-first Search (BFS) is an algorithm used to explore the vertexes of a graph layer by layer. It starts at the given vertex and explores all vertices at the present depth prior to moving on to the vertices at the next depth level.
Specifications
Characteristic | Value |
Result | Returns all the nodes that are accessible from the source vertex |
Required Input Parameters |
|
Result Size | V = number of vertices |
Time Complexity | O(E+V), E = number of edges, V = number of vertices.since every vertex and every edge will be explored in the worst case. |
Graph Types | Directed or Undirected edges, Weighted or Unweighted edges |
Example
In the example below, we run tg_bfs
algorithm from the source vertex alex
on the social10 graph.
Below is the visualized result of the query:
Last updated