combinat-0.2.4.1: Generation of various combinatorial objects.

Math.Combinat.Trees.Nary

Contents

Description

N-ary trees.

Synopsis

Documentation

derivTrees :: [Int] -> [Tree ()]Source

Computes the set of equivalence classes of rooted trees (in the sense that the leaves of a node are unordered) with n = length ks leaves where the set of heights of the leaves matches the given set of numbers. The height is defined as the number of edges from the leaf to the root.

TODO: better name?

unique labels

addUniqueLabelsTree :: Tree a -> Tree (a, Int)Source

Adds unique labels to a Tree.

addUniqueLabelsForest :: Forest a -> Forest (a, Int)Source

Adds unique labels to a Forest

labelling by depth

labelDepthTree :: Tree a -> Tree (a, Int)Source

Attaches the depth to each node. The depth of the root is 0.

labelling by number of children

labelNChildrenTree :: Tree a -> Tree (a, Int)Source

Attaches the number of children to each node.