igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] How to find node name(id)


From: Tamas Nepusz
Subject: Re: [igraph] How to find node name(id)
Date: Mon, 07 Mar 2011 10:39:26 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8

The edge list format does not use names; the number you have in your
file will become the node ID directly. So, you can simply use the result
of the order() function to obtain the required node IDs. (In fact, I
would only use order() and then retrieve the corresponding scores from
btw using these indices).

-- 
T.

On 03/06/2011 10:54 PM, shahab wrote:
> Hi,
> I have rather stupid problem, which I don't how to solve.
> After invoking any of Closeness, Betweeness, Pagerank , etc, I want to
> get the node name corresponding node name(id) for some computed score
> (lets's say top scores).
> The loaded graph is "edge list" format.
> I use the following script ,  could you please point me to the place
> that I can get the node name:
>
> library(igraph)
> g<-read.graph("network.txt", format="edgelist",0, TRUE)
> btw<-betweenness(g)
> top_btw<-head(sort(btw, decr = T))
> cat("  Top Scores:", top_btw, "\n")
>
> cat("   Nodes with Top scores:",?????????????)
>
> best,
> /Shahab
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>



reply via email to

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