Return a random graph G_{n,p} (Erdős-Rényi graph, binomial graph).
Parameters : | n : int
p : float
seed : int, optional
directed : bool, optional (default=False)
|
---|
See also
Notes
The G_{n,p} graph algorithm chooses each of the [n(n-1)]/2 (undirected) or n(n-1) (directed) possible edges with probability p.
This algorithm is O(n+m) where m is the expected number of edges m=p*n*(n-1)/2.
It should be faster than gnp_random_graph when p is small and the expected number of edges is small (sparse graph).
References
[R234] | Vladimir Batagelj and Ulrik Brandes, “Efficient generation of large random networks”, Phys. Rev. E, 71, 036113, 2005. |