FTreeNode#

class tangles.FTreeNode(new_sep_id: int, parent=None, left_child=None, right_child=None)#

An Forbidden-Tuples-Tree (FTT). A binary tree containing forbidden tuples in every leaf.

Methods

children()

Return the list of children of this node

copy()

Create a new BinTreeNode (note: this is a kind of abstract base function)

copy_subtree()

Copy the subtree starting at this node

copy_subtree_into_children()

Replace each child by a copy of the subtree starting at this node

detach()

Detach the node by removing its pointer to its parent and the parents pointer to it

from_indicator_matrix()

Turn an indicator matrix back into a binary tree

is_leaf()

Whether this node is a leaf

leaves_in_subtree()

Find all leaves in the binary tree

level()

Returns the level of this node

level_in_subtree()

Return all the nodes at a certain depth below this node

path_from_root_indicator()

Returns the list of sides one has to take to go from the root to this node

set_left_child()

Set the left child of the node

set_right_child()

Set the right child of the node

to_indicator_matrix()

Turn a list of nodes into an indicator matrix