Finding "Source" in a Directed Graph

Revision en1, by WARush143, 2016-11-04 22:12:26

Hi community!

Today I am interested in this problem:

Given a directed graph, define f(v) to be the number of nodes i such you can reach i from v by moving along edges. For which values of v is f(v) maximum?

I can come up with the O(n2) algorithm, but I wonder if there is an O(n) algorithm.

Thanks!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English WARush143 2016-11-04 22:12:26 363 Initial revision (published)