igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] simplify and edge.attr.comb


From: Gábor Csárdi
Subject: Re: [igraph] simplify and edge.attr.comb
Date: Sun, 24 Nov 2013 12:12:23 -0500

On Sun, Nov 24, 2013 at 11:57 AM, Hermann Norpois <address@hidden> 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
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>



reply via email to

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