Graph Theory37 sections · 1633 units
Open in CourseQuiz: When to Use Floyd-Warshall
Knowledge check
Check Your Understanding
You have a graph with vertices and edges, and you need shortest paths between all pairs. You consider Floyd-Warshall () and running Dijkstra from every vertex (). Which is faster here?
- A.Dijkstra from every vertex, because the graph is sparse. operations beats
- B.They are the same because
- C.Floyd-Warshall, because its simpler constant factors outweigh the higher operation count
- D.Neither works. You need Johnson's Algorithm