THE IDEA
Shortest depends on what you count.
BFS finds paths with the fewest edges. Dijkstra finds paths with the least total nonnegative weight. DFS explores one branch before backtracking and does not guarantee a shortest path.
BFS finds paths with the fewest edges. Dijkstra finds paths with the least total nonnegative weight. DFS explores one branch before backtracking and does not guarantee a shortest path.