TangleSearchTree#

class tangles.TangleSearchTree(root: Tangle, sep_ids: ndarray)#

A rooted binary tree that is created while searching tangles. It represents the search result.

Nodes in the tree represent tangles and edges represent orientations of separations. Each level of the tree (except the root level) corresponds to one separation. The root node is the empty tangle.

Each node on level \(k\) that is a left child of a node on level \(k-1\) represents a tangle that orients the separation corresponding to level \(k\) to the left (and vice versa for a right child).

During the tangle search, the tangle search tree is extended adding new edges to the tree.

A TangleSearchTree object contains the actual binary tree of Tangle objects as well as a list of separation ids corresponding to the levels of the tangle search tree.

Parameters#

rootTangle

The root node of the tangle search tree.

sep_idsnp.ndarray

The separation ids in a 1-dimensional array.

Properties

limit

The maximum order of a node which we have not yet extended

number_of_separations

The number of separations in the search tree

root

The root of the search tree

sep_ids

The separation ids associated with the levels

Methods

get_efficient_distinguishers()

Find the efficient distinguishers of the tangles

k_tangles()

Return all tangles of the k-th level which have at least the specified agreement value

load()

Build a search tree from the data in filename

maximal_tangles()

Return all maximal tangles of at least the specified agreement and level at most max_level

save()

Saves the search tree data to a file

search_tree()

Build a copy of the tangle search tree

tangle_matrix()

Return the tangle matrix of all maximal tangles, taken from the set of tangles of at least the specified agreement

tree_height_for_agreement()

Compute the tree height for the given agreement