On Rotation Distance of Rank Bounded Trees
Pith reviewed 2026-05-24 09:12 UTC · model grok-4.3
The pith
The rotation distance problem on binary trees reduces in polynomial time to its rank-bounded version.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
The rotation distance problem reduces in polynomial time to the rank bounded rotation distance problem. For any two skew trees an O(n squared) algorithm computes d1(T1,T2) and the unrestricted distance satisfies d(T1,T2) less than or equal to n squared. For trees of ranks at most r1 and r2 the quantity dr(T1,T2) is at most n squared times (1 plus (2n plus 1) times (r1 plus r2 minus 2)).
What carries the argument
The rank-bounded rotation distance dr(T1,T2), the length of the shortest rotation sequence transforming T1 into T2 while keeping every intermediate tree of rank at most r.
If this is right
- Any algorithm that solves the rank-bounded problem yields a corresponding algorithm for the general problem via the reduction.
- The distance between any two skew trees is at most n squared and can be computed in quadratic time.
- The stated upper bound on dr(T1,T2) holds for every pair of trees of given ranks r1 and r2.
Where Pith is reading between the lines
- The explicit mapping from trees to permutations and bivariate polynomials may supply algebraic tools for proving further structural properties of rotation sequences.
- Because the quadratic upper bound is tight already at rank 1, the dependence on rank in the general bound cannot be improved without changing the leading n squared factor.
- The reduction isolates the combinatorial difficulty of high-rank intermediate trees, suggesting that hardness results for the general problem, if they exist, must arise from sequences that temporarily increase rank.
Load-bearing premise
The polynomial-time reduction from the unrestricted rotation distance problem to the rank-bounded version preserves the numerical value of the distance.
What would settle it
Two binary trees whose shortest unrestricted rotation sequence is forced to pass through an intermediate tree whose rank exceeds the bound used in the reduction, or a pair of skew trees whose distance exceeds n squared.
Figures
read the original 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(n^2)$ 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 n^2$. 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 n^2 (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.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper claims a polynomial-time reduction from the general rotation distance problem on binary trees to its rank-bounded variant. For rank-1 (skew) trees it gives an O(n²)-time algorithm computing the restricted distance d₁(T₁,T₂) and deduces that the unrestricted distance satisfies d(T₁,T₂)≤n². It also proves the combinatorial upper bound dᵣ(T₁,T₂)≤n²(1+(2n+1)(r₁+r₂-2)) where r=max{r₁,r₂}, shown to be asymptotically tight for r=1. The arguments associate trees with permutations and bivariate polynomials and supply characterizations for the skew case.
Significance. If the reduction is correct, the work supplies a concrete algorithmic and combinatorial foothold on the long-standing open problem of computing rotation distance in polynomial time. The O(n²) algorithm for skew trees is efficient, the upper bound is tight for the base case r=1, and the permutation/polynomial associations may furnish reusable tools for restricted rotation-distance questions.
major comments (2)
- [Abstract] Abstract: the central claim that unrestricted rotation distance reduces in polynomial time to the rank-bounded problem requires an explicit mapping T₁,T₂↦T₁′,T₂′ together with a proof that the shortest rotation sequence length is exactly preserved (or recoverable in poly time) while every intermediate tree stays inside the stated rank bound. Without this construction the subsequent O(n²) algorithm and the O(n³r) bound cannot be transferred to the unrestricted problem.
- [Upper bound paragraph] The upper-bound statement (and its claimed asymptotic tightness for r=1): the derivation must be checked against the precise definition of rank (Ehrenfeucht–Haussler) and against the permutation/polynomial encoding to confirm that the factor (2n+1)(r₁+r₂-2) is not an artifact of an overly loose counting argument.
Simulated Author's Rebuttal
We thank the referee for the careful reading and constructive comments. We address each major comment below.
read point-by-point responses
-
Referee: [Abstract] Abstract: the central claim that unrestricted rotation distance reduces in polynomial time to the rank-bounded problem requires an explicit mapping T₁,T₂↦T₁′,T₂′ together with a proof that the shortest rotation sequence length is exactly preserved (or recoverable in poly time) while every intermediate tree stays inside the stated rank bound. Without this construction the subsequent O(n²) algorithm and the O(n³r) bound cannot be transferred to the unrestricted problem.
Authors: The manuscript provides the explicit polynomial-time reduction (via the permutation association) and the distance-preservation argument in the body of the paper. We agree the abstract is too brief on this point and will revise it to state the mapping and the exact preservation property. revision: yes
-
Referee: [Upper bound paragraph] The upper-bound statement (and its claimed asymptotic tightness for r=1): the derivation must be checked against the precise definition of rank (Ehrenfeucht–Haussler) and against the permutation/polynomial encoding to confirm that the factor (2n+1)(r₁+r₂-2) is not an artifact of an overly loose counting argument.
Authors: The derivation follows directly from the Ehrenfeucht–Haussler rank definition and the bivariate-polynomial encoding: each rank adjustment costs at most 2n+1 rotations and there are r₁+r₂−2 such adjustments, multiplied by the quadratic base bound. Asymptotic tightness for r=1 is shown by explicit skew-tree constructions requiring Ω(n²) rotations, so the factor is not loose. revision: no
Circularity Check
No circularity: algorithmic reduction, explicit algorithm, and combinatorial bound are self-contained
full rationale
The paper defines d_r(T1,T2) explicitly as the shortest rotation sequence length under the rank-at-most-r restriction on all intermediate trees. It then claims a polynomial-time reduction from unrestricted rotation distance to this d_r problem, presents an O(n²) algorithm for the r=1 (skew) case, and derives the combinatorial upper bound d_r ≤ n²(1+(2n+1)(r1+r2-2)) via explicit associations of trees to permutations and bivariate polynomials. No step equates a claimed result to a fitted parameter, renames a known quantity, or reduces via self-citation to an unverified premise; the reduction, algorithm, and bound are constructed directly from the definitions and characterizations without circular dependence on their own outputs.
Axiom & Free-Parameter Ledger
axioms (2)
- domain assumption The rank of a binary tree is defined as in Ehrenfeucht and Haussler (1989).
- standard math Rotations preserve the inorder traversal of the binary tree.
Reference graph
Works this paper leans on
-
[1]
Learning decision trees from random examples
Ehrenfeucht A, Haussler D. Learning decision trees from random examples. Information and Computa- tion, 1989. 82(3):231–246. doi:10.1016/0890-5401(89)90001-1
-
[2]
Polynomials, Binary Trees, and Positive Braids
Wiley C, Gray J. Polynomials, Binary Trees, and Positive Braids. Missouri Journal of Mathematical Sciences, 2014. 26(1):1–13. doi:10.35834/mjms/1404997104
-
[3]
A note on some tree similarity measures
Culik K, Wood D. A note on some tree similarity measures. Information Processing Letters , 1982. 15(1):39–42. doi:10.1016/0020-0190(82)90083-7
-
[4]
On the rotation distance between binary trees
Dehornoy P. On the rotation distance between binary trees. Advances in Mathematics, 2010. 223(4):1316–
work page 2010
-
[5]
doi:10.1016/j.aim.2009.09.016
-
[6]
Rotation Distance, Triangulations, and Hyperbolic Geometry
Sleator D, Tarjan R, Thurston W. Rotation Distance, Triangulations, and Hyperbolic Geometry. In: Proceedings of the 18th Annual ACM Symposium on Theory of Computing. 1986 1(3):122–135. doi:10.1145/12130.12143
-
[7]
Pournin L. The diameter of associahedra. Advances in Mathematics, 2014. 259:13–42
work page 2014
-
[8]
A Linear-Time Approximation Algorithm for Rotation Distance
Cleary S, John KS. A Linear-Time Approximation Algorithm for Rotation Distance. J. Graph Algorithms Appl., 2010. 14(2):385–390. doi:10.7155/jgaa.00212. 104 S.K.M. Anoop and J. Sarma / On Rotation Distance of Rank Bounded Trees
-
[9]
Untangling Binary Trees via Rotations
Lucas J. Untangling Binary Trees via Rotations. The Computer Journal , 2004. 47(2):259–269. doi:10. 1093/comjnl/47.2.259
work page 2004
-
[10]
The Rotation Graph of Binary Trees Is Hamiltonian
Lucas J. The Rotation Graph of Binary Trees Is Hamiltonian. Journal of Algorithms, 1987. 8(4):503–535. doi:10.1016/0196-6774(87)90048-4
-
[11]
Linear-Time Constant-Ratio Approximation Algorithm and Tight Bounds for the Contiguity of Cographs
Crespelle C, Gambette P. Linear-Time Constant-Ratio Approximation Algorithm and Tight Bounds for the Contiguity of Cographs. In: W ALCOM: Algorithms and Computation, 7th International Workshop, W ALCOM 2013, Kharagpur, India, February 14-16, 2013. Proceedings, volume 7748 ofLecture Notes in Computer Science. Springer, 2013 pp. 126–136
work page 2013
-
[12]
Bulteau L, Fertin G, Rusu I. Sorting by Transpositions Is Difficult. In: Proceedings of International Con- ference on Automata, Languages and Programming (ICALP 2011). 2011 pp. 654–665. doi:10.1007/978- 3-642-22006-7 55
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.