Problem Statement:
Let G = (V,E) be a directed graph with costs ce ∈ ℝ on each edge e ∈ E. There are no negative cycles in G. Suppose there is a sink node t ∈ V, and for each node v ∈ V, there is a label dv ∈ ℝ.
Give an algorithm that decides, in linear time, whether it is true that for each v ∈ V, dv is the cost of the minimum-cost path from v to the sink node t.
Attempt:
The biggest challenge I find is the linear time limitation. The most relevant algorithm to consider here is the Bellman-Ford algorithm, but runs in O(|V|·|E|) time which is too slow, so it requires modifying for this problem.
I have also made an observation:
If, for example, (u,v) ∈ E and c(u,v) = 1, and du = 3 and dv = 5, then the label dv is wrong. This is because passing from v to u with a cost of 1 and travelling from u to t in a minimum cost of 3 for a total cost of 4 is shorter than the supposed minimum cost from v to t given by dv, which is 5.
I'm not sure if I can use this insight to produce a linear algorithm, but it's the furthest I have gotten so far.