File: keeping_degseq.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 (44 lines) | stat: -rw-r--r-- 1,224 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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rewire.R
\name{keeping_degseq}
\alias{keeping_degseq}
\title{Graph rewiring while preserving the degree distribution}
\usage{
keeping_degseq(loops = FALSE, niter = 100)
}
\arguments{
\item{loops}{Whether to allow destroying and creating loop edges.}

\item{niter}{Number of rewiring trials to perform.}
}
\description{
This function can be used together with \code{\link[=rewire]{rewire()}} to
randomly rewire the edges while preserving the original graph's degree
distribution.
}
\details{
The rewiring algorithm chooses two arbitrary edges in each step ((a,b)
and (c,d)) and substitutes them with (a,d) and (c,b), if they not
already exists in the graph. The algorithm does not create multiple
edges.
}
\examples{
g <- make_ring(10)
g \%>\%
  rewire(keeping_degseq(niter = 20)) \%>\%
  degree()
print_all(rewire(g, with = keeping_degseq(niter = vcount(g) * 10)))
}
\seealso{
\code{\link[=sample_degseq]{sample_degseq()}}

Other rewiring functions: 
\code{\link{each_edge}()},
\code{\link{rewire}()}
}
\author{
Tamas Nepusz \email{ntamas@gmail.com} and Gabor Csardi
\email{csardi.gabor@gmail.com}
}
\concept{rewiring functions}
\keyword{graphs}