ok the algo will go like this :
count no of nodes having only indegree 0 , only outdegree 0 and both 0. say
in_count,out_count and both_count are the corresponding counts.
now decrease the counts accordingly if u found a matching like u can
decrease in_count by both_count if both_count<in_count ie. in = in-both and
increase and by both_count and give priority to both_count for eliminating
the counts. I hope this is clear .. i know its not much but i just did the
mapping from the in_count and out_count .. its just u have to consider the
both_count differently and hope u know why, which can make the algo somehow
complex. the main idea is that if every node has a out degree >0 and in
degree>0 your graph is connected !! and i m just making that.

On Mon, Oct 8, 2012 at 8:37 PM, Jaspreet Singh <jassajjassaj...@gmail.com>wrote:

> yeah you are correct bharat .. so i think it should be no. of nodes
> having 0 (in-degree + out-degree). what say ?
>
>
> On Mon, Oct 8, 2012 at 8:20 PM, bharat b <bagana.bharatku...@gmail.com>wrote:
>
>> @jaspreet: take an ex:
>>  B->A
>> B->C
>> B->D
>> Here the no.of zero-indegree is one . But its not the correct ans.
>>
>>
>> On Mon, Oct 8, 2012 at 1:19 AM, Jaspreet Singh <jassajjassaj...@gmail.com
>> > wrote:
>>
>>> count the no. of nodes having 0 in-degree.
>>>
>>>
>>> On Mon, Oct 8, 2012 at 12:44 AM, atul anand <atul.87fri...@gmail.com>wrote:
>>>
>>>> yeah i read it wrongly ...... i thought ques was asking to find total
>>>> strongly connected component in the graph
>>>>
>>>> On 10/7/12, bharat b <bagana.bharatku...@gmail.com> wrote:
>>>> > @atul : if there is no cut vertex, that doesn't mean that graph is
>>>> strongly
>>>> > connected ...
>>>> >
>>>> >
>>>> > On Sat, Oct 6, 2012 at 7:37 PM, atul anand <atul.87fri...@gmail.com>
>>>> wrote:
>>>> >
>>>> >> find no. of cut vertex in the DAG....that will be the ans.
>>>> >> On 6 Oct 2012 19:33, "KK" <kunalkapadi...@gmail.com> wrote:
>>>> >>
>>>> >>> Given a DAG(Directed Acyclic Graph). How to find out the minimum
>>>> number
>>>> >>> of edges that needs to be added so that the given graph becomes
>>>> Strongly
>>>> >>> Connected?
>>>> >>>
>>>> >>> --
>>>> >>> You received this message because you are subscribed to the Google
>>>> >>> Groups
>>>> >>> "Algorithm Geeks" group.
>>>> >>> To view this discussion on the web visit
>>>> >>> https://groups.google.com/d/msg/algogeeks/-/PbR3j9S5OXUJ.
>>>> >>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> >>> To unsubscribe from this group, send email to
>>>> >>> algogeeks+unsubscr...@googlegroups.com.
>>>> >>> For more options, visit this group at
>>>> >>> http://groups.google.com/group/algogeeks?hl=en.
>>>> >>>
>>>> >>  --
>>>> >> You received this message because you are subscribed to the Google
>>>> Groups
>>>> >> "Algorithm Geeks" group.
>>>> >> To post to this group, send email to algogeeks@googlegroups.com.
>>>> >> To unsubscribe from this group, send email to
>>>> >> algogeeks+unsubscr...@googlegroups.com.
>>>> >> For more options, visit this group at
>>>> >> http://groups.google.com/group/algogeeks?hl=en.
>>>> >>
>>>> >
>>>> > --
>>>> > You received this message because you are subscribed to the Google
>>>> Groups
>>>> > "Algorithm Geeks" group.
>>>> > To post to this group, send email to algogeeks@googlegroups.com.
>>>> > To unsubscribe from this group, send email to
>>>> > algogeeks+unsubscr...@googlegroups.com.
>>>> > For more options, visit this group at
>>>> > http://groups.google.com/group/algogeeks?hl=en.
>>>> >
>>>> >
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to