[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: [igraph] How to transform nodes into (sub(graphs

**From**: |
Tamás Nepusz |

**Subject**: |
Re: [igraph] How to transform nodes into (sub(graphs |

**Date**: |
Sat, 20 Jul 2013 23:07:04 +0200 |

>* I have written some code that goes through the nodes and makes a list*
>* of replacement graphs. How can I now make a new graph h from these*
>* small graphs? My problem is that disjoint union will renumber the*
>* vertices making it hard to work out which nodes to connect to which.*
It is not documented but disjoint union renumbers the vertices in order of
appearance. For example, let us assume that you are taking the disjoint union
of three graphs: G1, G2 and G3. G1 has V1 vertices, G2 has V2 and G3 has V3.
The result graph will have V1+V2+V3 vertices (of course); the first V1 vertices
(from vertex 0 to vertex V1-1) will belong to G1, vertices V1 to vertices
V1+V2-1 will belong to G2, and vertices V1+V2 to V1+V2+V3-1 will belong to G3.
Hope this helps in working out how your small graphs should be connected.
--
T.