[R] Merging graphs with common nodes

From: ssamberkar <ssamberkar_at_gmail.com>
Date: Wed, 23 Mar 2011 10:03:21 -0700 (PDT)

Hello Everyone!

This is my first post to the mailing list so please forgive me if I am a bit deflected from the general format of this mailing list posts. Since I need help in this matter urgently, I would cover up any of my mistakes in posting later.

That said, I have a problem in merging 2 graphs that have common nodes between them. I have a graph G1, that have nodes N1 and edge set E1 and graph G2, with nodes N2, edge set E2. Nodes N1 and N2 have some common nodes in them say N3 = N1(intersection)N2. I want to create a new graph G3 such that it has interactions from both these graphs amongst these nodes. Like union of G1, G2.

Trouble is when I use Igraph and do the addition of edges and vertices into the new graph, the associations are not consistent. For eg

A -- B in G1

B -- C in G2

so in G3 I would expect

A -- B

B -- C

Instead I get B -- Z which baffles me.

I tried getting around this all day but couldn't come up with the resultant graph. I am sure I am missing something basic here but the Igraph documentation is not that helpful.
Any suggestions and tips?

Thanks in advance..


Sandeep Amberkar

PhD Student,

Bioquant, University of Heidelberg,Germany


View this message in context: http://r.789695.n4.nabble.com/Merging-graphs-with-common-nodes-tp3400017p3400017.html Sent from the R help mailing list archive at Nabble.com.

        [[alternative HTML version deleted]]

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 23 Mar 2011 - 18:42:14 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Mar 2011 - 13:50:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive