On the rank-distance median of 3 permutations

Background Recently, Pereira Zanetti, Biller and Meidanis have proposed a new definition of a rearrangement distance between genomes. In this formulation, each genome is represented as a matrix, and the distance d is the rank distance between these matrices. Although defined in terms of matrices, the rank distance is equal to the minimum total weight of a series of weighted operations that leads from one genome to the other, including inversions, translocations, transpositions, and others. The computational complexity of the median-of-three problem according to this distance is currently unknown. The genome matrices are a special kind of permutation matrices, which we study in this paper. In their paper, the authors provide an \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$O\left (n^{3}\right)$\end{document}On3 algorithm for determining three candidate medians, prove the tight approximation ratio \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$\frac {4}{3}$\end{document}43, and provide a sufficient condition for their candidates to be true medians. They also conduct some experiments that suggest that their method is accurate on simulated and real data. Results In this paper, we extend their results and provide the following: Three invariants characterizing the problem of finding the median of 3 matrices A sufficient condition for uniqueness of medians that can be checked in O(n) A faster, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$O\left (n^{2}\right)$\end{document}On2 algorithm for determining the median under this condition A new heuristic algorithm for this problem based on compressed sensing A \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$O\left (n^{4}\right)$\end{document}On4 algorithm that exactly solves the problem when the inputs are orthogonal matrices, a class that includes both permutations and genomes as special cases. Conclusions Our work provides the first proof that, with respect to the rank distance, the problem of finding the median of 3 genomes, as well as the median of 3 permutations, is exactly solvable in polynomial time, a result which should be contrasted with its NP-hardness for the DCJ (double cut-and-join) distance and most other families of genome rearrangement operations. This result, backed by our experimental tests, indicates that the rank distance is a viable alternative to the DCJ distance widely used in genome comparisons. Electronic supplementary material The online version of this article (10.1186/s12859-018-2131-4) contains supplementary material, which is available to authorized users.

These two conditions are equivalent to the vector space im(X + Y ) being the direct sum of im(X) and im(Y ), written as im(X + Y ) = im(X) ⊕ im(Y ).
To finish the proof, let us pick a basis B X for im(X) and a basis B Y for im (Y ). From the directness of the sum, it follows that every vector u ∈ im(X + Y ) can be uniquely written as u = v + w, with v ∈ im(X) and w ∈ im(Y ). Since this is true for any vector in im(X + Y ), this is in particular true for the n columns of X + Y , say c 1 , . . . , c n .
But we also have where x i (respectively y i ) is the i-th column of X (respectively Y ). Therefore, since x i ∈ im(X) and y i ∈ im(Y ), Equation (1) gives the desired decomposition for each c i . Let B := B X ∪ B Y be the basis of im(X + Y ) obtained by joining the bases B X and B Y , and let B + := B ∪ B be an extension of the basis B to a basis of the entire space R n . Let P be the matrix of the projection operator onto X with respect to the basis B + , with all the elements in B = B + − B being projected onto the 0 vector. Then so that P (X + Y ) = X. By substituting X = B − A and Y = C − B, we see that the desired equality is only possible if B = A + P (C − A), as required.
Proofs related to the exact O(n 4 ) algorithm The remaining proofs in this Additional File concern the exact, O(n 4 ) algorithm.
An important observation here is that Lemmas 4-6 and Theorem 2 from Pereira Zanetti et al. [2], restated in Equation 6 of the "On the Rank-Distance Median of 3 Permutations" paper, and originally proven for permutation matrices, are also valid for orthogonal matrices, with the exact same proof. The fundamental fact that is the basis for all these proofs is the fact that permutation matrices preserve norms, something that is also true for orthogonal matrices.
Theorem 1. If A, B, and C are three n × n orthogonal matrices, then The above derivation uses the formulas for the dimension of V ⊥ given the dimension of V , the fact that (V 1 + V 2 ) ⊥ = V ⊥ 2 ∩ V ⊥ 2 , the definition of rank distance, Lemma 1 below, the fact that (im X) ⊥ = ker(X T ), the definitions of invariants α and β, and the fact that α + β ≥ n. Lemma 1. If A, B, and C are three n × n orthogonal matrices, then

Decomposition of A − B and C − B
In this section we study the decomposition of a generic n × n matrix into a minimal sum of rank 1 matrices. This is important for our problem because if we want to take a step towards A from B, then looking at optimal rank-1 decompositions of A − B will help.
If H and F are two n × n matrices, we say that H decomposes F when r(H) = 1 and r(F − H) < r(F ). This means that H is one possible term in a decomposition We begin with a characterization of all such possible terms.
where H = u 1 w T 1 and k = r(F ). By applying F to a suitable vector x orthogonal to w 2 , w 3 , . . . , w k and such that w t 1 x = 1, we end up with F x = u 1 . (2) on the left by y T for a suitable vector y orthogonal to u 2 , u 3 , . . . , u k and such that y T u 1 = 1, we end up with

