[algogeeks] Re: I'm stuck with this problem

2007-10-17 Thread Mayur
Google for connected components... you'll probably land up some method using disjoint set structures and depth-first search... On 10/16/07, Muntasir Azam Khan <[EMAIL PROTECTED]> wrote: > > > > On Oct 14, 10:18 am, Legend <[EMAIL PROTECTED]> wrote: > > Suppose that I have some data: > > > > 12,30

[algogeeks] Re: I'm stuck with this problem

2007-10-16 Thread Muntasir Azam Khan
On Oct 14, 10:18 am, Legend <[EMAIL PROTECTED]> wrote: > Suppose that I have some data: > > 12,30 > 12,45 > 2,3 > 7,8 > 3,9 > 30, 8 > 45,54 > 56,65 > > Where (a,b) indicates that a is connected to b. I want to get all > connected nodes to one point. For instance, the output of the above > exampl

[algogeeks] Re: I'm stuck with this problem

2007-10-14 Thread kunzmilan
On 14 Říj, 06:18, Legend <[EMAIL PROTECTED]> wrote: > Suppose that I have some data: > > 12,30 > 12,45 > 2,3 > 7,8 > 3,9 > 30, 8 > 45,54 > 56,65 > > Where (a,b) indicates that a is connected to b. I want to get all > connected nodes to one point. For instance, the output of the above > example s

[algogeeks] Re: I'm stuck with this problem

2007-10-14 Thread chitta koushik
Algo: 1. Maintain a separate array class[] to indicate which element(a,b) belong to which class 2. assign first(a,b) to class 1. in eg: 12,30 to class 1 3. for each other element from then compare with members of existing class if yes assign this element with same class, else assign different cla

[algogeeks] Re: I'm stuck with this problem

2007-10-14 Thread Vijay Chidambaram
Legend wrote: > Suppose that I have some data: > > 12,30 > 12,45 > 2,3 > 7,8 > 3,9 > 30, 8 > 45,54 > 56,65 > > Where (a,b) indicates that a is connected to b. I want to get all > connected nodes to one point. For instance, the output of the above > example should be something like: > > Group 1 >