I would like to make a graph algorithm that updates / calculates the value of a node f(n) as a function of each of the values of f(n) neighboring nodes.
- The schedule is directed.
- Each node has an initial value of f (n).
- Each edge has no cost (0).
- The value of each node is its maximum current value, and the value of each neighboring node (oriented graph, so the neighbors are those from where the node has incoming edges).
More formally
f(n) = max(f(n),max_i(f(n_i))), where i from neighbor 1 to neighbor k.
I can imagine several ways to do this, but I do not know to what extent they are optimal.
Can anyone give suggestions and comments (how do you think your proposal is optimal) or suggest any existing graph algorithm that I can adapt?
source share