Which algorithm would you use to find the shortest path in an unweighted graph?

  • Bellman-Ford algorithm
  • Breadth-First Search (BFS)
  • Depth-First Search (DFS)
  • Dijkstra's algorithm
In an unweighted graph, the shortest path can be found using Breadth-First Search (BFS). BFS explores the graph level by level, ensuring that the first time you reach a node is by the shortest path.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *