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.
翻译:翻译后:
题目:有秩树的旋转距离
摘要:在树的高度平衡研究中,高效地(在 $poly(n)$ 时间内)计算两棵二叉树之间的旋转距离是一个悬而未决的问题。在本文中,我们开始研究此问题限制输入树的秩(由 Ehrenfeucht 和 Haussler(1989)在决策树的背景下定义)。 我们将两个给定的秩不超过 $r$ 的二叉树 $T_1$ 和 $T_2$(具有 $n$ 个内部节点)之间的有秩旋转距离(用 $d_r(T_1,T_2)$ 表示)定义为将 $T_1$ 转换为 $T_2$ 的最短旋转序列的长度,其中中间树必须秩不超过 $r$。我们证明旋转距离问题可以在多项式时间内规约为有秩旋转距离问题。这激励了在组合和算法前沿的问题研究。观察到秩1的树与斜树(每个内部节点至少有一个叶子作为子节点的二叉树)完全重合,我们在这一领域给出以下结果:当给定的树为斜树(我们称之为斜旋转距离问题)时,我们提供了一个 $O(n^2)$ 的算法来计算 $d_1(T_1,T_2)$。特别地,我们的技术意味着对于任何两个斜树 $d(T_1,T_2) ≤ n^2$。我们证明了以下上界:对于秩不超过 $r_1$ 和 $r_2$ 的任意两棵树 $T_1$ 和 $T_2$,我们有 $d_r(T_1,T_2) ≤ n^2(1+(2n+1)(r_1+r_2-2))$,其中 $r=max\{r_1,r_2\}$。当且仅当 $r=1$ 时,该界是渐进紧的。在证明上述定理的过程中,我们将二叉树与排列和双变量多项式相联系,并且证明了在斜树的情况下的几个特征。