layout {igraph}R Documentation

Generate coordinates for plotting graphs

Description

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

Usage

layout.random(graph, params)
layout.circle(graph, params)
layout.fruchterman.reingold(graph, ..., params)
layout.kamada.kawai(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:

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.

Value

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

Author(s)

Gabor Csardi csardi@rmki.kfki.hu

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.

See Also

plot.igraph, tkplot

Examples

g <- graph.ring(10)
layout.random(g)
layout.kamada.kawai(g)

[Package igraph version 0.1.2 Index]