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
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
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
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
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
>