← Algorithm Design learning pathAlgorithm Design · Module 6 of 10
Graph algorithms
Solve path, connectivity and spanning problems.
📖 Key ideas
- BFS: shortest path in unweighted graphs.
- Dijkstra: shortest paths with non-negative weights.
- Bellman-Ford handles negative weights and detects negative cycles.
- Floyd-Warshall: all-pairs shortest paths O(V³).
- MST: Kruskal (edges + union-find), Prim (grow from a vertex).
💡 Real-life example: Shortest path algorithms are Google Maps choosing the quickest route between places.
DijkstraSingle-source shortest paths, non-negative weights
Bellman-FordHandles negative weights
Floyd-WarshallAll-pairs shortest paths
MSTMinimum spanning tree