Skip to content

num::structures::random_spanning_tree

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

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

Generate a uniformly random connected spanning tree on n vertices via Wilson's algorithm.