RM_erdos {RMAT} | R Documentation |
Generate a random stochastic matrix for a walk on an Erdos-Renyi graph
Description
An Erdos-Renyi Graph is a graph whose edges are connected ~ Bern(p). Hence, its transition matrix will have nonzero entries with that probability. So, we can alternatively think of the transition matrix for such walk as a stochastic matrix with parameterized sparsity.
Usage
RM_erdos(N, p)
Arguments
N |
number of dimensions of the square matrix |
p |
the probability two vertices are connected in an Erdos-Renyi graph. |
Value
A random stochastic matrix corrosponding to a walk on an Erdos-Renyi graph with probability p.
Examples
# Very sparse graph
P <- RM_erdos(N = 3, p = 0.2)
# Slightly sparse graph
P <- RM_erdos(N = 9, p = 0.6)
# Completely connected graph
P <- RM_erdos(N = 5, p = 1)
[Package RMAT version 0.2.0 Index]