phylox.rearrangement.heuristics.green_line_heuristic.HeuristicDistanceMixin

class phylox.rearrangement.heuristics.green_line_heuristic.HeuristicDistanceMixin

Bases: object

A class containing the Green Line heuristic and its random version. Meant to be inherited by the RearrangementProblem class.

__init__()

Methods

__init__()

check_green_line_requirements()

heuristic_green_line()

An implementation of Algorithm 4 and its tail move counterpart.

heuristic_green_line_random

heuristic_green_line()

An implementation of Algorithm 4 and its tail move counterpart. Finds a sequence of tail/rSPR moves from network1 to network2 by building a down-closed isomorphism. Assumes the networks have the same leaf set, the same number of reticulations, are both binary, and all labels are unique.

Returns:

A list of tail/rSPR moves from network1 to network2. Returns False if such a sequence does not exist.

heuristic_green_line_random(seed=None)

An implementation of Algorithm 5 and its tail move counterpart. Finds a sequence of tail/rSPR moves from network1 to network2 by randomly building a down-closed isomorphism.

Returns:

A list of tail/rSPR moves from network1 to network2. Returns False if such a sequence does not exist.