How would you find the shortest path in a weighted graph?

  • A* Algorithm
  • Breadth-First Search
  • Depth-First Search
  • Dijkstra's Algorithm
Dijkstra's Algorithm is used to find the shortest path in a weighted graph with non-negative edge weights. It guarantees the shortest path but doesn't work with negative weights. Breadth-First and Depth-First Search are used for different purposes, and A* is for finding the shortest path with heuristics.
Add your answer
Loading...

Leave a comment

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