phylox.networkproperties.properties.b2_balance

phylox.networkproperties.properties.b2_balance(network, connect_roots=False)

returns the B_2 balance of the network

Parameters:
  • network – a phylogenetic network.

  • connect_roots – if True, connects all roots to a new root.

Returns:

the B_2 balance of the network

Example:

>>> from phylox import DiNetwork
>>> from phylox.networkproperties.properties import b2_balance
>>> network = DiNetwork(
...     edges=[(0, 1), (1, 2), (1, 3), (2, 4), (2, 5), (3, 6), (3, 7)],
... )
>>> b2_balance(network) == 2
True