[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Simple Graph Analysis
From: |
Gábor Csárdi |
Subject: |
Re: [igraph] Simple Graph Analysis |
Date: |
Fri, 15 May 2009 14:50:31 +0200 |
Lorenzo,
On Fri, May 15, 2009 at 2:13 PM, Lorenzo Isella
<address@hidden> wrote:
> Dear All,
> I am trying to do rather basic things with Igraph and R, but I am
> experiencing some problems.
> I paste below one code I am using: it generates a random graph via the
> adjacency matrix.
> First, I try to plot it as it is.
> Second, I highlight its diameter.
> Third (and last): I try to plot the graph and to highlight its largest
> component.
> Probably I am misunderstanding something, since the diameter in the
> second figure I generate does not look like the "longest shortest
> path" (http://mathworld.wolfram.com/GraphDiameter.html)
it definitely does to me. Or can you find a longer shortest path?
> and above all
> when I try to plot the largest cluster of connected nodes in the
> graph, I see also some totally isolated nodes.
[...]
> select_vertices <- V(g)[which(cluster_structure$membership==0)]
Should be
select_vertices <- V(g)[cluster_structure$membership==0]
or
select_vertices <- V(g)[which(cluster_structure$membership==0)-1]
This is the 0/1-based indexing catch.
G.
[...]
--
Gabor Csardi <address@hidden> UNIL DGM