igraph (version 0.1.2)

layout: 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.

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

itemize

  • mass

item

  • 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

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)).}

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

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

Run the code above in your browser using DataLab