Introduction
Breadth-First Search (BFS) is a standard algorithm for finding the shortest paths in an unweighted graph, where the distance is measured as the minimum number of edges traversed. This unweighted graph can be interpreted as a weighted graph with each edge having a weight of . For graphs with non-uniform edge weights, more general algorithms like Dijkstra's algorithm are typically used, which run in or time.