What is the primary purpose of Breadth-First Search (BFS) in graph traversal?
-
To find the shortest path in a weighted graph
-
To explore all vertices at the present depth before moving on to vertices at the next depth level
-
To sort the vertices of the graph
-
To find a cycle in the graph