LAL: Linear Arrangement Library 21.07.01
A library focused on algorithms on linear arrangements of graphs.
|
Uniformly random generation of labelled free trees. More...
#include <rand_lab_free_trees.hpp>
Public Member Functions | |
_rand_lab_free_trees (uint32_t n, uint32_t seed=0) noexcept | |
Constructor with size of tree and seed for the random number generator. | |
_rand_lab_free_trees (const _rand_lab_free_trees &Gen)=default | |
Copy constructor. | |
_rand_lab_free_trees (_rand_lab_free_trees &&Gen)=default | |
Move constructor. | |
virtual | ~_rand_lab_free_trees ()=default |
Default destructor. | |
graphs::free_tree | get_tree () noexcept |
Returns a labelled free tree chosen uniformly at random. | |
Protected Member Functions | |
void | init (uint32_t seed=0) noexcept |
Sets the size of the labelled trees to generate. | |
Uniformly random generation of labelled free trees.
Users should refrain from using this class. The generation of random labelled trees should be done using the wrapper class rand_lab_free_trees. This class, however, contains the actual code to generate labelled free trees uniformly at random.
This class implements an algorithm that uses uniformly random Prüfer sequences (see [29]). The construction of the free labelled tree uses the algorithm in [7].
|
noexcept |
Constructor with size of tree and seed for the random number generator.
In case the seed given is '0', a random seed will be generated.
n | Number of nodes. |
seed | The seed used for the random generator. |
|
default |
Copy constructor.
Gen | Random labelled free tree generator. |
|
default |
Move constructor.
Gen | Random labelled free tree generator. |
|
protectednoexcept |
Sets the size of the labelled trees to generate.
Initialises the random number generator.
seed | Integer value used to seed the random number generator. |