get_tangle_by_path#

tangles.guiding.get_tangle_by_path(tree: TangleSearchTree, path: ndarray, min_agreement: int = 0) Tangle#

Method for finding a tangle in the tangle search tree by path. The path contains -1/1 values indicating whether to take the left or right child. The value 0 means that the path stops.

If the tree does not contain the tangle specified by the path, then the tangle of the longest subpath which is contained in the tree is returned.

Parameters#

treeTangleSearchTree

The tangle search tree in which we look for the tangle.

pathnp.ndarray

The path of which to find the tangle.

min_agreementint, optional

Only the tangles of at least this agreement value are considered.

Returns#

Tangle

The specified tangle.