File: sample_grg.Rd

package info (click to toggle)
r-cran-igraph 2.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 27,772 kB
  • sloc: ansic: 206,420; cpp: 21,827; fortran: 4,090; yacc: 1,229; lex: 518; sh: 52; makefile: 8
file content (80 lines) | stat: -rw-r--r-- 2,395 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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/games.R
\name{sample_grg}
\alias{sample_grg}
\alias{grg}
\title{Geometric random graphs}
\usage{
sample_grg(nodes, radius, torus = FALSE, coords = FALSE)

grg(...)
}
\arguments{
\item{nodes}{The number of vertices in the graph.}

\item{radius}{The radius within which the vertices will be connected by an
edge.}

\item{torus}{Logical constant, whether to use a torus instead of a square.}

\item{coords}{Logical scalar, whether to add the positions of the vertices
as vertex attributes called \sQuote{\code{x}} and \sQuote{\code{y}}.}

\item{...}{Passed to \code{sample_grg()}.}
}
\value{
A graph object. If \code{coords} is \code{TRUE} then with vertex
attributes \sQuote{\code{x}} and \sQuote{\code{y}}.
}
\description{
Generate a random graph based on the distance of random point on a unit
square
}
\details{
First a number of points are dropped on a unit square, these points
correspond to the vertices of the graph to create. Two points will be
connected with an undirected edge if they are closer to each other in
Euclidean norm than a given radius. If the \code{torus} argument is
\code{TRUE} then a unit area torus is used instead of a square.
}
\examples{

g <- sample_grg(1000, 0.05, torus = FALSE)
g2 <- sample_grg(1000, 0.05, torus = TRUE)

}
\seealso{
Random graph models (games)
\code{\link{bipartite_gnm}()},
\code{\link{erdos.renyi.game}()},
\code{\link{sample_}()},
\code{\link{sample_bipartite}()},
\code{\link{sample_chung_lu}()},
\code{\link{sample_correlated_gnp}()},
\code{\link{sample_correlated_gnp_pair}()},
\code{\link{sample_degseq}()},
\code{\link{sample_dot_product}()},
\code{\link{sample_fitness}()},
\code{\link{sample_fitness_pl}()},
\code{\link{sample_forestfire}()},
\code{\link{sample_gnm}()},
\code{\link{sample_gnp}()},
\code{\link{sample_growing}()},
\code{\link{sample_hierarchical_sbm}()},
\code{\link{sample_islands}()},
\code{\link{sample_k_regular}()},
\code{\link{sample_last_cit}()},
\code{\link{sample_pa}()},
\code{\link{sample_pa_age}()},
\code{\link{sample_pref}()},
\code{\link{sample_sbm}()},
\code{\link{sample_smallworld}()},
\code{\link{sample_traits_callaway}()},
\code{\link{sample_tree}()}
}
\author{
Gabor Csardi \email{csardi.gabor@gmail.com}, first version was
written by Keith Briggs (\url{https://keithbriggs.info/}).
}
\concept{games}
\keyword{graphs}