On Rotation Distance of Rank Bounded Trees (2304.03985v3)
Abstract: Computing the rotation distance between two binary trees with $n$ internal nodes efficiently (in $poly(n)$ time) is a long standing open question in the study of height balancing in tree data structures. In this paper, we initiate the study of this problem bounding the rank of the trees given at the input (defined by Ehrenfeucht and Haussler (1989) in the context of decision trees). We define the rank-bounded rotation distance between two given binary trees $T_1$ and $T_2$ (with $n$ internal nodes) of rank at most $r$, denoted by $d_r(T_1,T_2)$, as the length of the shortest sequence of rotations that transforms $T_1$ to $T_2$ with the restriction that the intermediate trees must be of rank at most $r$. We show that the rotation distance problem reduces in polynomial time to the rank bounded rotation distance problem. This motivates the study of the problem in the combinatorial and algorithmic frontiers. Observing that trees with rank $1$ coincide exactly with skew trees (binary trees where every internal node has at least one leaf as a child), we show the following results in this frontier : We present an $O(n2)$ time algorithm for computing $d_1(T_1,T_2)$. That is, when the given trees are skew trees (we call this variant as skew rotation distance problem) - where the intermediate trees are restricted to be skew as well. In particular, our techniques imply that for any two skew trees $d(T_1,T_2) \le n2$. We show the following upper bound : for any two trees $T_1$ and $T_2$ of rank at most $r_1$ and $r_2$ respectively, we have that: $d_r(T_1,T_2) \le n2 (1+(2n+1)(r_1+r_2-2))$ where $r = max{r_1,r_2}$. This bound is asymptotically tight for $r=1$. En route our proof of the above theorems, we associate binary trees to permutations and bivariate polynomials, and prove several characterizations in the case of skew trees.
- Sorting by transpositions is difficult. In Proceedings of International Conference on Automata, Languages and Programming (ICALP 2011), pages 654–665, 2011.
- Linear-time constant-ratio approximation algorithm and tight bounds for the contiguity of cographs. In WALCOM: Algorithms and Computation, 7th International Workshop, WALCOM 2013, Kharagpur, India, February 14-16, 2013. Proceedings, volume 7748 of Lecture Notes in Computer Science, pages 126–136. Springer, 2013.
- A linear-time approximation algorithm for rotation distance. J. Graph Algorithms Appl., 14(2):385–390, 2010.
- A note on some tree similarity measures. Information Processing Letters, 15(1):39 – 42, 1982.
- Patrick Dehornoy. On the rotation distance between binary trees. Advances in Mathematics, 223(4):1316–1355, 2010.
- Learning decision trees from random examples. Information and Computation, 82(3):231–246, 1989.
- J. Lucas. The rotation graph of binary trees is hamiltonian. Journal of Algorithms, 8(4):503–535, dec 1987.
- J. Lucas. Untangling binary trees via rotations. The Computer Journal, 47(2):259–269, 2004.
- Lionel Pournin. The diameter of associahedra. Advances in Mathematics, 259:13–42, Jul 2014.
- Rotation distance, triangulations, and hyperbolic geometry. In Proceedings of the 18th Annual ACM Symposium on Theory of Computing, pages 122–135, 1986.
- Polynomials, Binary Trees, and Positive Braids. Missouri Journal of Mathematical Sciences, 26(1):1–13, 2014.