# layout

0th

Percentile

##### Generate coordinates for plotting graphs

Some simple and not so simple functions determining the placement of the vertices for drawing a graph.

Keywords
graphs
##### Usage
layout.random(graph, params)
layout.circle(graph, params)
layout.fruchterman.reingold(graph, ..., params)
layout.spring(graph, ..., params)
##### Arguments
graph
The graph to place.
params
The list of function dependent parameters.
...
Function dependent parameters, this is an alternative notation to the params argument.
##### Details

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:

• niter
{Numeric, the number of iterations to perform (500).} coolexp{Numeric, the cooling exponent for the simulated annealing (3).} maxdelta{Maximum change (vcount(graph)).} area{Area parameter (vcount(graph)^2).} repulserad{Cancellation radius (area*vcount(graph)).}

##### Value

• All these functions return a numeric matrix with at least two columns and the same number of lines as the number of vertices.

##### code

layout.spring

• mass

• sigma
• initemp
• coolexp
• kkconst
• equil
• k
• repeqdis
• kfr
• repulse

##### sQuote

• quasi-kilograms
• quasi-meters
• quasi-Newtons per quasi-meter
• quasi-meters
• quasi-Newton quasi-kilograms

##### References

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.

plot.igraph, tkplot

##### Aliases
• layout
• layout.random
• layout.circle
• layout.fruchterman.reingold
g <- graph.ring(10)
layout.kamada.kawai(g)