phylox.rearrangement.movability.check_movable

phylox.rearrangement.movability.check_movable(network, moving_edge, moving_endpoint)

Checks whether an endpoint of an edge is movable in a network.

Parameters:
  • network – a phylogenetic network, i.e., a DAG with labeled leaves.

  • moving_edge – an edge in the network.

  • moving_endpoint – a node, specifically, an endpoint of the moving_edge.

Returns:

True if the endpoint of the edge is movable in the network, False otherwise.

Example:

>>> from phylox import DiNetwork
>>> from phylox.rearrangement.movability import check_movable
>>> network = DiNetwork(
...     edges=[(0,1),(1,2),(1,3),(2,3),(2,4),(3,5)],
... )
>>> check_movable(network, (1, 3), 3)
True
>>> check_movable(network, (1, 3), 1)
True
>>> check_movable(network, (3, 5), 3)
False