Aaman007's blog

By Aaman007, 8 months ago, In English,

Given a directed graph of n nodes and m edges . What is the minimum number of edges that should be added to the graph so that from each node , it is possible to travel all the other nodes .

One of the approach to find the result was to count number of node that has indegree 0 in cnt1 and number of node that has outdegree 0 in cnt2 . Then the result is max(cnt1,cnt2) . But I couldn't understood this approach . Can someone explain it or provide any other approach to find the result .

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it
»
7 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it