Message-ID: <20080305084529.GA10612@localdomain>
Date: 2008-03-05T08:45:38Z
From: Gábor Csárdi
Subject: vertex labels in igraph from adjacency matrix
In-Reply-To: <493D4D21-3FC6-4C53-8083-D85C93EFF965@gmail.com>
On Wed, Mar 05, 2008 at 02:27:21AM -0500, Charilaos Skiadas wrote:
[...]
>
> Btw, you will likely want to take the betweenness call out, and call
> it once and store the result, instead of calling it twice (well,
> assuming the graph is largish). Or even better, use which.max:
>
> which.max(betweenness(graph = my.graph, v=V(my.graph), directed =
> FALSE))
This is almost good, but there is a catch, in igraph vertices are
numbered from zero. So if you want an igraph vertex id, then you
need to subtract one from this, i.e.:
maxb <- which.max(betweennness(my.graph, directed=FALSE))-1
You can double check it:
betweenness(my.graph, maxb, directed=FALSE)
Gabor
PS. there is also an igraph mailing list, see the igraph homepage
at igraph.sf.net
> Haris Skiadas
> Department of Mathematics and Computer Science
> Hanover College
>
[...]
--
Csardi Gabor <csardi at rmki.kfki.hu> UNIL DGM