[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Simplify sums up weights in dev version 0.6-1899 ?
From: |
Tamas Nepusz |
Subject: |
Re: [igraph] Simplify sums up weights in dev version 0.6-1899 ? |
Date: |
Thu, 13 May 2010 11:14:31 -0400 |
> In stable version of igraph these commands transform graph with multiple
> edges into weighted graph:
>
> E(g2)$weight<-count.multiple(g2)
> g2=simplify(g2)
>
> But not in igraph_nightly_0.6-1899-20100505. It's like this because new
> simplify() apart from removing multiple edges it also sums up weights of
> those edges and put them all into the edge left.
>
> Is it intentional or a bug? How can I create weighted graph in dev version?
It is intentional and part of some of the changes in attribute handling that we
will roll out in igraph 0.6. In particular, you will be able to define
"combining functions" for attributes that tell igraph how to infer the
attributes of edges in the new graph that are merged from multiple edges in the
old graph. The same will apply to vertices as well. It looks like "sum" is the
default combining function in the R interface now. The solution is simple:
E(g2)$weight <- 1
g2 = simplify(g2)
--
T.