fnss.topologies.randmodels.erdos_renyi_topology

erdos_renyi_topology(n, p, seed=None, fast=False)[source]

Return a random graph G_{n,p} (Erdos-Renyi graph, binomial graph).

Chooses each of the possible edges with probability p.

Parameters:
n : int

The number of nodes.

p : float

Probability for edge creation.

seed : int, optional

Seed for random number generator (default=None).

fast : boolean, optional

Uses the algorithm proposed by [3], which is faster for small p

References

[1]
  1. Erdos and A. Renyi, On Random Graphs, Publ. Math. 6, 290 (1959).
[2]
    1. Gilbert, Random Graphs, Ann. Math. Stat., 30, 1141 (1959).
[3](1, 2) Vladimir Batagelj and Ulrik Brandes, “Efficient generation of large random networks”, Phys. Rev. E, 71, 036113, 2005.