[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[igraph] layout repeatability in R ?
From: |
Olivier Delrieu |
Subject: |
[igraph] layout repeatability in R ? |
Date: |
Wed, 21 Apr 2010 22:49:29 +0200 |
User-agent: |
Thunderbird 2.0.0.24 (Windows/20100228) |
Dear All,
I am wondering how to achieve layout repeatability with igraph in R,
especially with the Kamada-Kawai and Fruchterman-Reingold algorithms? By
this I mean ability to produce the same result given fully specified
starting conditions.
This is quite important when exchanging data & results with other
researchers. Also, Kamada-Kawai can be used for quickly generating an
advantageous initial layout which can be passed to Fruchterman-Reingold
for a visually more significant placement of neighbored nodes.
The code below shows this is not the case with layout.drl despite
providing seed coordinates to the algorithm. Am I missing something?
Regarding Kamada-Kawai, and Fruchterman-Reingold the C++ code shows
initial configuration can be provided with 'use_seed' and 'res', but
these parameters are not documented in the R equivalent. See:
http://igraph.sourceforge.net/doc/html/igraph_layout_kamada_kawai.html
http://igraph.sourceforge.net/doc/html/igraph_layout_fruchterman_reingold.html
http://igraph.sourceforge.net/doc/R/layout.html
R code:
library(igraph)
g <- graph.de.bruijn(5,2)
coord <- layout.kamada.kawai(g)
coord2 <- layout.drl(g, use.seed=TRUE, seed=coord)
coord3 <- layout.drl(g, use.seed=TRUE, seed=coord)
X11()
plot(g,layout=coord2)
X11()
plot(g,layout=coord3)
Many thanks,
Olivier.
- [igraph] layout repeatability in R ?,
Olivier Delrieu <=