Summary
shortest_path finds the minimum total cost route between nodes in a
graph. In an
unweighted_graph,
bfs returns the shortest path by edge count. In a
weighted_graph with non-negative weights,
dijkstra with a
priority_queue yields minimal
path_cost.
bellman_ford handles
negative_weights and detects
negative_cycles. Outputs often include distance and predecessor to rebuild a path from
source to
target. Common uses include routing, maps, and networks.