random_acyclic¶
-
ActionDigraph
libsemigroups::ActionDigraph::random_acyclic(T const nr_nodes, T const out_degree, T const nr_edges, std::mt19937 mt = std::mt19937(std::random_device()()))¶ Constructs a random acyclic ActionDigraph from
mtwith the specified number of nodes and edges, and out-degree.- Complexity
At least \(O(mn)\) where
mis the number of nodes, andnis the out-degree of the digraph.- Parameters
nr_nodes: the number of nodesout_degree: the out-degree of every nodenr_edges: the out-degree of every nodemt: a std::mt19937 used as a random source (defaults to: std::mt19937(std::random_device()()))
- Exceptions
LibsemigroupsException: if any of the following hold:nr_nodesis less than2out_degreeis less than2nr_edgesexceeds the product ofnr_nodesandout_degreenr_edgesexceeds the product ofnr_nodesandnr_nodes- 1 divided by 2.