igraph (version 0.7.0)

bipartite.random.game: Bipartite random graphs

Description

Generate bipartite graphs using the Erdos-Renyi model

Usage

bipartite.random.game(n1, n2, type = c("gnp", "gnm"), p, m,
    directed = FALSE, mode = c("out", "in", "all"))

Arguments

n1
Integer scalar, the number of bottom vertices.
n2
Integer scalar, the number of top vertices.
type
Character scalar, the type of the graph, gnp creates a $G(n,p)$ graph, gnm creates a $G(n,m)$ graph. See details below.
p
Real scalar, connection probability for $G(n,p)$ graphs. Should not be given for $G(n,m)$ graphs.
m
Integer scalar, the number of edges for $G(n,p)$ graphs. Should not be given for $G(n,p)$ graphs.
directed
Logical scalar, whether to create a directed graph. See also the mode argument.
mode
Character scalar, specifies how to direct the edges in directed graphs. If it is out, then directed edges point from bottom vertices to top vertices. If it is in, edges point from top vertices to bottom vertic

Value

  • A bipartite igraph graph.

concept

  • Random graph model
  • Bipartite graph

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.

See Also

erdos.renyi.game for the unipartite version.

Examples

Run this code
## empty graph
bipartite.random.game(10, 5, p=0)

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

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

## directed bipartite graph, G(n,m)
bipartite.random.game(10, 5, type="Gnm", m=20, directed=TRUE, mode="all")

Run the code above in your browser using DataCamp Workspace