igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] union.graph as reverse decompose.graph ?


From: Tamas Nepusz
Subject: Re: [igraph] union.graph as reverse decompose.graph ?
Date: Sun, 23 Aug 2015 22:24:45 +0200

How about graph.disjoint.union()? If the vertex sets of your graphs
are disjoint, this will simply unify them and concatenate the
corresponding attribute vectors.

T.
T.


On Thu, Aug 20, 2015 at 1:59 PM, Hermann Norpois <address@hidden> wrote:
> Hello,
>
> I would like to reverse the decompose.graph procedure. I guesse graph.union
> is the correct tool to do so. But I have some problems with the names of the
> attributes. I know it is documented ...
>
> As union keeps the attributes of all graphs... "All graph, vertex and edge
> attributes are copied to the result. If an attribute is present in multiple
> graphs and would result a name clash, then this attribute is renamed by
> adding suffixes: _1, _2, etc."
>
> Actually, I am looking for a way to restore my original attributes.
> Example:
>
> Let netz be the original net and rnetz the reunified net ...
> netz.dec <- decompose (netz)
> rnetz <- graph.union (netz.dec)
>
> # The attributes of the original net (netz)
> list.edge.attributes (netz)
> [1] "weight"
> list.vertex.attributes (netz)
> [1] "name" "x"    "y"
>
> # The attributes of the reunified net (rnetz)
> list.edge.attributes (rnetz)
> [1] "weight_1" "weight_2" "weight_3" "weight_4" "weight_5" "weight_6"
> "weight_7"
> [8] "weight_8"
> list.vertex.attributes (rnetz)
>  [1] "x_1"  "x_2"  "x_3"  "x_4"  "x_5"  "x_6"  "x_7"  "x_8"  "y_1"  "y_2"
> [11] "y_3"  "y_4"  "y_5"  "y_6"  "y_7"  "y_8"  "name"
>
> How do I change the attributes of the reunified net (rnetz) to the
> attributes of the original net (netz)?
>
> 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]