title: DFS on each node of the graph
body: <p>Let's say in my directed graph G = (V, E), I have nodes which have certain numbers assigned to it, n[v]. I want to find the highest n[v] for each vertex, that is max(n[v]) means the maximum n[v] of the node reachable from each vertex in G.<br/>
  What would we the efficient to solve this?<br/>
  I am thinking on the lines of DFS on each node without backtracking and comparing the n[v] for all the 'visited' nodes and storing the maximum n[v] value for that path.<br/>
  However, I am afraid that this might not be the efficient solution.</p>