Overview
BFS explores a graph level‑by‑level, finding the shortest number of edges from a source to every reachable vertex.
Loading...
Loading Curriculum...
Loading Subject...
Loading Topic...
Loading Lesson...
Loading Lab...
Explore BFS step‑by‑step on a custom graph.
BFS explores a graph level‑by‑level, finding the shortest number of edges from a source to every reachable vertex.
The queue stores frontier nodes. Dequeue → process → enqueue unvisited neighbors ensures a breadth‑first expansion.
A visited set prevents re‑exploration, guaranteeing O(V + E) runtime.
Shortest path in unweighted graphs, level order traversal, connectivity checks, and more.