igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] largest connected component


From: Simone Gabbriellini
Subject: [igraph] largest connected component
Date: Sun, 23 Jan 2011 11:57:08 +0100

Hello List,

what is the quickest way to find a largest connected component for a large 
graph? Consider this small graph:

> gclust
$membership
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
[24] 24  6 25 26  5 27 28 29 18 30 31 32 33  8  3 34 19 35 36 32 37 18 38
[47] 39 40 41 42 36 21  5  6 43  9  8 23 22 28 18 44 35 45 46 40 30 47  3
[70] 19 11 31 29 48 41  4 49 50 33 32

$csize
 [1] 1 1 3 2 3 3 1 3 2 1 2 1 1 1 1 1 1 4 3 1 2 2 2 1 1 1 1 2 2 2 2 3 2 1 2
[36] 2 1 1 1 2 2 1 1 1 1 1 1 1 1 1

$no
[1] 50

the largest component is the one with size = 4. So I simply have to select the 
index of the one with max $csize and pass it as a $membership value. Is this 
correct?

best,
Simone


reply via email to

[Prev in Thread] Current Thread [Next in Thread]