In this work we have presented a method to compute a restricted DCJ-indel sequence of operations that sort a linear genome into another linear genome. This method leads to a tight upper bound for the restricted DCJ-indel distance. The general DCJ-indel distance can be computed exactly and is a lower bound for the restricted DCJ-indel distance. However, the question whether these bounds are equal, meaning that both distances are equal, remains open.

**Algorithm 1** Restricted sorting of genome A into B with optimal DCJs and indels

**Input:** Two linear genomes *A* and *B*

**Output:** A restricted sequence of DCJ and indel operations sorting *A* into *B*

cap genomes *A* and *B*;

[MERGING:]

*r* ← *null*;

**if** there is a cycle *C* ∈ *AG*(*A*,*B*) with at least 4 vertices and at least 2 runs **then**

*r* ← run from *C*;

**while**
*r* ≠ *null*
**do**

extract *r* into a cycle; [*this preserves the indel-potential of AG*(*A*,*B*) *according to Proposition* 5]

*r* ← *null*;

**if** a circular chromosome was created **then**

find a short-link (*v*
_{1}, *v*
_{2}); [*Proposition 6*]

**if** (*v*
_{1}, *v*
_{2}) is a gap or a compact-run **then**

apply the optimal DCJ *ρ*(*v*
_{1}, *v*
_{2});

**else**

let *r*
_{1} be the run that would be inversely split by *ρ*(*v*
_{1}, *v*
_{2});

**if**
*ρ*(*v*
_{1}, *v*
_{2}) is the first inverted-split of *r*
_{1}
**then**

apply the optimal DCJ *ρ*(*v*
_{1}, *v*
_{2});

let *r*
_{2} be the residual part of *r*
_{1};

**if**
*r*
_{2} is in a cycle with more runs **then**

*r* ← *r*
_{2}; [*extract r*
_{
2
}
*from its cycle in the next step*]

**else**

[*r*
_{1}
*was inversely split before and is separated alone in cycle*]

find a link (*x*
_{1}, *x*
_{2}) such that *x*
_{1} is a vertex created by a previous inverted-split of *r*
_{1}; *Proposition* 7]

apply the optimal DCJ *ρ*(*x*
_{1}, *x*
_{2});

**if**
*r* = *null* and there is a cycle *C* ∈ *AG*(*A*,*B*) with at least 4 vertices and at least 2 runs **then**

*r* ← run from *C*;

[ACCUMULATING: *(each cycle with 4 or more vertices has at most one run)*]

**while** there is a long-run r in *AG*(*A*,*B*) **do**

apply an optimal DCJ accumulating the labels of two partners of *r*;

**if** a circular chromosome was created **then**

find a short-link (*v*
_{1}, *v*
_{2}); [*Proposition 6*]

**if** (*v*
_{1}, *v*
_{2}) is a gap or a compact-run **then**

apply the optimal DCJ *ρ*(*v*
_{1}, *v*
_{2});

**else**

let *r*
_{1} be the run that would be inversely split by *ρ*(*v*
_{1}, *v*
_{2});

**if**
*ρ*(*v*
_{1}, *v*
_{2}) is the first inverted-split of *r*
_{1}
**then**

apply the optimal DCJ *ρ*(*v*
_{1}, *v*
_{2});

**else**

[*r*
_{1}
*was inversely split before and is separated alone in cycle*]

find a link (*x*
_{1}, *x*
_{2}) such that x_{1} is a vertex created by a previous inverted-split of *r*
_{1}; [*Proposition* 7]

apply the optimal DCJ *ρ*(*x*
_{1}, *x*
_{2});

[DCJ-SORTING: *(each remaining cycle with 4 or more vertices has at most one compact-run)*]

**while** there is cycle *C* ∈ *AG*(*A*,*B*) with at least 4 vertices **do**

extract a cycle from *C*, with an optimal DCJ applied on genome *A*;

**if** a circular chromosome was created **then**

find a short-link (*v*
_{1}, *v*
_{2}); [*Proposition 6*]

[*at this stage this short-link is a gap or a compact-run*]

apply the optimal DCJ *ρ*(*v*
_{1}, *v*
_{2});

invert all DCJs applied on genome *B*;

insert each
-run *r* before the first inverted-split of *r*;

move up insertions that occur in circular chromosomes;

delete all
-runs from the DCJ-sorted components;