TreeGenerator Class Reference

Generates non-isomorphic trees of a given order. More...

#include <TreeGenerator.hpp>

List of all members.

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.

Detailed Description

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.


Constructor & Destructor Documentation

TreeGenerator::TreeGenerator ( unsigned int  numVertices  ) 

Constructor. Initializes the object to generate trees of the given order.

Parameters:
numVertices Desired order, or number of vertices, for the trees to generate.

Definition at line 15 of file TreeGenerator.cpp.


Member Function Documentation

bool TreeGenerator::nextTree ( Tree t  ) 

Get the next tree generated by the algorithm.

Parameters:
t Passed by reference to store the tree created by the function call.
Postcondition:
t will be a tree non-isomorphic to any other tree generated by this object if the function returns true. Otherwise, t will contain invalid data.
Returns:
True if the tree is valid, false if there were no more trees left to generate.

Definition at line 30 of file TreeGenerator.cpp.


The documentation for this class was generated from the following files:
 All Classes Files Functions
Generated on Mon Apr 1 10:56:03 2013 by  doxygen 1.6.3