Skip to content

num::structures::erdos_renyi

Defined in header <structures/graph/generators.hpp>

template <typename Weight = double, std::integral Index = num::idx, typename RNG>
graph<Weight, Index> erdos_renyi(std::type_identity_t<Index> n, double p, RNG &rng,
                                 bool ensure_connected = true,
                                 Weight min_weight = Weight{1},
                                 Weight max_weight = Weight{1});

Draw an Erdős–Rényi random graph \(G(n, p)\), optionally connected.