Removing cycles after merging POGs. Panel A depicts the situation where two local gene order alignments "cross". Matches between nodes are shown as dashed connections between G1 and G2. G3 shows the situation after the merging step where a loop has introduced a cycle. This cycle is detected by the program and removed by reversing all edges (see text). The final POG looks like G4. Panel B depicts the scenario where two local alignments exist in different orientations (A-B in G1, G2 and C-D in G1, G2r). G3 shows the final POG after merging and cycle removal. Solid edges stem from the reference graph G1. The two dashed edges have been introduced to represent order relations that are unique to G2. The edge from D to C in G2 would introduce a cycle and had to be removed. The "kinked" edge represents the alignment of C→D in G1 to D→C in G2.