🗺️ GRAPH ALGORITHMS — MIND MAP
Representation → Adjacency Matrix O(V²) space | Adjacency List O(V+E) space
DFS → Stack/Recursion | O(V+E) | Explores depth-first | Applications: cycle detection, topo sort
BFS → Queue | O(V+E) | Explores level-by-level | Applications: shortest path (unweighted), level order
Topological Sort → DFS-based or Kahn's (in-degree) | Only for DAGs (Directed Acyclic Graphs)
Dijkstra → Greedy | Single Source Shortest Path | No negative weights | O(V²) or O(E log V)
Bellman-Ford → DP | Single Source | Handles negative weights | Detects negative cycles | O(VE)
Floyd-Warshall → DP | All-Pairs Shortest Path | O(V³) | D[i][j] = min(D[i][j], D[i][k]+D[k][j])
Sollin's (Borůvka's) → MST | Each component picks cheapest outgoing edge | O(E log V)