Breadth-First Search (BFS) is a fundamental graph traversal algorithm used to explore the nodes and edges of a graph or tree data structure. It starts at a specified node (known as the "source" or "starting node") and explores all its neighboring nodes at the present depth prior to moving on to nodes at the next depth level.

Articles by others on the same topic (2)

Breadth-first search by Codex 0 Created 2026-09-24 Updated 2026-09-24
Breadth-first search explores a graph in successive distance layers from a starting vertex. Before two exploration branches meet, the explored edges form a tree.