By multiplying Equation
Theorem 3. If A, B, and C are three n×n orthogonal matrices and u ∈ im Proof. Since the expression for H is invariant under multiplication of u by a nonzero scalar, we may, without loss of generality, assume u is unitary, that is, Let us first show that H decomposes A − B. Given that u ∈ im (A − B), there must be a vector x such that u = (A − B)x. Take y = 2Ax. We claim that y T (A − B)x = 1. This can be verified by expanding both y T u and u T u, which end up being the same thing. Hence, With this, we are ready to apply Theorem 2 for Finally, notice that, after the choice of u, matrix H depends only on u and B, and therefore the conclusion applies to C − B as well.

Walking towards a median
In this section we will prove the following result. . We conclude that M satisfies also the lower bound for A, B, and C and is therefore a median of these three matrices.

Correctness proof
Here we wrap up the previous results in the main correctness proof. Before embarking on this proof, we need the generalization to orthogonal matrices of Lemma 3 of the "On the Rank-Distance Median of 3 Permutations" paper, which states the integrality of the invariant β. This can be proven as follows. It is known that every orthogonal matrix T is the product of Householder transformations. We strengthen this result to show that we can always use exactly k factors in this product, where k = dim im(T − I), in Theorem 5 below. Since each Householder transformation has determinant −1, it follows that det(T ) = (−1) d(T,I) , or, for arbitrary orthogonal matrices A and B, det(A −1 B) = (−1) d(A,B) . With this result, the alternative proof of the integrality of β provided in the aforementioned Lemma 3 extends to orthogonal matrices.

Definition 1.
Let v = 0 be a vector of F n , where F is a field of characteristic zero. The Householder transformation along v is defined as the matrix Properties: These properties are all well-known and easy to prove from the definitions, with straightforward calculations. Householder transformations are in fact reflections with respect to the hyperplane orthogonal to v. As such, they have determinant equal to −1, because they can be diagonalized with one eigenvector relative to eigenvalue −1 (in the direction of v), and n − 1 eigenvectors relative to eigenvalue +1 (in the hyperplane orthogonal to v). Now comes an important theorem related to the factoring of an orthogonal matrix as a product of such hyperplane reflections. Proof. We sketch the proof. Take any unitary vector u in ker(T − I) ⊥ , and define H = H(v), where v = T u − u. Now, if w ∈ ker(T − I), then T w = w and we can prove that v T w = 0, and therefore Hw = w and HT w = Hw. We conclude that ker(T − I) ⊆ ker(HT − I). The next step is to prove that vector u belongs to the latter but not to the former, leading to dim ker(T − I) < dim ker(HT − I).
But this in turn implies that d(HT, I) = dim im(HT −I) < dim im(T −I) = d(T, I), which is what we wanted to prove.
As for showing that u ∈ ker(HT − I), notice that Hu = T u, since: This is because 2vv T u = (2 − 2u T T u)(u − T u) and v T v = (2 − 2u T T u). But if Hu = T u, then HT u = u. Since H 2 = I, we conclude that T = HH 1 H 2 . . . H k−1 is a product of k Householder transformations. Now our main result.
Theorem 6. The matrix M returned by Algorithm 1 of the "On the Rank-Distance Median of 3 Permutations" paper is orthogonal and satisfies the lower bound for A, B, and C.
Proof. By induction on k = d(A, B) + d(B, C) − d(C, A). Notice that this number is nonnegative by the triangle inequality. If k = 0, the algorithm returns B, which is orthogonal and satisfies the lower bound, since it lies on a shortest path between A and C. If k = 1 the conclusion is vacuously true since this case is impossible (k is always an even number by the integrality of invariant β).
If k ≥ 2, the algorithm finds a non-zero vector u in im(A − B) ∩ im(C − B), which exists because of Theorem 1. It then computes H = −2uu T B/u T u and B+H, which stands on a shortest path between B and A, and also on a shortest path between B and C, according to Theorem 3.
The matrix B + H is orthogonal, as we can readily verify: where we used the symmetry and idempotency of Householder reflections. Therefore B +H is indeed orthogonal and the recursive call is valid, because all arguments are orthogonal matrices. But since we can apply the induction hypothesis and conclude that the median M returned for A, B + H, and C is orthogonal and satisfies the lower bound for these matrices. Using Theorem 4, we conclude that M also satisfies the lower bound for A, B, and C, and is therefore a median. Since M is orthogonal by the induction hypothesis, we are done.