Back to Academy
graphs
Dijkstra's Algorithm
Dijkstra's Algorithm finds the shortest path from a source vertex to all other vertices in a weighted graph with non-negative edge weights. It uses a greedy approach, always expanding the closest unvisited vertex. It is widely used in routing protocols and navigation systems.
Use Cases
- •GPS navigation and shortest route finding
- •Network routing protocols (OSPF)
- •Finding shortest paths in games and simulations
Complexity Analysis
| Metric | Best | Average | Worst |
|---|---|---|---|
| Time | O((V + E) log V) | O((V + E) log V) | O((V + E) log V) |
| Space | O(V) | ||
Visualization
Implementation
Output
Click "Run Code" to see output...