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
Repeat until all nodes processed
Distances array has shortest paths
Build graph, find topological order, then relax edges in that order to find shortest paths.
