We will use 2-Break(1, 6, 3, 8) two denote the 2-break replacing colored edges $$(1, 6)$$ and $$(3, 8)$$ in a genome graph with two new colored edges $$(1, 3)$$ and $$(6, 8)$$. Note that the order of the nodes in this function matter, since the operation 2-Break(1, 6, 8, 3) would represent a different 2-break that replaces $$(1, 6)$$ and $$(3, 8)$$ with $$(1, 8)$$ and $$(6, 3)$$.

The following pseudocode describes how 2-Break(i, j, k, l) transforms a genome graph.

2-BreakOnGenomeGraph(Ggraph, i, j, k, l)
    remove colored edges (i, j) and (k, l) from Ggraph
    add colored edges (i, k) and (j, l) to Ggraph
    return Ggraph

Assignment

Add a method two_break to the class GenomeGraph that implements 2-BreakOnGenomeGraph. The method takes four integer arguments and returns the genome graph (an object of the class GenomeGraph) that results from applying the 2-break on the genome graph on which the method is called. Feel free to choose whether the method returns a new GenomeGraph object (immutable objects) or changes the state of the GenomeGraph object on which it is called (mutable objects).

Example

>>> GenomeGraph((2, 4), (3, 8), (7, 5), (6, 1)).two_break(1, 6, 3, 8)
GenomeGraph((1, 3), (2, 4), (5, 7), (6, 8))