igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Merge 2 Graphs with all vertices and edges or add edges to


From: Tamás Nepusz
Subject: Re: [igraph] Merge 2 Graphs with all vertices and edges or add edges to a graph an connect randomly
Date: Mon, 7 Jul 2014 10:57:11 +0200

> Hello!Maybe somebody can help us with our current iGraph project.In this 
> project is 
> a network to be expanded. By 5%, 10% and so on. How can we add randomly 
> vertices and edges  
> to an existing network in R, iGraph? Another idea was to create a random 
> network (e.g.  
> "erdos.renyi.game(20, .8)") and to merge the existing network and the random 
> network.  
> We used "graph.union" but only the edges were merged, not the vertices.
If your graph has N vertices and you want to add a random portion such that the 
union has N+M vertices, generate a random graph with erdos.renyi.game() with 
N+M vertices, remove any edge having both its endpoints in {1..N}, and create 
the union of this graph and your original graph.

T.



reply via email to

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