On Sun, Nov 24, 2013 at 11:57 AM, Hermann Norpois <[email protected]> wrote:
> Hello,
> I have an undirected graph g and I used
>
> g <- simplify (g)
>
> to remove multiple edges. The problem is that I dont find the correct
> syntax for edge.attr.comp. I want my weights (for E(g)$weight) not being
> altered. The weights should not be touched at all. I just want multiple
> edges to vanish.

You need to do _something_ with the weights, because you are merging
multiple edges into a single one, and these edges potentially have
different weights. You cannot have them "not to be touched at all".

> I tried
>  g <- simplify (g, edge.attr.comb=list (weight=function (x) unique (x),
> name="ignore"))

I see. So you are sure that multiple edges between two vertices always
have the same weight? Then this is a good solution.

> and it seems to work but I am not happy with it.

Why?

> Could you please help to ameliorate the expression?

You can say weight="first" which is the same, if all the weights are
the same, but how much better is that?

G.

> Thanks
> Hermann
>
> _______________________________________________
> igraph-help mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>

_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to