breadth-first search

Breadth-first search (BFS) is a graph traversal algorithm used to explore or search a connected and undirected graph or tree. It starts at a given vertex or node and explores all its neighboring vertices before moving on to the next level of neighbors. This process is repeated layer-by-layer until all vertices have been visited, ensuring that all vertices at a given level are explored before moving deeper into the graph. BFS efficiently finds the shortest path between a starting vertex and any other vertex in an unweighted graph.

Requires login.