File: layout_with_graphopt.Rd

package info (click to toggle)
r-cran-igraph 2.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,044 kB
  • sloc: ansic: 204,981; cpp: 21,711; fortran: 4,090; yacc: 1,229; lex: 519; sh: 52; makefile: 8
file content (98 lines) | stat: -rw-r--r-- 3,167 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/layout.R
\name{layout_with_graphopt}
\alias{layout_with_graphopt}
\alias{with_graphopt}
\title{The graphopt layout algorithm}
\usage{
layout_with_graphopt(
  graph,
  start = NULL,
  niter = 500,
  charge = 0.001,
  mass = 30,
  spring.length = 0,
  spring.constant = 1,
  max.sa.movement = 5
)

with_graphopt(...)
}
\arguments{
\item{graph}{The input graph.}

\item{start}{If given, then it should be a matrix with two columns and one
line for each vertex. This matrix will be used as starting positions for the
algorithm. If not given, then a random starting matrix is used.}

\item{niter}{Integer scalar, the number of iterations to perform.  Should be
a couple of hundred in general. If you have a large graph then you might
want to only do a few iterations and then check the result. If it is not
good enough you can feed it in again in the \code{start} argument. The
default value is 500.}

\item{charge}{The charge of the vertices, used to calculate electric
repulsion. The default is 0.001.}

\item{mass}{The mass of the vertices, used for the spring forces. The
default is 30.}

\item{spring.length}{The length of the springs, an integer number. The
default value is zero.}

\item{spring.constant}{The spring constant, the default value is one.}

\item{max.sa.movement}{Real constant, it gives the maximum amount of
movement allowed in a single step along a single axis. The default value is
5.}

\item{...}{Passed to \code{layout_with_graphopt()}.}
}
\value{
A numeric matrix with two columns, and a row for each vertex.
}
\description{
A force-directed layout algorithm, that scales relatively well to large
graphs.
}
\details{
\code{layout_with_graphopt()} is a port of the graphopt layout algorithm by Michael
Schmuhl. graphopt version 0.4.1 was rewritten in C and the support for
layers was removed (might be added later) and a code was a bit reorganized
to avoid some unnecessary steps is the node charge (see below) is zero.

graphopt uses physical analogies for defining attracting and repelling
forces among the vertices and then the physical system is simulated until it
reaches an equilibrium. (There is no simulated annealing or anything like
that, so a stable fixed point is not guaranteed.)
}
\seealso{
Other graph layouts: 
\code{\link{add_layout_}()},
\code{\link{component_wise}()},
\code{\link{layout_}()},
\code{\link{layout_as_bipartite}()},
\code{\link{layout_as_star}()},
\code{\link{layout_as_tree}()},
\code{\link{layout_in_circle}()},
\code{\link{layout_nicely}()},
\code{\link{layout_on_grid}()},
\code{\link{layout_on_sphere}()},
\code{\link{layout_randomly}()},
\code{\link{layout_with_dh}()},
\code{\link{layout_with_fr}()},
\code{\link{layout_with_gem}()},
\code{\link{layout_with_kk}()},
\code{\link{layout_with_lgl}()},
\code{\link{layout_with_mds}()},
\code{\link{layout_with_sugiyama}()},
\code{\link{merge_coords}()},
\code{\link{norm_coords}()},
\code{\link{normalize}()}
}
\author{
Michael Schmuhl for the original graphopt code, rewritten and
wrapped by Gabor Csardi \email{csardi.gabor@gmail.com}.
}
\concept{graph layouts}
\keyword{graphs}