2.2. Example Merge Trees

This module contains example merge trees and random generators.

cereeberus.data.ex_mergetrees.randomMergeTree(n=10, func_randomizer=None, range=[0, 10], seed=None)[source]

Generates a random tree with n nodes + 1 root. If func_randomizer is None, the function defined is inverted edge count distance from root node. Otherwise, func_randomizer should be an input to type the randomizeMergeFunction function. For example, this could be ‘uniform’ or ‘exp’.

cereeberus.data.ex_mergetrees.randomizeMergeFunction(MT, range=[0, 10], type='exp', seed=None)[source]

Returns a merge tree with the same underlying tree, but randomized function values in the given range.