Abstract

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

1. 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 , is an edge in , then and are connected by a path in . We use and analogously. The following are two of the parameters that measure the quality of an embedding.(i). By 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, then is isomorphic to a subgraph of and we write . If dilation, then in this paper we denote it by .(ii).This parameter measures the relative number of unutilized processors in the host graph. Since is a one-one function, expansion is at least .

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 self-balancing 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 [35]. 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 [47]. A formal definition of height-balanced 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 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, 810].

In this paper, we consider a subclass , of height-balanced 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 , is embeddable in a generalized join of hypercubes with dilation .

2. Preliminaries

Definition 1. A rooted binary tree is said to be height-balanced if, for every vertex , the heights of the subtrees, rooted at the left and right child of , differ by at most one.

A classical example of a height-balanced tree is the complete binary tree. Figure 1 shows a few small height-balanced 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 . With any height-balanced tree , we associate a function , defined by the difference between the heights of left and right subtrees of , for every vertex . This difference is called the balance factor of . 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 and that of a single-vertex tree is . Consequently, for a leaf , . Clearly, If is a height-balanced tree of height , we denote its levels by , , where . It is shown in [2] that the

Let where denote the subclass of height-balanced trees with height such that So . While contains only one element, namely, the complete binary tree of height , is the class of all height-balanced trees of height . Let be the th vertex from left at level ; then it follows from (1) and from the definition of that By (2) and (4), the number of vertices in , for , is

3. Counting Trees of HB

Theorem 2. The class of height-balanced trees contains exactly trees.

Proof. The idea of the proof is to establish a one-to-one correspondence between and . That is, for every , we will prove that there exists a sequence , such that , and vice versa.
We first assume the existence of a tree and associate an element of to . Given the tree , we order the vertices of according to the breadth first search (BFS), say, . For , let . Then the sequence is the required sequence.
We next prove the converse. For a given sequence of ’s and ’s, we construct a tree (Figure 2) such that (1) and (2) as follows. Consider a complete binary tree of height . Let denote the th leaf (where ) from left in level . For every , we root a complete binary tree to (i.e., becomes the root of ). The height of is calculated as follows: where
Claim 1 (). From (6), we note that . Therefore, the height of is height of . In , for all , every vertex is a vertex of some . Hence, for all . This implies that .
Claim 2 (for and , ). Let denote the subtree rooted at the vertex of . Hence by definition, the balance factor of the vertex is the difference between the heights of the left subtree and the right subtree of . That is, Let and denote the integers and , respectively. Since the subtree rooted at a vertex in level is a complete binary tree, we have and and . In order to calculate the difference , we consider two cases.
Case (). On rewriting the values of and we have and . We note that the greatest powers of that divides and are and . Hence, by following (6), we have and , , and then,
Case (). In this case, and . Since is even, and Hence in both cases, . We have proved the claims and hence the theorem.

4. Embedding Trees of HB

In this section, we embed every tree 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 ) of two graphs and is defined as follows: that is, joining each vertex of to every vertex of . Figure 3 shows the join of the hypercubes and .

Hence from the definition of graph join we have and . We denote the generalized join of graphs by . We note that .

Lemma 4. Let be a supertree of the complete binary tree of height with root formed by adding a new vertex and the edge . Let be the double rooted complete binary tree on vertices. Then .

Proof. Figure 4 shows the tree . We call as the deep root of . Consider an embedding as shown in Figure 4. Such an embedding has dilation since the edge is mapped onto a path of length in and this is the maximum shortest distance. The embedding has expansion since both and have vertices. Hence, in short, .

It is known that is a subgraph of ; see Nebeský [12]. Hence, this fact along with Lemma 4 implies the following.

Lemma 5. One has  .

In the next theorem, we give an embedding of every tree of into a generalized join of hypercubes.

Theorem 6. Let and let be the height of the complete binary tree rooted at the jth vertex from left at a level of . Then .

Proof. Consider . Let denote the th vertex from left in level . Decompose the tree into a forest of trees by deleting the set of edges for . Such a forest consists of complete binary trees rooted at (for ) and a complete binary tree induced by the vertices of from levels to . For , let where be the deep root of . Consider the embeddings (such embeddings exist by Lemma 5). For , consider (such an embedding exists by [12]). The vertices for and form a complete graph (a graph in which every pair of distinct vertices is connected by a unique edge) in and hence contain as subgraph the deleted set of edges of . Such an embedding technique is depicted in Figure 5. The dilation of the embedding is clearly and hence . The number of vertices of is and by (5), we have . Hence the expansion of the embedding is almost and is optimal.

5. Conclusion

In this paper, we have considered a subclass 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.

Conflict of Interests

The author declares that there is no conflict of interests regarding the publication of this paper.