|
From: | Wang, Jing |
Subject: | Re: [igraph] calculate edge weight based on node weight |
Date: | Thu, 8 May 2014 21:09:49 +0000 |
User-agent: | Microsoft-MacOutlook/14.4.1.140326 |
Thanks! It is really fast.
Jing
From: Gábor Csárdi <address@hidden>
Reply-To: Help for igraph users <address@hidden> Date: Thursday, May 8, 2014 at 4:05 PM To: Help for igraph users <address@hidden> Subject: Re: [igraph] calculate edge weight based on node weight No, it won't take a long time. This is in fact the fastest solution, both in practice, and also optimal in terms of time complexity. E.g.
g <- graph.ring(10)
V(g)$w <- 1:10
el <- get.edgelist(g, names=FALSE)
E(g)$w <- V(g)$w[el[,1]] * V(g)$w[el[,2]]
plot(g, edge.label=E(g)$w, vertex.label=V(g)$w)
G.
On Thu, May 8, 2014 at 4:57 PM, Wang, Jing
<address@hidden> wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |