Random Erdős–Rényi network#

random_gnp_graph[vert_type](size: int, p: float, random_state) undirected_network[vert_type]#
template<integer_network_vertex VertT, std::uniform_random_bit_generator Gen>
undirected_network<VertT> random_gnp_graph(VertT size, double p, Gen &generator)#

Generates a random \(G(n = size, p)\) graph of size size, where every edge exists independently with probability p [2].

If the parameter p is not in the \([0, 1]\) range, the function fails by raising a ValueError exception in Python or a std::invalid_argument exception in C++.