File: sample_bipartite.Rd

package info (click to toggle)
r-cran-igraph 1.0.1-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 18,232 kB
  • sloc: ansic: 173,538; cpp: 19,365; fortran: 4,550; yacc: 1,164; tcl: 931; lex: 484; makefile: 149; sh: 9
file content (74 lines) | stat: -rw-r--r-- 2,345 bytes parent folder | download | duplicates (2)
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
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/games.R
\name{sample_bipartite}
\alias{bipartite}
\alias{bipartite.random.game}
\alias{sample_bipartite}
\title{Bipartite random graphs}
\usage{
sample_bipartite(n1, n2, type = c("gnp", "gnm"), p, m, directed = FALSE,
  mode = c("out", "in", "all"))

bipartite(...)
}
\arguments{
\item{n1}{Integer scalar, the number of bottom vertices.}

\item{n2}{Integer scalar, the number of top vertices.}

\item{type}{Character scalar, the type of the graph, \sQuote{gnp} creates a
$G(n,p)$ graph, \sQuote{gnm} creates a $G(n,m)$ graph. See details below.}

\item{p}{Real scalar, connection probability for $G(n,p)$ graphs. Should not
be given for $G(n,m)$ graphs.}

\item{m}{Integer scalar, the number of edges for $G(n,p)$ graphs. Should not
be given for $G(n,p)$ graphs.}

\item{directed}{Logical scalar, whether to create a directed graph. See also
the \code{mode} argument.}

\item{mode}{Character scalar, specifies how to direct the edges in directed
graphs. If it is \sQuote{out}, then directed edges point from bottom
vertices to top vertices. If it is \sQuote{in}, edges point from top
vertices to bottom vertices. \sQuote{out} and \sQuote{in} do not generate
mutual edges. If this argument is \sQuote{all}, then each edge direction is
considered independently and mutual edges might be generated. This argument
is ignored for undirected graphs.}

\item{...}{Passed to \code{sample_bipartite}.}
}
\value{
A bipartite igraph graph.
}
\description{
Generate bipartite graphs using the Erdos-Renyi model
}
\details{
Similarly to unipartite (one-mode) networks, we can define the $G(n,p)$, and
$G(n,m)$ graph classes for bipartite graphs, via their generating process.
In $G(n,p)$ every possible edge between top and bottom vertices is realized
with probablity $p$, independently of the rest of the edges. In $G(n,m)$, we
uniformly choose $m$ edges to realize.
}
\examples{
## empty graph
sample_bipartite(10, 5, p=0)

## full graph
sample_bipartite(10, 5, p=1)

## random bipartite graph
sample_bipartite(10, 5, p=.1)

## directed bipartite graph, G(n,m)
sample_bipartite(10, 5, type="Gnm", m=20, directed=TRUE, mode="all")
}
\author{
Gabor Csardi \email{csardi.gabor@gmail.com}
}
\seealso{
\code{\link{sample_gnp}} for the unipartite version.
}
\keyword{graphs}