โ 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