We can extend the pseudocode in "2-break on genome graph1" to a 2-break defined on a genome $$P$$.
2-BreakOnGenome(G, i, j, k, l) Ggraph ← BlackEdges(G) and ColoredEdges(G) Ggraph ← 2-BreakOnGenomeGraph(Ggraph, i, j, k, l) G ← GraphToGenome(Ggraph) return G
Add a method two_break to the class Genome that implements 2-BreakOnGenome. The method takes four integer arguments and returns the genome (an object of the class Genome) that results from applying the 2-break on the genome on which the method is called. Feel free to choose whether the method returns a new Genome object (immutable objects) or changes the state of the Genome object on which it is called (mutable objects).
>>> Genome(Chromosome(+1, -2, -4, +3)).two_break(1, 6, 3, 8) Genome(Chromosome(-2, 1), Chromosome(-3, 4))