Shortest path
Also known as: Shortest paths, Pathfinding
A shortest path between two nodes minimizes the sum of edge weights (or the hop count when every weight is 1). Algorithms differ by graph assumptions:
- Unweighted: BFS
- Nonnegative weights, single source: Dijkstra
- Negative weights allowed: Bellman-Ford
- All pairs, dense: Floyd-Warshall
- Heuristic search on large implicit graphs: A*
Always state the weight model on exams. “Shortest” without weights usually means fewest edges.