โ† Algorithm Design learning path
Algorithm Design ยท Module 6 of 10

Graph algorithms

Solve path, connectivity and spanning problems.

๐Ÿ“– Key ideas

  1. BFS: shortest path in unweighted graphs.
  2. Dijkstra: shortest paths with non-negative weights.
  3. Bellman-Ford handles negative weights and detects negative cycles.
  4. Floyd-Warshall: all-pairs shortest paths O(Vยณ).
  5. 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