A natural idea to compare tree structures is to compute a distance based on the least number of admissible transformations needed to transform a tree into another [8]. Distance measures of leastmoves type are conceptually simple, yet computationally difficult [2]. In this paper, as in [4], the basis for the distance measure is the well-known rotation tree transformation [7]. In a previous paper [10], it is proved that this rotation induces a lattice structure on binary trees. Unfortunately, algebraic results cannot be used since this lattice is neither modular nor graded [5,8]. Using the weight sequences introduced in [10], we give an O(n 2) algorithm for computing efficient lower and upper bounds of the rotation distance. The rotation distance can exactly be computed using an admissible searching Algorithm D*, which uses the lower bound as an evaluation function. tively external) node. The weight q; of a tree T is the number of external nodes of T. Let B~ denote the set of binary trees with n internal nodes (i.e., n + 1 external nodes). The external nodes of a tree T are numbered by a pre-order traversal of T. Given T ~ B n, the weight sequence of T is the integer sequence (WT(1), WT(2),...,wT(n)) where WT(i ) is the weight of the largest subtree of T, whose last external node is the external node i [10]. An ordered pair of integers (i, j ) is said to be a segment of a tree T if there exists a subtree of T with i (respectively j) as first (respectively last) external node. Every T ~ B~ has n segments (i, j ) satisfying the following properties (where we set WT(n + I) = n + 1):
[1]
Jean Marcel Pallo,et al.
A-transformation dans les arbres n-aires
,
1983,
Discret. Math..
[2]
Jean Marcel Pallo,et al.
Enumerating, Ranking and Unranking Binary Trees
,
1986,
Comput. J..
[3]
Nils J. Nilsson,et al.
A Formal Basis for the Heuristic Determination of Minimum Cost Paths
,
1968,
IEEE Trans. Syst. Sci. Cybern..
[4]
W. H. Day,et al.
A computationally efficient approximation to the nearest neighbor interchange metric
,
1984
.
[5]
Bernard Monjardet,et al.
Metrics on partially ordered sets - A survey
,
1981,
Discret. Math..
[6]
Dwight Duffus,et al.
Path length in the covering graph of a lattice
,
1977,
Discret. Math..
[7]
Nils J. Nilsson,et al.
Problem-solving methods in artificial intelligence
,
1971,
McGraw-Hill computer science series.
[8]
Derick Wood,et al.
A Note on Some Tree Similarity Measures
,
1982,
Inf. Process. Lett..
[9]
D. Robinson.
Comparison of labeled trees with valency three
,
1971
.
[10]
S. Boorman,et al.
Metrics on spaces of finite trees
,
1973
.
[11]
Satosi Watanabe.
Paradigmatic Symbol-A Comparative Study of Human and Artificial Intelligence
,
1974,
IEEE Trans. Syst. Man Cybern..
[12]
Robert E. Tarjan,et al.
Rotation distance, triangulations, and hyperbolic geometry
,
1986,
STOC '86.