fruchterman_reingold function

Perform Fruchterman-Reingold layout of a network in 2 or more dimensions.

Perform Fruchterman-Reingold layout of a network in 2 or more dimensions.

This was written and incorporated into the VBLPCM package because the Fruchterman-Reingold routine in the network package only works in two dimensions.

fruchterman_reingold(net, D=2, steps=1000, repulserad=N^D, m=N*(D-1), volume=N*(D-1))

Arguments

  • net: network object on which to perform Fruchterman-Reingold layout.
  • D: Desired dimension of the space in which to lay out the network.
  • steps: Number of desired iterations.
  • repulserad: The radius at which repulsion and attraction of linked nodes are equal.
  • m: The maximum change in position per iteration.
  • volume: The volume of space within which to position the nodes.

Returns

An N*D matrix of coordinates.

Author(s)

Michael Salter-Townshend

See Also

log_like_forces

Examples

### 2D example ### load the aids blogs dataset data(aids) ### perform the Fruchterman-Reingold layout X<-fruchterman_reingold(aids.net, D=2, steps=1e3) ### plot the results plot(X) ### 3D example ### load the aids blogs dataset data(aids) ### perform the Fruchterman-Reingold layout X<-fruchterman_reingold(aids.net, D=3, steps=1e3) ### Not run ### plot the results in 3D # library(rgl) # plot3d(X)
  • Maintainer: Michael Salter-Townshend
  • License: GPL (>= 2)
  • Last published: 2023-03-22