igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Connected Components


From: Tamas Nepusz
Subject: Re: [igraph] Connected Components
Date: Thu, 5 Nov 2009 14:07:45 +0000

Hence cluster number three is the biggest. Since counting starts at 0
in igraph, this means that the connected component consists of the
vertices:

selected_vertices <- V(g)[which(g_clusters$membership == 2)]
This is another common catch with igraph in R: vertex IDs also start from zero, so you'll have to subtract 1 from the vertex IDs as well:

selected_vertices <- V(g)[which(g_clusters$membership == 2) - 1]

--
Tamas





reply via email to

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