[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] per-vertex statistics of edge weights
From: |
Gábor Csárdi |
Subject: |
Re: [igraph] per-vertex statistics of edge weights |
Date: |
Wed, 15 Aug 2012 21:04:47 -0400 |
On Wed, Aug 15, 2012 at 4:10 PM, Sam Steingold <address@hidden> wrote:
[...]
> Also, this takes forever and consumes almost all 8GB RAM.
> It has been running on
>
> --8<---------------cut here---------------start------------->8---
> IGRAPH DNW- 18590 6734992 --
> + attr: name (v/c), count (v/n), weight (e/n)
> --8<---------------cut here---------------end--------------->8---
>
> for an hour and a half now.
[...]
g <- erdos.renyi.game(18590, 6734992, type="gnm")
E(g)$weight <- runif(ecount(g))
and then
al <- get.adjedgelist(g)
w <- E(g)$weight
tmp <- sapply(al, function(e) mean(w[e]))
is fairly quick:
> system.time(tmp <- sapply(al, function(e) mean(w[e])))
user system elapsed
1.353 0.069 1.458
Gabor
--
Gabor Csardi <address@hidden> MTA KFKI RMKI