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 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
|
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/layout.R
\name{layout_with_kk}
\alias{layout_with_kk}
\alias{with_kk}
\title{The Kamada-Kawai layout algorithm}
\usage{
layout_with_kk(graph, coords = NULL, dim = 2, maxiter = 50 *
vcount(graph), epsilon = 0, kkconst = vcount(graph), weights = NULL,
minx = NULL, maxx = NULL, miny = NULL, maxy = NULL, minz = NULL,
maxz = NULL, niter, sigma, initemp, coolexp, start)
with_kk(...)
}
\arguments{
\item{graph}{The input graph. Edge directions are ignored.}
\item{coords}{If not \code{NULL}, then the starting coordinates should be
given here, in a two or three column matrix, depending on the \code{dim}
argument.}
\item{dim}{Integer scalar, 2 or 3, the dimension of the layout. Two
dimensional layouts are places on a plane, three dimensional ones in the 3d
space.}
\item{maxiter}{The maximum number of iterations to perform. The algorithm
might terminate earlier, see the \code{epsilon} argument.}
\item{epsilon}{Numeric scalar, the algorithm terminates, if the maximal
delta is less than this. (See the reference below for what delta means.) If
you set this to zero, then the function always performs \code{maxiter}
iterations.}
\item{kkconst}{Numeric scalar, the Kamada-Kawai vertex attraction constant.
Typical (and default) value is the number of vertices.}
\item{weights}{Edge weights, larger values will result longer edges.}
\item{minx}{If not \code{NULL}, then it must be a numeric vector that gives
lower boundaries for the \sQuote{x} coordinates of the vertices. The length
of the vector must match the number of vertices in the graph.}
\item{maxx}{Similar to \code{minx}, but gives the upper boundaries.}
\item{miny}{Similar to \code{minx}, but gives the lower boundaries of the
\sQuote{y} coordinates.}
\item{maxy}{Similar to \code{minx}, but gives the upper boundaries of the
\sQuote{y} coordinates.}
\item{minz}{Similar to \code{minx}, but gives the lower boundaries of the
\sQuote{z} coordinates.}
\item{maxz}{Similar to \code{minx}, but gives the upper boundaries of the
\sQuote{z} coordinates.}
\item{niter,sigma,initemp,coolexp}{These arguments are not supported from
igraph version 0.8.0 and are ignored (with a warning).}
\item{start}{Deprecated synonym for \code{coords}, for compatibility.}
\item{...}{Passed to \code{layout_with_kk}.}
}
\value{
A numeric matrix with two (dim=2) or three (dim=3) columns, and as
many rows as the number of vertices, the x, y and potentially z coordinates
of the vertices.
}
\description{
Place the vertices on the plane, or in the 3d space, based on a phyisical
model of springs.
}
\details{
See the referenced paper below for the details of the algorithm.
This function was rewritten from scratch in igraph version 0.8.0 and it
follows truthfully the original publication by Kamada and Kawai now.
}
\examples{
g <- make_ring(10)
E(g)$weight <- rep(1:2, length.out=ecount(g))
plot(g, layout=layout_with_kk, edge.label=E(g)$weight)
}
\author{
Gabor Csardi \email{csardi.gabor@gmail.com}
}
\references{
Kamada, T. and Kawai, S.: An Algorithm for Drawing General
Undirected Graphs. \emph{Information Processing Letters}, 31/1, 7--15, 1989.
}
\seealso{
\code{\link{layout_with_drl}}, \code{\link{plot.igraph}},
\code{\link{tkplot}}
Other graph layouts: \code{\link{add_layout_}};
\code{\link{as_bipartite}},
\code{\link{layout.bipartite}},
\code{\link{layout_as_bipartite}}; \code{\link{as_star}},
\code{\link{layout.star}}, \code{\link{layout_as_star}};
\code{\link{as_tree}}, \code{\link{layout_as_tree}};
\code{\link{component_wise}}; \code{\link{in_circle}},
\code{\link{layout_in_circle}};
\code{\link{layout.auto}}, \code{\link{layout_nicely}},
\code{\link{nicely}};
\code{\link{layout.davidson.harel}},
\code{\link{layout_with_dh}}, \code{\link{with_dh}};
\code{\link{layout.gem}}, \code{\link{layout_with_gem}},
\code{\link{with_gem}}; \code{\link{layout.graphopt}},
\code{\link{layout_with_graphopt}},
\code{\link{with_graphopt}}; \code{\link{layout.grid}},
\code{\link{layout.grid.3d}},
\code{\link{layout.grid.3d}},
\code{\link{layout_on_grid}}, \code{\link{on_grid}};
\code{\link{layout.mds}}, \code{\link{layout_with_mds}},
\code{\link{with_mds}}; \code{\link{layout.merge}},
\code{\link{layout_components}},
\code{\link{merge_coords}},
\code{\link{piecewise.layout}},
\code{\link{piecewise.layout}};
\code{\link{layout.norm}}, \code{\link{norm_coords}};
\code{\link{layout.sugiyama}},
\code{\link{layout_with_sugiyama}},
\code{\link{with_sugiyama}};
\code{\link{layout_on_sphere}}, \code{\link{on_sphere}};
\code{\link{layout_randomly}}, \code{\link{randomly}};
\code{\link{layout_with_fr}}, \code{\link{with_fr}};
\code{\link{layout_with_lgl}}, \code{\link{with_lgl}};
\code{\link{layout}}, \code{\link{layout_}},
\code{\link{print.igraph_layout_modifier}},
\code{\link{print.igraph_layout_spec}};
\code{\link{normalize}}
}
\keyword{graphs}
|