On Counting and Embedding a Subclass of Height-Balanced Trees

A height-balanced tree is a rooted binary tree in which, for every vertex V, the difference in the heights of the subtrees rooted at the left and right child of V (called the balance factor of V) is at most one. In this paper, we consider height-balanced trees in which the balance factor of every vertex beyond a level is 0. We prove that there are 22 t −1 such trees and embed them into a generalized join of hypercubes.


Introduction
The problem of efficiently implementing parallel algorithms on parallel computers has been studied as a graph embedding problem, which is to embed the communication graph   (underlying a parallel algorithm ) within the network topology   of a parallel computer  with minimum communication overhead.The working of the parallel algorithm  when implemented on  can be described by embedding   into   .Mathematically, an embedding  of a (guest) graph (, ) into a (host) graph (, ) is a one-one function  :  →  such that if (, V) is an edge in , then () and (V) are connected by a path in .We use  :  →  and  :  →  analogously.The following are two of the parameters that measure the quality of an embedding.
By dist  (, ) we mean the shortest distance between  and  in graph .The dilation of an embedding measures the maximum time required to route a message in the host graph, between any two vertices.
If dilation() = 1, then  is isomorphic to a subgraph of  and we write  ⊆ .If dilation() = 2, then in this paper we denote it by  → .
(ii) Expansion() := ||/||.This parameter measures the relative number of unutilized processors in the host graph.Since  is a one-one function, expansion() is at least 1.
A goal of a parallel algorithm designer is to map (or embed) the algorithm graph  into an interconnection network  with dilation and expansion kept as minimum as possible.However, for most embedding problems, it is very difficult to obtain an embedding that minimizes these parameters simultaneously.Therefore, some tradeoffs among the parameters must be made; see Leighton [1].
Trees generally form the underlying data structure for several parallel algorithms that employ divide-and-conquer rule, branch-and-bound technique, and so on.A selfbalancing binary search tree that ensures a logarithmic running time (in both average and worst case) on operations such as insertion, deletion, and rotation, regardless of the order of the data inserted, is a height-balanced tree.Insertions and deletions may require the tree to be rebalanced by one or more tree rotations.However, these rotations take constant time.The height-balanced trees are also called AVL trees, named after their inventors Adelson-Velskii and Landis [2], and their computational aspects are discussed in [3][4][5].The computational efficiency of height-balanced data structures has motivated a vast study in parallel computations too.They have been used for concurrent search, concurrent insertion, and information storage and retrieval and implement parallel dictionary routines; see [4][5][6][7].A formal definition of heightbalanced trees is given in the next section.
On the other hand, among the interconnection networks of parallel computers, the binary hypercube has received much attention.An n-dimension hypercube (denoted by   ) has 2  vertices each labelled with a binary string of length  and two vertices are adjacent if and only if their labels differ in exactly one position.The hypercube topology has several attractive features.Its popularity is due to the fact that the nodes of a hypercube are symmetrically placed and the number of interprocessor connections per node is small.Another important property of a hypercube is its ability to efficiently simulate the message routings of other interconnection networks.An extensive survey of embedding various graphs into hypercubes is given in [1,[8][9][10].
In this paper, we consider a subclass HB(ℎ, ) of heightbalanced trees and we analyse the size of the subclass by counting the number of trees in it.We also prove that every height-balanced tree  ℎ ∈ HB(ℎ, ) is embeddable in a generalized join of hypercubes with dilation 2.

Preliminaries
Definition 1.A rooted binary tree  is said to be heightbalanced if, for every vertex V ∈ (), the heights of the subtrees, rooted at the left and right child of V, differ by at most one.
A classical example of a height-balanced tree is the complete binary tree.Figure 1 shows a few small heightbalanced trees.
In this paper, without loss of generality, we assume that the height of the left subtree is not less than the height of the right subtree for every V ∈ ().With any height-balanced tree , we associate a function b  : () → {0, 1} defined by b  (V) := the difference between the heights of left and right subtrees of V, for every vertex V ∈ ().This difference b  (V) is called the balance factor of V.The balance condition, being binary, ensures that the height of a height-balanced tree is logarithmic of its size; refer to [11].
It is usually assumed that the height of an empty tree is −1 and that of a single-vertex tree is 0. Consequently, for a leaf iff  is a complete binary tree. (1) If  ℎ is a height-balanced tree of height ℎ, we denote its levels by  0 ,  1 , . . .,  ℎ , where Let HB(ℎ, ) (where 0 ≤  ≤ ℎ) denote the subclass of height-balanced trees  with height ℎ such that So HB(ℎ, 0) ⊂ HB(ℎ, 1) ⊂ ⋅ ⋅ ⋅ ⊂ HB(ℎ, ℎ).While HB(ℎ, 0) contains only one element, namely, the complete binary tree of height ℎ, HB(ℎ, ℎ) is the class of all height-balanced trees of height ℎ.Let V(, ) be the th vertex from left at level ; then it follows from (1) and from the definition of HB(ℎ, ) that the subtree of  rooted at V (, ) ∈   is a complete binary tree.
Proof.The idea of the proof is to establish a one-to-one correspondence between HB(ℎ, ) and Z 2 t −1

2
. That is, for every  ∈ HB(ℎ, ), we will prove that there exists a sequence and vice versa.

Embedding Trees of HB(ℎ,𝑡)
In this section, we embed every tree  ∈ HB(ℎ, ) into a generalized join of hypercubes.Before we proceed to the result, we define the join of graphs and prove certain preliminary lemmas.Definition 3. The join (denoted by  1 +  2 ) of two graphs  1 and  2 is defined as follows: that is, joining each vertex of  to every vertex of .Proof.Figure 4 shows the tree  † ℎ .We call  as the deep root of  † ℎ .Consider an embedding  : ( † ℎ ) → (DRCBT(ℎ + 1)) as shown in Figure 4.Such an embedding  has dilation 2 since the edge (, ) ∈ ( † ℎ ) is mapped onto a path of length 2 in DRCBT(ℎ + 1) and this is the maximum shortest distance.The embedding  has expansion 1 since both  † ℎ and DRCBT(ℎ + 1) have 2 ℎ+1 vertices.Hence, in short,  † ℎ → DRCBT(ℎ + 1).

Conclusion
In this paper, we have considered a subclass HB(ℎ, ) of height-balanced trees and have analysed the size of this subclass.We have also embedded every tree in this subclass into a generalized join of hypercubes.

Figure 2 :
Figure 2:  ∈ HB(ℎ, ).The circles represent the vertices of the induced CBT from level 0 to .The text inside the circle V(, ) for 0 ≤  ≤ , 1 ≤  ≤ 2  denotes the th vertex from left at   .The vertex V(, ) is also denoted by   .