Fig. 2: EdgeHOG’s algorithm.
From: EdgeHOG: a method for fine-grained ancestral gene order inference at large scale

a, The bottom-up phase. Traversing the guide species tree from leaves to root, an adjacency between two genes is propagated to a direct ancestor as long as it is inferred to have the two ancestral genes. The inferred gene gain (in grey) is accounted for by propagating an adjacency to the parental level only between the two flanking neighbours. All edges propagated to the parental level are summarized in a ‘propagated graph’, and the propagated form of each real edge is stored. Note that if duplicated genes or edges exist as distinct entities after the duplication event, they merge into a single gene or edge at the point of duplication and before it. b, The top-down phase. Traversing the tree from root to leaves, any adjacency not supported by parsimony is removed, that is, essentially any edge supported by only one child and not by the parent (hence wrongly propagated before the last common ancestor in which the edge emerged). c, The linearization phase. The linearization step flags conflicting genes (those having more than two neighbours) and removes edges until the number of neighbours of a conflicting gene is no more than two. Bottom: the order in which conflicting nodes are resolved and the hierarchy of neighbours for a conflicting node are explained. The linear path weight of a neighbour is the sum of weights of all edges in the path passing by the neighbour and ending at the first node encountered with less or more than two neighbours. For each ancestor, the linearized graph constitutes edgeHOG’s main output.