Using BFS for Weighted Graphs
Consider a graph like this: A—(3)—–B | | \-(1)-C–(1)/ The shortest path from A to B is via C (with a total weight of 2). A normal BFS will take the path directly from A to B, marking B as seen, and A to C, marking C as seen. At the next stage, propagating from … Read more