Concept Flow - Shortest Path in DAG Using Topological Order
Build graph with edges and weights
Find topological order
Initialize distances (start=0, others=∞)
For each node in topo order
Relax edges from current node
Update distances if shorter path found
Done
Shortest distances from start to all nodes
We first build the graph, find a topological order, then relax edges in that order to find shortest paths.