igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] weighted pagerank?


From: Csardi Gabor
Subject: Re: [igraph] weighted pagerank?
Date: Sat, 23 Aug 2008 16:02:25 +0200
User-agent: Mutt/1.5.9i

Eytan,

the difference is more than 50 percent. I guess it would be more
if the weights were not uniformly distributed.

> library(igraph)
> g <- simplify(ba.game(1000, m=5))
> pg1 <- page.rank(g)
> pg2 <- page.rank(g, weights=runif(ecount(g),1,1000))
> max( (pg1$vector - pg2$vector) / pg1$vector)
[1] 0.5442513

Gabor

On Fri, Aug 22, 2008 at 07:18:30PM -0400, Eytan Bakshy wrote:
> Hello,
> 
> I am using igraph 0.51 in R and igraph 0.5 in python, and it doesn't  
> seem that specifying edge weights has any effect in either  
> implementation.  I know that the igraph 0.5 release announcement  
> mentions that Page Rank and the fast greedy algorithm supports edge  
> weights, but is this just in the C library.
> 
> In python, I tried creating several graphs where edges have the  
> attribute 'weight', which were floats.  I am trying to compute the  
> weighted pagerank by saying:
>       prw = g.pagerank(weights='weight')
> 
> and if i do:
>       pr = g.pagerank()
> the following statement yields True:
>       prw == pr
> 
> on several graphs using edge weights that were distributed uniformly  
> at random between (0,1), and then again between (1,1000)
> 
> 
> I am pretty new to R, but it appears that the same thing holds using  
> page.rank(g, weights=runif(length(E(g)),1,10000))
> 
> 
> Thanks,
> Eytan
> 
> 
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help

-- 
Csardi Gabor <address@hidden>    MTA RMKI, ELTE TTK




reply via email to

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