Generates non-isomorphic trees of a given order. More...
#include <TreeGenerator.hpp>
Public Member Functions | |
TreeGenerator (unsigned int numVertices) | |
Constructor. Initializes the object to generate trees of the given order. | |
~TreeGenerator () | |
Destructor. Called automatically, cleans up the memory used by this object. | |
bool | nextTree (Tree &t) |
Get the next tree generated by the algorithm. |
Generates non-isomorphic trees of a given order.
Ported from the Sage source for the TreeIterator object which was written by Ryan Dingman. His code was an implementation of the algorithm described in the paper "Constant Time Generation of Free Trees" by Robert Alan Wright, Bruce Richmond, Andrew Odlyzko, and Brendan McKay.
Definition at line 19 of file TreeGenerator.hpp.
TreeGenerator::TreeGenerator | ( | unsigned int | numVertices | ) |
Constructor. Initializes the object to generate trees of the given order.
numVertices | Desired order, or number of vertices, for the trees to generate. |
Definition at line 15 of file TreeGenerator.cpp.
bool TreeGenerator::nextTree | ( | Tree & | t | ) |
Get the next tree generated by the algorithm.
t | Passed by reference to store the tree created by the function call. |
Definition at line 30 of file TreeGenerator.cpp.