Replace breadth-first search by Dijkstra's algorithm from , using the positive edge weights to compute . The strongly connected components, the condensation graph and the reverse-topological order propagation are unchanged, because reachability ignores weights. Only the label assigned to a reachable vertex changes.
With a binary heap, the total time is , including the linear component-processing stages. More specialized priority queues give their corresponding shortest-path bounds. The proof still compares the precomputed distances from ; it must not add the weight of a path from to the candidate, which would optimize a different quantity.
Articles by others on the same topic
There are currently no matching articles.