layout {igraph} | R Documentation |
Some simple and not so simple functions determining the placement of the vertices for drawing a graph.
layout.random(graph, params) layout.circle(graph, params) layout.fruchterman.reingold(graph, ..., params) layout.kamada.kawai(graph, ..., params) layout.spring(graph, ..., params)
graph |
The graph to place. |
params |
The list of function dependent parameters. |
... |
Function dependent parameters, this is an alternative
notation to the params argument. |
These functions calculate the coordinates of the vertices for a graph usually based on some optimality criterion.
layout.random
simply places the vertices randomly on a
square. It has no parameters.
layout.circle
places the vertices on a unit circle
equidistantly. It has no paramaters.
layout.fruchterman.reingold
uses a force-based algorithm
proposed by Fruchterman and Reingold, see references. Parameters and
their default values:
vcount(graph)
).vcount(graph)^2
).area
*vcount(graph)).This function was ported from the SNA package.
layout.kamada.kawai
is another force based algorithm.
Parameters and default values:
This function performs very well for connected graphs, but it gives poor results for unconnected ones. This function was ported from the SNA package.
layout.spring
is a spring embedder algorithm.
Parameters and default values:
This function was ported from the SNA package.
All these functions return a numeric matrix with at least two columns and the same number of lines as the number of vertices.
Gabor Csardi csardi@rmki.kfki.hu
Fruchterman, T.M.J. and Reingold, E.M. (1991). Graph Drawing by Force-directed Placement. Software - Practice and Experience, 21(11):1129-1164.
Kamada, T. and Kawai, S. (1989). An Algorithm for Drawing General Undirected Graphs. Information Processing Letters, 31(1):7-15.
g <- graph.ring(10) layout.random(g) layout.kamada.kawai(g)