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