English

Practical estimation of rotation distance and induced partial order for binary trees

Data Structures and Algorithms 2016-10-20 v1

Abstract

Tree rotations (left and right) are basic local deformations allowing to transform between two unlabeled binary trees of the same size. Hence, there is a natural problem of practically finding such transformation path with low number of rotations, the optimal minimal number is called the rotation distance. Such distance could be used for instance to quantify similarity between two trees for various machine learning problems, for example to compare hierarchical clusterings or arbitrarily chosen spanning trees of two graphs, like in SMILES notation popular for describing chemical molecules. There will be presented inexpensive practical greedy algorithm for finding a short rotation path, optimality of which has still to be determined. It uses introduced partial order for binary trees of the same size: t1t2t_1 \leq t_2 iff t2t_2 can be obtained from t1t_1 by a sequence of only right rotations. Intuitively, the shortest rotation path should go through the least upper bound or the greatest lower bound for this partial order. The algorithm finds a path through candidates for both points in representation of binary tree as stack graph: describing evolution of content of stack while processing a formula described by a given binary tree. The article is accompanied with Mathematica implementation of all used procedures (Appendix).

Keywords

Cite

@article{arxiv.1610.06023,
  title  = {Practical estimation of rotation distance and induced partial order for binary trees},
  author = {Jarek Duda},
  journal= {arXiv preprint arXiv:1610.06023},
  year   = {2016}
}

Comments

5 pages, 8 figures

R2 v1 2026-06-22T16:25:23.853Z