TangleSweep#

class tangles.TangleSweep(agreement_func: Callable[[ndarray, ndarray], int], le_func: Callable[[int, int, int, int], bool], sep_ids: array | None = None, forbidden_tuple_size: int = 3)#

Search object which builds and extends the tangle search tree.

Parameters#

agreement_funcAgreementFunc

A function which takes a list of separations and returns a non-negative, numerical agreement value.

le_funcLessOrEqFunc

A partial order on the oriented separations.

sep_idsnp.array, optional

The separation ids. Can be used to start the algorithm with some empty levels.

forbidden_tuple_sizeint

The maximum size of forbidden tuples. The standard tangles use a maximum size of 3 (i.e. forbidden triples).

Properties

tree

The TangleSearchTree on which this TangleSweep operates

Methods

append_separation()

Append a new separation to the tree

greedy_search()

Greedily search for tangles

insert_separation()

Insert a new separation into a specified level in the tree

sweep_below()

Extend nodes in the tree until the agreement search limit has decreased below the specified agreement value

sweep_one()

Extend nodes in the tree until the agreement search limit has decreased