Forests

class pybs.combinations.forests.Forest(arg=0)[source]

Objects of this class represent forests.

Forests are initialized by a list of trees. Furthermore, multiplication of two forests, *, is overloaded to give a new forest containing all the trees of the two original forests.

multiplicities()

Return list of values (multiplicities)

number_of_trees()[source]

Return k, the number of distinct trees.

order()[source]

The order of the forest.

The order of a forest is defined to be the sum of the order of the member trees, multiplicities included.

pybs.combinations.forests.empty_tree = Forest()

Shortand for the empty forest. It is also known as the “empty tree” and denoted \(\emptyset\) in writing.