igraph-help
[Top][All Lists]
Advanced

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

[igraph] How to construct graphs dynamically?


From: Xuan Wang
Subject: [igraph] How to construct graphs dynamically?
Date: Fri, 3 Jan 2014 11:34:56 +0800

Thanks a lot!

I might also need some help with another question:

I have a graph A, then I want to add edges dynamically to the graph. Currently what I am doing is: use get.edgelist(A) to get the edgelist as a matrix, then change this matrix into a vector, then attach new edges to the end this vector, and finally use graph(edges, n) to construct the new graph.

I want to add edges to the graph one by one. Each edge is added based on the structure of the graph in the previous step. What would be an efficient way of doing this?

Thanks,

Xuan Wang (PhD)
Department of Statistics and Operations Research,
University of North Carolina at Chapel Hill,
Chapel Hill, NC, 27514




On Jan 3, 2014, at 1:00 AM, address@hidden wrote:


In my mind, the ideal way of doing this is starting with the layout layout.fruchterman.reingold(A), then add a few edges and do a few more iterations on the layout to get the layout for graph B. Could anyone help me with this?

layout.fruchtermain.reingold() has a parameter named ?start? where you can pass a two-column matrix with the initial positions of the vertices. You may also want to specify the ?niter? parameter for the second call in order to run a few iterations only instead of 500 (the default).

T.



reply via email to

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