JOURNAL OF ALGORITHMS ARTICLE NO.
26, 325]369 Ž1998.
AL970880
Interval Routing on k-Trees* Lata Narayanan† Department of Computer Science, Concordia Uni¨ ersity, Montreal, Quebec, Canada, H3G 1M8
and Naomi Nishimura‡ Department of Computer Science, Uni¨ ersity of Waterloo, Waterloo, Ontario, Canada, N2L 3G1 Received September 10, 1996
A graph has an optimal l-interval routing scheme if it is possible to direct messages along shortest paths by labeling each edge with at most l pairwise-disjoint subintervals of the cyclic interval w1 . . . n x Žwhere each node of the graph is labeled by an integer in the range.. Although much progress has been made for l s 1, there is as yet no general tight characterization of the classes of graphs associated with larger l. Bodlaender et al. have shown that under the assumption of dynamic cost links, each graph with an optimal l-interval routing scheme has treewidth of at most 4 l. For the setting without dynamic cost links, this paper addresses the complementary question of the number of intervals required to label classes of graphs of treewidth k. Although it has been shown that there exist graphs of treewidth 2 that require a nonconstant number of intervals, our work demonstrates a class of graphs of treewidth 2, namely 2-trees, that are guaranteed to allow 3-interval routing schemes. In contrast, this paper presents a 2-tree that cannot have a 2-interval routing scheme. For general k, any k-tree is shown to have an optimal interval routing scheme using 2 kq 1 intervals per edge. Q 1998 Academic Press
* An earlier version of this paper appeared in Proceedings of the Third International Colloquium on Structural Information and Communication Complexity ŽSIROCCO ’96.. † E-mail:
[email protected] ‡ E-mail:
[email protected] 325 0196-6774r98 $25.00 Copyright Q 1998 by Academic Press All rights of reproduction in any form reserved.
326
NARAYANAN AND NISHIMURA
1. INTRODUCTION Efficient strategies for interprocessor communication are crucial to fast performance in a distributed network. The classical solution to point-topoint routing involves storing a routing table at every processor, which contains for each possible destination an entry specifying the link to be taken by a message. When the size of the routing table is proportional to the number of processors in the network, this strategy proves prohibitive for large networks. Several strategies have been proposed to reduce the amount of space required by these schemes. One approach has shown that routing table space can be reduced at the expense of increasing the distance traversed by a message by at most a constant factor w1x. Another line of research has been to look at specific classes of graphs, such as planar graphs or c-decomposable graphs w6, 7x. To achieve compact routing tables, Santoro and Khatib w12x proposed inter¨ al routing. Each node is assigned a distinct label from the set 1, . . . , n4 , and each link a subinterval such that for any node ¨ in the network, the subintervals associated with outgoing links from ¨ form a partition of the cyclic interval w1 . . . n x. When a message with destination u arrives at node ¨ , the message is forwarded on the unique outgoing link labeled with an interval containing u. Variants of the scheme include linear schemes, in which w1 . . . n x is viewed as a linear interval; optimal schemes, in which messages are routed along shortest paths Žby the distance metric.; and multilabel Žor l-inter¨ al schemes, in which links can be labeled with at most l intervals w13x. A complete characterization of graphs that admit optimal l-interval routing schemes, or the class l-IRS Žor l-LIRS when restricted to linear schemes., has at yet proved elusive, although partial results have been obtained. Many well-known classes of graphs have been shown to be in 1-LIRS, such as complete graphs, meshes, hypercubes, complete bipartite graphs w9x, and proper interval graphs w4x. Other graphs, such as trees, tori, unit circular-arc graphs, and interval-arc graphs, are in 1-IRS w4, 9, 10, 12x. In attempts to characterize l-IRS and l-LIRS for general l, several closure properties have been obtained w9, 10x, as well as evidence that it is sufficient to consider biconnected graphs w10x. Some progress has been made under the additional assumption of dynamic cost links w2, 5x: in this more restrictive setting, a graph admits an optimal l-labeling only if it does so regardless of the costs on edges. Bodlaender et al. w3x make an intriguing connection between compact routing and treewidth, proving that graphs that admit optimal l-label interval routing schemes have treewidth of at most 4 l under the assumption of dynamic cost links. Under the distance metric, the converse does not hold, since for all n, it is possible to construct a graph Gn of treewidth
INTERVAL ROUTING ON
k-TREES
327
2 such that there is an edge with V Ž n1r3 . intervals in any optimal interval routing scheme for Gn w9x. It remains to be determined for which subclass of graphs of treewidth k there are schemes using f Ž k . intervals, for f Ž k . some function of k. In this paper we consider the class of k-trees, all of which have treewidth k; such graphs and other definitions are discussed in Section 2. Since each graph of treewidth k is a subgraph of a k-tree, there is hope that insights into the constraints on labeling k-trees will generalize to insights about partial k-trees. We show that every k-tree has an interval routing scheme using 2 kq 1 intervals per edge. For the case of 2-trees, we show a tight bound on the number of intervals required for any optimal labeling scheme: we construct a 3-interval optimal labeling for any 2-tree, and exhibit a 2-tree that does not admit a 2-labeling. The rest of the paper is organized as follows. We establish general properties of routing schemes on k-trees in Section 3, and then in Section 4 we propose a labeling scheme. The labeling scheme is shown to be optimal in Sections 5 and 6. The case of 2-trees is considered in Section 7, which specifies a 3-interval labeling for each 2-tree, and in Section 8, which shows that not every 2-tree has a 2-labeling. Ramifications of this work are considered in Section 9.
2. PRELIMINARIES 2.1. Inter¨ al Labeling Schemes Each graph G s Ž V Ž G ., EŽ G .. considered in this paper is a connected undirected unweighted graph without self-loops, representing a network. Although Ž u, ¨ . g EŽ G . is an undirected edge between u and ¨ , to model bidirectionality of the links in a network, we treat the edge as a pair of directed edges, Ž u, ¨ . and Ž ¨ , u.. All labeling schemes to be considered will be optimal labelings, as defined formally below. We will be particularly interested in schemes for which l g O Ž1., so that the total storage cost for all routing tables will be in O Ž< V Ž G .<.. DEFINITION 1. For any integer l G 1, and any graph G s Ž V Ž G ., EŽ G .., where < V Ž G .< s n, an optimal l-interval labeling of G, or l-labeling of G, denoted LG , consists of a bijection between V Ž G . and 1, 2, . . . , n4 , where LG Ž ¨ . is the label of ¨ , and the assignment to each e g EŽ G . of an edge label, LG Ž e ., which is a set containing l or fewer disjoint subintervals of the cyclic interval w1 . . . n x, such that 1. for each ¨ , the intervals associated with the outgoing edges form a partition of w1 . . . n x Žpossibly excluding LG Ž ¨ .. and
328
NARAYANAN AND NISHIMURA
2. for each distinct u and ¨ , if for some outgoing edge e from ¨ , a subinterval in LG Ž e . contains the vertex label LG Ž u., then there is a shortest path in G from ¨ to u containing the edge e as the first edge. A labeling scheme is said to be strict if for every vertex ¨ the label ¨ is not included in any interval associated with an edge outgoing from ¨ . All upper bounds given in this paper are for strict labeling schemes. However, the lower bound in Section 8 applies to both strict and nonstrict schemes. Figure 1 illustrates part of a strict 2-interval labeling of a graph; for the sake of readability, all edge labels except those emanating from nodes c and d are omitted. Given the vertex labeling as indicated, the edges emanating from d cannot optimally be labeled with a single interval each. In our determination of shortest paths, the following definition proves useful. DEFINITION 2. The length of any shortest path from u to ¨ is distŽ u, ¨ .. Given a pair of nodes u and ¨ , a node w is closer to u than to ¨ if distŽ w, u. - distŽ w, ¨ . and equidistant from u and ¨ if distŽ w, u. s distŽ w, ¨ .. More generally, w is equidistant from all nodes in a set S if for all pairs s and t in S, distŽ w, s . s distŽ w, t .. 2.2. k-Trees In this paper we consider labelings of k-trees. For any constant k, the set of partial k-trees, or subgraphs of k-trees, is equivalent to the set of graphs of treewidth k. Classes of graphs that are partial k-trees include trees, outerplanar graphs, series-parallel graphs, and chordal graphs with small clique size; more details about partial k-trees can be found in Kloks’ monograph w8x.
FIG. 1. A 2-interval labeling.
INTERVAL ROUTING ON
k-TREES
329
DEFINITION 3. For k ) 0, the set of k-trees is the smallest set of graphs satisfying 1. A k-clique is a k-tree. 2. Let G be a k-tree on n nodes and K be a k-clique in G. Then the n q 1 node graph G9 formed by taking G and introducing a new node ¨ adjacent to all of K is a k-tree. We can view the construction of a k-tree G as a step-by-step process. First, a k-clique of original nodes is formed; in the following, we denote the nodes in the clique x 1 , x 2 , . . . , x k . Each subsequent nonoriginal node ¨ is added by choosing a k-clique in the existing graph, known as the attachment clique of ¨ , and adding all edges between ¨ and AC Ž ¨ ., the set of nodes in the attachment clique of ¨ . Any node in AC Ž ¨ . is a parent of ¨ . We use OP Ž ¨ . to denote the set of parents of ¨ which are original nodes and NP Ž ¨ . to denote the set of parents of ¨ which are nonoriginal nodes. The node ¨ is the child of each node in AC Ž ¨ .. We use the notation childrenŽ S . to denote the set of nodes ¨ such that each node in S is a parent of ¨ Žor, equivalently, the set of nodes ¨ such that S : AC Ž ¨ ... For any attachment clique, the set of nodes with that attachment clique is a set of siblings, or, for any node ¨ , siblingsŽ ¨ . is the set of nodes with attachment clique AC Ž ¨ .. The ancestors of a node and descendants of an attachment clique Žor, by extension, a node in the attachment clique. can be defined analogously. Figure 2 is an illustration of a 3-tree with original nodes x 1 , x 2 , and x 3 . The nodes a and b are siblings, where AC Ž a. s OP Ž a. s x 1 , x 2 , x 3 4 ; for the node c, OP Ž c . s x 1 , x 34 and NP Ž c . s b4 . Each of the nodes a, b, and d are in the set childrenŽ x 2 , x 34.. The step-by-step construction of a k-tree implies a partial order on the nodes in G. The original nodes are at depth 0. For any subsequent node ¨ ,
FIG. 2. A 3-tree with nodes labeled by depths.
330
NARAYANAN AND NISHIMURA
the depth of ¨ , depthŽ ¨ ., is one greater than the maximum depth of any node in AC Ž ¨ .. The nodes in Fig. 2 are labeled with depths; the nonoriginal nodes could have been added in any of several orders, such as a, b, c, d or b, a, d, c. To draw a finer distinction between nodes, we introduce the notion of rank. For each original node x i we assign an arbitrary distinct rank in the range 1, . . . , k. For any other node ¨ in G, rank Ž ¨ . s depthŽ ¨ . q k. For the sake of completeness, we say that the attachment clique of an original node x is the set of original nodes of rank less than rank Ž x ., and that each node in AC Ž x . is a parent of x. Figure 3 demonstrates a 2-tree with ranks specified for each node. We use the notation w ¨ 1 , ¨ 2 , . . . , ¨ l x to denote a set of nodes ¨ 1 , ¨ 2 , . . . , ¨ l 4 listed in order of rank. The following additional definitions prove useful in our characterizations of routing schemes. For any node ¨ , the parent of ¨ with minimum rank is the oldest parent of ¨ , or opŽ ¨ ., and that with maximum rank is the youngest parent of ¨ , or ypŽ ¨ .. By the definition of depth, it is clear that rank Ž ¨ . s rank Ž ypŽ ¨ .. q 1. Analogously, for cliques P and P9, we will say that P is older than P9 Žand P9 is younger than P . if and only if each node in P9 is a descendant of P. The construction of k-trees dictates that for distinct cliques P and P9 that are both ancestors of ¨ , either P is older than P9 or P9 is older than P. The set Q s g 1 , g 2 , . . . , g k 4 of parents of opŽ ¨ . is the set of grandparents of the node ¨ . A low node is a node that does not have any of the original nodes as parents; an original node or a child of any original node is a high node. The following definitions facilitate the discussion of labelings by grouping together nodes with similar characteristics.
FIG. 3. A 2-tree labeled by node name and rank.
INTERVAL ROUTING ON
k-TREES
331
DEFINITION 4. For a nonoriginal node ¨ and p g AC Ž ¨ . y opŽ ¨ .4 , we define the cousins of ¨ and p, cousŽ ¨ , p ., to be the set of nodes b g V Ž G . N p is the node with minimum rank in AC Ž b . l AC Ž ¨ .4 . For an original node x, we define N Ž x . to be the set of nodes c g V Ž G . N the oldest parent of c is x 4 . DEFINITION 5. For any nonoriginal node ¨ , the cluster of ¨ , cluster Ž ¨ ., is the set of descendants of ¨ such that for each node u in the set, u is equidistant from all of the parents of ¨ . Similarly, for a set S, cluster Ž S . s D s g S cluster Ž s .. In Fig. 3, nodes a, b, and c are all siblings with attachment clique w x 1 , x 2 x; the attachment cliques of d, e, f, g, and h are, respectively, w x 2 , c x, w x 2 , d x, w c, d x, w c, f x, and w c, g x. In each case the oldest parent appears before the youngest parent in the attachment clique. The cliques w c, g x and w c, d x are both ancestors of h, with w c, d x being older than w c, g x. The high nodes are x 1 , x 2 , a, b, c, d, and e. The set cousŽ d, c . consists of the nodes f, g, and h. It is not difficult to see that cluster Ž c . s c, f, g, h4 and N Ž x 2 . s d, e4 . The key behind the results in the paper is the fact that the structure of a k-tree constrains the possible relationships between parents of nodes, as indicated in the following lemma. LEMMA 1.
For any node ¨ such that NP Ž ¨ . is nonempty,
1. There is a unique parent p1 g NP Ž ¨ . of minimum rank Ž of the nodes in NP Ž ¨ ... 2. The remaining nodes in NP Ž ¨ . can be called p 2 , p 3 , . . . , p < N P Ž ¨ .< , in strictly increasing order of rank, where the attachment clique of each pi , for 2 F i F < NP Ž ¨ .<, contains all pj for 1 F j - i. 3. If OP Ž ¨ . / B, then each node in OP Ž ¨ . is a parent of each node in NP Ž ¨ .. 4. Any descendant u of a k-clique containing ¨ is the descendant of a clique containing l parents of ¨ , ¨ , and k y 1 y l children of ¨ , for some ¨ alue of l in the range 0 F l F k y 1. Proof. To prove statement 1, suppose instead that there were two parents of minimum rank, p and p9. Since p and p9 are in NP Ž ¨ ., they are in the attachment clique of ¨ , and consequently there is an edge between p and p9. By the definition of a k-tree, the edge came into being either when p was added Žand hence p9 g AC Ž p ., so that rank Ž p9. rank Ž p .. or when p9 was added Žand hence p g AC Ž p9., so that rank Ž p . - rank Ž p9... In either case we obtain a contradiction.
332
NARAYANAN AND NISHIMURA
The distinctness of ranks of nodes in NP Ž ¨ ., as stated in statement 2, follows from the fact that each edge between nodes in NP Ž ¨ . is between a parent and a child. For a given i and j in the ranges defined in statement 2, since there is an edge between pi and pj , and pi is a nonoriginal node, either pj g AC Ž pi . or pi g AC Ž pj .. If pi g AC Ž pj ., then rank Ž pj . ) rank Ž pi ., which contradicts the fact that j - i. The proof of statement 3 follows from the observation that for x g OP Ž ¨ . and p g NP Ž ¨ ., since there is an edge between x and p and p is a nonoriginal node, x g AC Ž p .. Any descendant of a k-clique containing ¨ is either a child of ¨ or a proper descendant of a child of ¨ ; suppose u is the descendant Žnot necessarily proper. of the child c of ¨ . Since there is an edge between ¨ and each remaining parent of c, each remaining parent of c must be either a child or a parent of ¨ , completing the proof of statement 4. 2.3. Separators To prove properties of routing schemes in k-trees, we make use of the fact that the structure of the graphs dictates the possible routing of shortest paths. In particular, k-trees can be partitioned using small sets of nodes; each path between separate components must be routed through a node in the separator. DEFINITION 6. For nodes u and ¨ in V Ž G ., a subset S g V Ž G . is a u-¨ separator if u and ¨ are in different components of the graph induced on V Ž G . y S, and a separator of the subsets A1 , A 2 , . . . , A k of V Ž G ., if for every pair of vertices u and ¨ from distinct subsets, S is a u-¨ separator. The following lemma makes it possible to identify separators in a k-tree. LEMMA 2. For nodes u and ¨ in a k-tree, a clique C is a u-¨ separator if one of the following conditions holds: 1. u is a descendant of C and ¨ is not; or 2. u and ¨ are descendants of distinct siblings s and t such that AC Ž s . s AC Ž t . s C. Proof. Both parts of the lemma are simple consequences of the construction of a k-tree. When u is a descendant of C, it is not difficult to see that in the graph induced on V Ž G . y C, each node in the component containing u will be a descendant of C, proving the first statement. The second statement follows from the observation that each child of C, along with its descendants, will comprise a distinct component in V Ž G . y C. In Fig. 3, c, d4 is an e-f separator by property 1 of Lemma 2, and x 1 , x 2 4 is an a-g separator by property 2 and the fact that g is a descendant of the sibling c of a.
INTERVAL ROUTING ON
k-TREES
333
To determine the possible labels of edges, we make use of separators and clusters. Certain labelings are forced: if there is an edge from ¨ to w and w is on every shortest path from ¨ to x, then the edge Ž ¨ , w . must be labeled with x. The following lemma results from the fact that any path from u to ¨ must pass through a u-¨ separator. LEMMA 3. If a set of nodes C is a u-¨ separator, then dist Ž u, ¨ . s min dist Ž u, b . q dist Ž b, ¨ . N b g C 4 .
3. PROPERTIES OF CLUSTERS IN k-TREES To be able to better describe the relationships between nodes in the graph, we make extensive use of the concept of clusters. In particular, we will form labelings in which nodes in a cluster form a single contiguous interval in the labeling. To manipulate nodes in this way, we first establish basic properties of clusters in k-trees. We determine the relations between clusters and ancestors ŽLemmas 4]6., between clusters and shortest paths ŽLemma 7., between clusters of parents and children ŽLemma 8., and between clusters and cousins ŽLemma 9.. LEMMA 4.
If a g cluster Ž b . and b g cluster Ž c ., then a g cluster Ž c ..
Proof. Since b is in cluster Ž c ., b is a descendant of c, and b is equidistant from the parents of c. For each shortest path from b to a parent of c, the second node on the path must be a node to which b is connected, namely a parent of b. Since a g cluster Ž b ., a is equidistant from the parents of b; by concatenating a path from a to a parent of b and a path from a parent of b to each parent of c, it follows that a g cluster Ž c .. LEMMA 5. For any node ¨ , if opŽ ¨ . is a nonoriginal node, ¨ g cluster Ž opŽ ¨ ... Proof. To show that ¨ g cluster Ž opŽ ¨ .., we must show that ¨ is equidistant from each parent of opŽ ¨ .. Since there is an edge from ¨ to opŽ ¨ . and an edge from opŽ ¨ . to each of its parents, there is a path of length 2 from ¨ to each parent of opŽ ¨ .. By definition, opŽ ¨ . is the parent of ¨ with minimal rank; since no parent of opŽ ¨ . is a parent of ¨ , there is no path of length 1 from ¨ to a parent of opŽ ¨ ., completing our proof. LEMMA 6. For any nonoriginal node ¨ , there exists an original node x and a node c g N Ž x . such that ¨ g cluster Ž c .. Proof. If AC Ž ¨ . contains at least one original node, then the lemma is trivially true, as ¨ g cluster Ž ¨ .. If instead AC Ž ¨ . contains no original
334
NARAYANAN AND NISHIMURA
nodes, we apply Lemma 5, determining instead whether AC Ž opŽ ¨ .. contains at least one original node, repeating the process as necessary, making use of Lemmas 5 and 4 to examine AC Ž opŽ opŽ ¨ ..., AC Ž opŽ opŽ opŽ ¨ ...., and so on, until eventually we encounter a node c such that AC Ž c . contains at least one original node. For x the node of lowest rank in AC Ž c ., u g cluster Ž c . and c g N Ž x ., as required. Lemma 7 is a critical result that relates clusters and shortest paths. In particular, we are able to determine a cluster to which a node u belongs by simply identifying a clique of which u is a descendant and determining the node in the clique to which u is closest. LEMMA 7. For any node u and k-element clique P such that u is a descendant of P, if d m is the minimum rank node in P such that dist Ž u, d m . F dist Ž u, d . for all d g P, then if d m is a nonoriginal node, u g cluster Ž d m ., and if d m is an original node, u g cluster Ž N Ž d m ... Proof. For a nonoriginal node d m , it will suffice to show that for each parent p of d m , distŽ u, p . s distŽ u, d m . q 1. If a parent p of d m is in P, then since d m is the minimum rank node in P such that dist Ž u, d m . F dist Ž u, d . for all d g P, and rank Ž p . - rank Ž d m ., clearly dist Ž u, d m . dist Ž u, p .. Because p is a parent of d m , we can conclude that dist Ž u, p . s dist Ž u, d m . q 1. We now consider a parent q of d m that is not in P. By Lemma 2, since q is not a descendant of P, P is a u-q separator. The distance from u to q is thus min dist Ž u, b . q dist Ž b, q . N b g P 4 ; clearly, dist Ž u, q . s dist Ž u, d m . q dist Ž d m , q . s dist Ž u, d m . q 1, as needed. Finally, we prove by contradiction that if d m is an original node, then u g cluster Ž N Ž d m ... Suppose instead that d m is an original node and that u f cluster Ž N Ž d m ... Then by Lemma 6, for some x i / d m and some c g N Ž x i ., u g cluster Ž c .. Then node u is a descendant of both P and AC Ž c .; we consider the membership of d m and x i in the following cases. We observe that in all cases x i g AC Ž c . and d m g P. Case 1. x i g P, d m g AC Ž c .. Since both d m and x i are in AC Ž c ., the definition of N Ž x i . implies that rank Ž x i . - rank Ž d m .. Moreover, since u g cluster Ž c ., u is equidistant from all parents of c and, in particular, distŽ x i , u. s distŽ d m , u., contradicting the minimality of the rank of d m in P. Case 2. x i f P, d m g AC Ž c .. As argued in Case 1, rank Ž x i . - rank Ž d m .. Furthermore, since x i and d m are both original nodes in AC Ž c ., but x i f P, it must be that P is younger than AC Ž c .. By Lemma 2, P is an x i-u separator; since dist Ž x i , d m . s 1, by Lemma 3 dist Ž x i , u. s 1 q dist Ž d m , u.. This contradicts the fact that u is equidistant from the parents of c.
INTERVAL ROUTING ON
k-TREES
335
Case 3. x i g P, d m f AC Ž c .. As x i and d m are both in P, but d m f AC Ž c ., the clique AC Ž c . is younger than the clique P, and by Lemma 2 AC Ž c . is a d m -u separator. Since u g cluster Ž c ., u is equidistant from all nodes in AC Ž c ., and by Lemma 3 dist Ž u, d m . s dist Ž u, x i . q 1, contradicting the minimality of the value of d m in P. Case 4. x i f P; d m f AC Ž c .. In this case neither P nor AC Ž c . can be a descendant of the other, contradicting the fact that P and AC Ž c . are both ancestors of u. The decomposition of nodes into a set of clusters is crucial to limiting the number of intervals labeling any edge. In Lemma 8 we show that the cluster of any node ¨ is composed of clusters of children of ¨ , and that any descendant of a node ¨ is in the cluster of either ¨ or a parent of ¨ . Following the notation in Lemma 1, we denote by p1 , . . . , p < N P Ž ¨ .< the nodes in NP Ž ¨ .. LEMMA 8.
For any nonoriginal node ¨
1. cluster Ž ¨ . s ¨ 4 j D c1 , c 2 , . . . , c ky 1 g ch il d r enŽ ¨ . cluster Ž childrenŽ ¨ , c1 , c 2 , . . . , c ky1 ... 2. For AC Ž ¨ . s x i1, x i 2 , . . . , x i l , p1 , . . . , pkyl 4 such that 0 F l F k, any descendant of ¨ is in clusterŽ ¨ .4 j clusterŽ N Ž x i j .. N 1 F j F l 4 j cluster Ž pi . N 1 F i F k y l 4 . Proof. Since ¨ is directly connected to every node in AC Ž ¨ ., clearly ¨ g clu ster Ž ¨ . . W e n o w sh o w th a t clu ster Ž ¨ . y ¨ 4 : D c1 , c 2 , . . . , c ky 1 g ch il d r enŽ ¨ . cluster Ž childrenŽ ¨ , c1 , c 2 , . . . , c ky1 .. by considering the possible parents of a node u in cluster Ž ¨ . y ¨ 4 . By the definition of a cluster, u is a descendant of ¨ that is equidistant from all parents of ¨ . The set AC Ž u. cannot be equal to the set AC Ž ¨ . Žsince u is a proper descendant of ¨ . and AC Ž u. cannot contain a subset of AC Ž ¨ . Žsince u is equidistant from the parents of ¨ .. We can then conclude that AC Ž u. contains only descendants of ¨ Žpossibly including ¨ itself.. By combining with this conclusion statement 2 of Lemma 1, if AC Ž u. contains ¨ itself, then AC Ž u. consists of ¨ and k y 1 children of ¨ , satisfying the first statement of the lemma. It will thus suffice to consider u such that AC Ž u. consists only of proper descendants of ¨ . If AC Ž u. consists of proper descendants of ¨ , then u is the descendant of a clique of k children of ¨ , which we call d1 , d 2 , . . . , d k , in increasing order of depth. For the minimum value m such that dist Ž u, d m . F dist Ž u, d i . for all i / m, by Lemma 7, u g cluster Ž d m .. Finally, we need to show that d m is the child of ¨ and k y 1 children of ¨ . By the proof of statement 4 of Lemma 1, AC Ž d m . can contain only ¨ , parents of ¨ , and children of ¨ . Since d m is a child of ¨ , clearly ¨ g AC Ž d m .; since AC Ž d m . cannot
336
NARAYANAN AND NISHIMURA
contain all parents of ¨ , the assumption that u is equidistant from all parents of ¨ implies that no parent of ¨ is in AC Ž d m .. We can then conclude that d m is the child of ¨ and k y 1 children of ¨ , as needed to complete the proof of this portion of the lemma. We next show that D c1 , c 2 , . . . , c ky 1 g c h i l d r e nŽ ¨ . cluster Ž childrenŽ ¨ , c1 , c 2 , . . . , c ky1 .. : cluster Ž ¨ .. For any children of ¨ , c1 , c 2 , . . . , c ky1 , we let d be a child of c1 , c 2 , . . . , c ky1 and ¨ . Clearly, d and the parents of ¨ are in different components of the graph induced by V Ž G . y ¨ , c1 , c2 , . . . , c ky1 4 . Since the shortest path from d to each node in AC Ž ¨ . will be of length 2, d g cluster Ž ¨ ., and consequently, cluster Ž d . : cluster Ž ¨ ., as needed. To prove the second statement of the lemma, we first observe that any proper descendant u of ¨ is the descendant of a clique of nodes P containing ¨ and k y 1 parents of ¨ . We let d m be the element of P of minimum rank such that dist Ž u, d m . F dist Ž u, d . for any other d g P, and apply Lemma 7 to obtain the result. Finally, as a corollary to Lemma 8, we establish the role of cousins. LEMMA 9. For any nonoriginal node ¨ and p g AC Ž ¨ ., where p / opŽ ¨ ., if p is nonoriginal, then cluster Ž p . y p4 : cluster Ž cousŽ ¨ , p .., and if p is original, then cluster Ž N Ž p .. : cluster Ž cousŽ ¨ , p ... Proof. If p is nonoriginal and u g cluster Ž p . y p4 , then by Lemma 8, u g cluster Ž c . for some child c of p such that opŽ c . s p. If instead p is original, then u g cluster Ž N Ž p .. implies that u g cluster Ž c . for some c g N Ž p ., and by definition, opŽ c . s p. In each case c g cousŽ ¨ , p ., and consequently, u g cluster Ž cousŽ ¨ , p ...
4. LABELING k-TREES We describe an interval labeling scheme of a k-tree G; in subsequent sections we prove that it is optimal ŽSection 5. and that it constitutes a 2 kq 1-labeling ŽSection 6.. Appendix C considers an algorithm for labeling a graph according to this scheme. The labeling is based on the idea that each cluster should form a single interval, and that clusters of siblings should be adjacent in the labeling. Since the cluster of a node in turn contains clusters of its children, we have to ensure that the ordering of nodes of high rank results in the proper order of clusters of nodes of low rank. To this end, we define an ordering on nodes based on the lexicographic ordering of their parents; later we will show that for any set L of l nodes, the set of nodes with the l oldest parents equal to the set L forms one interval in the labeling.
INTERVAL ROUTING ON
k-TREES
337
We specify the labels of the n vertices of G by listing a sequence of sets of nodes, where it is understood that a set of size s receives the next consecutive s unassigned labels in the range from 1 to n. An arbitrary order is imposed on the original nodes. For each original node x, the labels of x and cluster Ž N Ž x .. are adjacent in the labeling, as follows: x 1 , cluster Ž N Ž x 1 . . , x 2 , cluster Ž N Ž x 2 . . , . . . , x k , cluster Ž N Ž x k . . . As a consequence of Lemma 6, each node in the graph is included in the labeling. The nodes in N Ž x . are ordered according to a lexicographic ordering of their attachment cliques such that the cluster of a node is adjacent to the node itself. To describe the ordering of nodes within cluster Ž N Ž x .., we determine an ordering $ of the nodes in N Ž x .. We let f : V Ž G . ª N be a one-to-one function that respects the partial order defined by the function rank, so that if rank Ž ¨ 1 . - rank Ž ¨ 2 ., then f Ž ¨ 1 . f Ž ¨ 2 .. There is a natural Žlexicographic. ordering relation between any two sets of nodes of size k, defined as follows. DEFINITION 7. For sets w ¨ 1 , ¨ 2 , . . . , ¨ k x and w u1 , u 2 , . . . , u k x, w ¨ 1 , ¨ 2 , . . . , ¨ k x $f w u1 , u 2 , . . . , u k x if and only if there exists an i F k such that f Ž ¨ i . - f Ž u i ., and for all values of j in the range 1 F j - i, f Ž ¨ j . s f Ž u j .. The ordering $ between nodes in N Ž x . and the set cluster Ž ¨ . l childrenŽ ¨ . are now based on the ordering relation $f : DEFINITION 8. For any nodes u and w such that either both u and w are in N Ž x . or both u and w are in cluster Ž ¨ . l childrenŽ ¨ . for some nonoriginal node ¨ , if w AC Ž u.x $f w AC Ž w .x, then u $ w, and if AC Ž u. s AC Ž w ., then either u $ w or w $ u can be chosen arbitrarily to hold. Moreover, for all nonoriginal ¨ , ¨ directly precedes cluster Ž ¨ . in the ordering. Finally, to label the nodes in cluster Ž N Ž x .. and cluster Ž ¨ ., we make use of the ordering $ defined above. In particular, for any u and w in N Ž x . Ž cluster Ž ¨ . l childrenŽ ¨ .., if u $ w, then we set LŽ u. - LŽ w . and for all s g cluster Ž u. and t g cluster Ž w ., LŽ s . - LŽ t .. The edge labels can be specified in terms of clusters, cousins, and children. Roughly speaking, an edge from a parent to a child is labeled by the cluster of the child, an edge from a child ¨ to a parent p / opŽ ¨ . is labeled by p and the clusters of the cousins cousŽ ¨ , p . Žexcept for the clusters of children of ¨ ., and an edge from a child ¨ to opŽ ¨ . is labeled with all remaining nodes. In Section 6, we will show that the largest number of intervals is required by the edge from ¨ to opŽ ¨ .; the bound on the number of intervals arises from the contiguity of clusters. The edge labelings are listed formally below. We use ¨ to denote an arbitrary nonoriginal node with parents w p1 , p 2 , . . . , pk x, x i and x j to be any two
338
NARAYANAN AND NISHIMURA
distinct original nodes, and z to be an arbitrary node, with c z denoting a nonoriginal child of z. In each case we list first the edge and then the set of nodes labeling the edge.
Ž z, c z .
: cluster Ž c z .
Ž xi , x j .
: x j 4 j cluster Ž N Ž x j . . y cluster Ž children Ž x i . .
Ž ¨ , pi .
: Ž where 2 F i F k . pi 4 j cluster Ž cous Ž ¨ , pi . . y cluster Ž children Ž ¨ . .
Ž ¨ , p1 .
: V Ž G . y ¨ 4 j cluster Ž children Ž ¨ . .
ž
k
j D Ž pi 4 j cluster Ž cous Ž ¨ , pi . . . . is2
/
Figure 4 illustrates a 4-labeling of a 2-tree; for the sake of readability, all edge labels except those emanating from b and x 2 are omitted. Table 1 indicates how the vertex labels were derived. The order of labels is x 1 , cluster Ž N Ž x 1 . . , x 2 , cluster Ž N Ž x 2 . . ;
FIG. 4. A 4-labeling of a 2-tree.
INTERVAL ROUTING ON
k-TREES
339
TABLE 1 Derivation of labels for Fig. 4 ¨
x1 x2 a b c d e f g h i j k
cluster Ž ¨ .
a4 b, e4 c, f, g, h4 d4 e4 f4 g4 h4 i4 j4 k4
cousŽ ¨ , p 2 .
f Ž¨ .
LŽ ¨ .
d, k 4 d, f, g, h4 d, k 4 b, f, g, h4 B e, i4 B B e, f 4 k4 j4
1 2 4 5 3 7 13 10 12 11 9 6 8
1 11 6 7 2 12 8 3 5 4 10 9 13
using the fact that N Ž x 1 . s a, b, c, i, j4 , N Ž x 2 . s d, k 4 , and the membership of cluster Ž c . and cluster Ž b . as defined below, we obtain the following ordering of vertex labels: x 1 , c, f , h, g , a, b, e, j, i , x 2 , d, k.
5. SHORTEST PATHS We now prove that the labeling scheme presented in Section 4 is an optimal scheme, namely, that the edge labels indicate shortest paths in G. Lemma 10 proves that each edge from a parent to a child can be labeled by the child’s cluster. LEMMA 10. For any nonoriginal child c z of an arbitrary node z, if u g cluster Ž c z ., there is a shortest path from z to u ¨ ia c z . Proof. If u s c z , then the result is trivial; otherwise, u must be a descendant of a clique consisting of c z and a set P of k y 1 parents of c z . For any p g AC Ž c z . y P, since p and u are in different components of the graph induced on V Ž G . y Ž P j c z 4., clearly dist Ž p, u . s min dist Ž p, b . q dist Ž b, u. N b g P j c z 44 . But since u g cluster Ž c z ., for all q g P, dist Ž p, u. s dist Ž q, u., and hence dist Ž p, u. s dist Ž c z , u. q 1. Since z is also a parent of c z , dist Ž z, u. s dist Ž p, u.. We can then conclude that dist Ž z, u. s dist Ž c z , u. q 1, or that there is a shortest path from z to u via cz.
340
NARAYANAN AND NISHIMURA
Since an original node has no parents that are nonoriginal nodes, any edge out of a node x i not handled in the previous lemma is an edge from x i to some x j . Lemma 11 indicates that modulo the nodes included in the labels on edges to children of x i , the nodes in V Ž G . are partitioned with respect to the sets N Ž x j .. LEMMA 11. For original nodes x i and x j , there is a shortest path ¨ ia x j from x i to e¨ ery node u g cluster Ž N Ž x j .. y cluster Ž childrenŽ x i ... Proof. We consider the set of nodes in AC Ž c ., where u g cluster Ž c . and c g N Ž x j . y childrenŽ x i .. Since u f cluster Ž childrenŽ x i .., clearly x i f AC Ž c ., and hence by Lemmas 2 and 3, dist Ž x i , u. s min dist Ž x i , b . q dist Ž b, u. N b g AC Ž c .4 . As u g cluster Ž c ., u is equally close to all members of AC Ž c ., and hence there is a shortest path from x i to u via x j . Lemmas 12 and 13 together establish the fact that the labelings on edges of the form Ž ¨ , pi . are shortest path labelings, where 2 F i F k. In particular, Lemma 12 is concerned with labelings of nodes that are not descendants of ¨ , and Lemma 13 is concerned with labels of nodes that are descendants of ¨ , but not in cluster Ž ¨ . Žfollowing the characterization in Lemma 8.. LEMMA 12. For any nonoriginal node ¨ with AC Ž ¨ . s w p1 , p 2 , . . . , pk x and all i / 1, there is a shortest path ¨ ia pi from ¨ to any node u that is not a descendant of ¨ such that u g cluster Ž cousŽ ¨ , pi ... Proof. Since u is not a descendant of ¨ , by Lemma 2 AC Ž ¨ . is a u-¨ separator, and hence any path from ¨ to u must pass through one of the nodes in AC Ž ¨ .. For a node c in cousŽ ¨ , pi . such that u g cluster Ž c ., pi is the node of minimum rank in AC Ž c . l AC Ž ¨ .. Since opŽ ¨ . is neither in AC Ž c . nor a descendant of AC Ž c ., due to its rank, its child ¨ is not a descendant of AC Ž c .. By Lemmas 2 and 3 we can conclude that dist Ž ¨ , u. s min dist Ž ¨ , b . q dist Ž b, u. N b g AC Ž c .4 . Since u g cluster Ž c ., u is equidistant from all nodes in AC Ž c .; since there is an edge from ¨ to pi g AC Ž c ., there must be a shortest path from ¨ to u via pi . LEMMA 13. For a nonoriginal node ¨ , and u, a descendant of ¨ that is not in cluster Ž c . for any child c of ¨ , there is a parent p of ¨ such that there is a shortest path from ¨ to u ¨ ia p, and if p / opŽ ¨ ., then u g cluster Ž cousŽ ¨ , p ... Proof. Since u is not in cluster Ž c . for any child c of ¨ , clearly u is not a child of ¨ . It is not difficult to see that u is the descendant of a clique containing at least one child of ¨ but not ¨ itself, since u is a nonchild descendant of ¨ ; let C be the youngest such clique that contains no proper descendants of children of ¨ . By Lemma 2, dist Ž ¨ , u. s min dist Ž ¨ , b . q dist Ž b, u. N b g C 4 .
INTERVAL ROUTING ON
k-TREES
341
By Lemma 7, if C consisted entirely of children of ¨ , then u would be in the cluster of one of the children, violating the assumption about u in the statement of the lemma. By the definition of C and Lemma 1, any node p in C that is not a child of ¨ must be a parent of a child of ¨ . Moreover, since ¨ and p are both parents of a child c of ¨ , there is an edge between ¨ and p; since p is not a child of ¨ , p must be a parent of ¨ . Thus C can contain only parents of ¨ and children of ¨ . For d m the minimum rank node in C such that dist Ž d m , u. F dist Ž b, u. for any b g C, by Lemma 7 u g cluster Ž d m . if d m is a nonoriginal node and u g cluster Ž N Ž d m .. if d m is an original node. Since by assumption u f cluster Ž c . for any child c of ¨ , d m must be a parent of ¨ . If d m / opŽ ¨ ., then u g cluster Ž cousŽ ¨ , d m .. follows from Lemma 9, and for any d m the existence of a shortest path from ¨ to u via d m follows from Lemma 3. Finally, the labels of edges from nonoriginal nodes to their oldest parents are considered in Lemmas 14 and 15, the proofs of which can be found in the Appendices. Lemma 14 considers paths from low nodes to nondescendants; Lemma 15 considers paths from high nodes to nondescendants. Paths from nonoriginal nodes to descendants not found in the clusters of children were previously covered by Lemma 13. LEMMA 14. For a low node ¨ with AC Ž ¨ . s w p1 , p 2 , . . . , pk x, there is a shortest path ¨ ia opŽ ¨ . from ¨ to any node u that is not a descendant of ¨ and k Ž is in V Ž G . y Ž cluster Ž childrenŽ ¨ .. j D is2 pi j cluster Ž cousŽ ¨ , pi ..... LEMMA 15. For any nonoriginal high node with w OP Ž w . s w x i1, . . . , x i l x for some l ) 0 and NP Ž w . s w p1 , . . . , pkyl x, there is a shortest path from w ¨ ia opŽ w . s x i1 to any nonoriginal node u that is not a descendant of w such ky l Ž that u g V Ž G . y ŽD is pi 4 j cluster Ž cous Ž w, pi ... j D ljs 2 Ž x i j 4 j 1 cluster Ž cousŽ w, x i j .....
6. COUNTING INTERVALS We make use of the contiguity of clusters and the lexicographic ordering of nodes to prove bounds on the maximum number of interval labels on any edge. Lemma 16 establishes the contiguity of clusters of nodes sharing sets of oldest parents; it is used extensively throughout this section. The remaining lemmas are used to determine bounds on the number of intervals for edges: Lemma 17 for Ž x i , x j ., Lemma 19 for Ž ¨ , pi . Žwhere i / 1., and Lemmas 18 and 19 for Ž ¨ , p1 ..
342
NARAYANAN AND NISHIMURA
LEMMA 16. For L s w a1 , a2 , . . . , a l x, where 1 F l F k, and B s b g V Ž G . N L is the set of the l oldest parents of b4 , cluster Ž B . forms a single contiguous inter¨ al in the labeling. Proof. If a1 is original, then B : N Ž a1 .. Since all of the nodes in cluster Ž N Ž a1 .. are contiguous in the ordering, no node in V Ž G . y cluster Ž N Ž a1 .. can have a label between labels of two elements in cluster Ž B .. Suppose there were b1 and b 2 in cluster Ž B . such that b1 $ b 2 and a node ¨ g cluster Ž N Ž a1 .. y cluster Ž B . such that b1 $ ¨ $ b 2 . Since ¨ f B, there exists a minimum j F l such that pj / a j , for pj the jth parent of ¨ in order of rank. Clearly, f Ž pj . / f Ž a j ., and thus since AC Ž b1 . and AC Ž b 2 . are identical on the first l elements, either w AC Ž ¨ .x $f w AC Ž b1 .x $f w AC Ž b 2 .x or w AC Ž b1 .x $f w AC Ž b 2 .x $f w AC Ž ¨ .x, and consequently, either ¨ $ b1 $ b 2 or b1 $ b 2 $ ¨ , contradicting the assumption. The result for a1 original follows from the fact that the argument above holds for any b1 and b 2 in cluster Ž B . and any ¨ g cluster Ž N Ž a1 .. y cluster Ž B .. For the case when a1 is nonoriginal, by Lemma 5, B : cluster Ž a1 .. Since all nodes in cluster Ž a1 . are contiguous in the labeling, no node in V Ž G . y cluster Ž a1 . can have a label between labels of two elements in cluster Ž B .. By an argument identical to the case when a1 is original, we can show that for any b1 and b 2 in cluster Ž B . such that b1 $ b 2 and ¨ g cluster Ž a1 . y cluster Ž B ., either ¨ $ b1 $ b 2 or b1 $ b 2 $ ¨ , proving the result. LEMMA 17. For i ) j, the number of inter¨ als occupied by the set x j 4 j cluster Ž N Ž x j .. y cluster Ž childrenŽ x i .. is at most 2 iyjy1 q 1, and for i - j, the number of inter¨ als is 1. Proof. Since x j is adjacent to cluster Ž N Ž x j .. in the labeling, the set x j 4 j cluster Ž N Ž x j .. occupies a single interval. If i - j, then no child of x i is in cluster Ž N Ž x j .., completing the proof for this case. To complete the proof of the lemma, we must show that when i ) j, cluster Ž childrenŽ x i .. l cluster Ž N Ž x j .. occupies at most 2 iyjy1 intervals. For a child ¨ of x i such that ¨ g N Ž x j ., the attachment clique of ¨ will be of the form w x j , a1 , a2 , . . . , a l , x i , c1 , . . . , c ky2yl x, for some l in the range 0 F l F k y 2. Since x i and x j are original nodes, each a m is chosen from the set Y of original nodes of ranks in the range j q 1 to i y 1 inclusive. By Lemma 16, for any set L of size l chosen from Y, the set of clusters of nodes with L j x i , x j 4 as the l q 2 oldest parents forms a single contiguous interval in the labeling. Thus the number of intervals occupied by the set cluster Ž childrenŽ x i .. l cluster Ž N Ž x j .. is at most the number of choices
INTERVAL ROUTING ON
k-TREES
343
for the set L, which is
ž /
Ý ls0
as claimed. LEMMA 18.
For any nonoriginal node ¨ with AC Ž ¨ . s w p1 , p 2 , . . . , pk x,
1. For each Bi s b g V Ž G . N ¨ g AC Ž b . and opŽ b . s pi 4 for any 2 F i F k, the total number of inter¨ als occupied by cluster Ž Bi . is at most 2 ky i. 2. For B s b g V Ž G . N ¨ g AC Ž b . and opŽ b . s opŽ ¨ .4 , the total number of inter¨ als occupied by cluster Ž B . is at most 2 ky 1 y 1. 3. The total number of inter¨ als occupied by cluster Ž childrenŽ ¨ .. is at most 2 k y 1. Proof. For a fixed i in the range 2 F i F k and a fixed b g Bi , the attachment clique AC Ž b . will be of the form w pi , a1 , a2 , . . . , a l , ¨ , c1 , c 2 , . . . , c ky2yl x, for some l in the range 0 F l F k y 2. By Lemma 1, each a j Ž1 F j F l . must be a parent of ¨ of rank higher than pi . For any set L of size l chosen out of the k y i parents of ¨ of higher rank than pi , by Lemma 16, the set of clusters of nodes with L j pi , ¨ 4 as the set of l q 2 oldest parents forms a single contiguous interval in the labeling. Thus the number of intervals required by the set cluster Ž Bi . is at most the number of choices for the set L, which is at most kyi
Ý ls0
ž
kyi s 2 ky i . l
/
For a fixed b g B, for some l in the range 0 F l F k y 2, the attachment clique AC Ž b . will be of the form w p1 , a1 , a2 , . . . , a l , ¨ , c1 , c 2 , . . . , c ky2yl x. By Lemma 1, each a j Ž1 F j F l . must be a parent of ¨ of rank higher than p1. For any set L of size l chosen out of the k y 1 parents of ¨ of higher rank than p1 , by Lemma 16, the set of clusters of nodes with L j p1 , ¨ 4 as the set of l q 2 oldest parents forms a single contiguous interval in the labeling. Thus the number of intervals comprised by the set cluster Ž B . is at most the number of choices for the set L, which is ky2
Ý ls0
ž
ky1 s 2 ky 1 y 1. l
/
Finally, to determine the total number of intervals occupied by cluster Ž childrenŽ ¨ .., we observe that we can partition the children of ¨ on
344
NARAYANAN AND NISHIMURA
the basis of the oldest parent in the attachment clique. Statements 1 and 2 concern those children for which ¨ is not the oldest parent in the attachment clique; by Lemma 8, the union of clusters of all such children forms cluster Ž ¨ . y ¨ 4 , which occupies a single contiguous interval. The total number of intervals occupied by cluster Ž childrenŽ ¨ .. is thus at most ŽÝ kis2 2 kyi . q Ž2 ky1 y 1. q 1 s 2 k y 1. LEMMA 19. For any nonoriginal node ¨ with AC Ž ¨ . s w p1 , p 2 , . . . , pk x and for any i in the range 2 F i F k, 1. The set pi 4 j cluster Ž cousŽ ¨ , pi .. occupies at most 2 ky iq1 inter¨ als. 2. The set pi 4 j cluster Ž cousŽ ¨ , pi .. y cluster Ž childrenŽ ¨ .. occupies at most 2 ky iq2 inter¨ als. Proof. The set cousŽ ¨ , pi . is the set of nodes b such that pi is the node of minimum rank in AC Ž b . l AC Ž ¨ .. Using a technique similar to that used in Lemma 18, we categorize each node b in cousŽ ¨ , pi ., and thereby its cluster, with respect to the set of parents of b that have smaller rank than pi . We first consider the case in which pi is nonoriginal, and fix a node b in cousŽ ¨ , pi .. The attachment clique of b will have the form AC Ž b . s w q1 , q2 , . . . , ql , pi , c1 , c 2 , . . . , c ky1yl x for some l in the range 0 F l F k y 1. By Lemma 1, each q j must be a parent of pi ; since pi is the node of smallest rank in AC Ž b . l AC Ž ¨ ., q j f AC Ž ¨ . and hence q j g AC Ž pi . y AC Ž ¨ .. To determine the number of intervals occupied by all nodes in cluster Ž cousŽ ¨ , pi .., we note that for each fixed set L of size l chosen out of the k y i q 1 elements of AC Ž pi . y AC Ž ¨ ., by Lemma 16 the clusters of the set of nodes with L j pi 4 as the set of l q 1 oldest parents occupies a single contiguous interval in the labeling. Counting over all possible choices of L, the number of intervals occupied by cluster Ž cousŽ ¨ , pi .. is at most the number of choices for the set L, which is 2 ky iq1. The clusters of nodes for which L s f constitutes the set cluster Ž pi . y pi 4 , by Lemma 5 and Lemma 8. Since pi g cluster Ž pi ., the number of intervals occupied by the set pi 4 j cluster Ž cousŽ ¨ , pi .. is at most 2 ky iq1. Suppose instead that pi s x j is original. Since the nodes p1 , . . . , piy1 are also original nodes, clearly i F j F k. Since b g cousŽ ¨ , pi ., pi is the node of lowest rank in AC Ž b . l AC Ž ¨ ., and hence any node in AC Ž b . of rank lower than pi must be an element of Y, the set of original nodes not in AC Ž ¨ . whose rank is lower than rank Ž pi .. For any fixed set L of l original nodes chosen from the j y i nodes in Y, by Lemma 16, the set of clusters of nodes b with L j pi 4 as the l q 1 oldest parents forms a single interval in the labeling. The total number of intervals occupied by cluster Ž cousŽ ¨ , pi .. is thus the number of choices for the set L, which is at
INTERVAL ROUTING ON
k-TREES
345
most 2 jyi F 2 ky i. The set of nodes for which L s f constitutes the set cluster Ž N Ž pi ... Since pi directly precedes cluster Ž N Ž pi .. in the labeling, the total number of intervals occupied by the set pi 4 j cluster Ž cousŽ ¨ , pi .. is at most 2 ky i. To prove the second part of the lemma, it suffices to count the number of intervals occupied by clusters of children of ¨ that are in cousŽ ¨ , pi ., to be excluded from the at most 2 ky iq 1 intervals occupied by cluster Ž cousŽ ¨ , pi ... By Lemma 1, for any child b of ¨ , each node in AC Ž b . y ¨ 4 is a parent of ¨ or a child of ¨ . Moreover, since b is in cousŽ ¨ , pi ., it follows that opŽ b . s pi . Then by Lemma 18 the number of intervals occupied by nodes in cluster Ž cousŽ ¨ , pi .. l childrenŽ ¨ .. is at most 2 ky i. The total number of intervals in pi 4 j cluster Ž cousŽ ¨ , pi .. y cluster Ž childrenŽ ¨ .. is thus at most 2 ky iq1 q 2 kyi - 2 kyiq2 . THEOREM 1.
E¨ ery k-tree has an optimal 2 kq 1-inter¨ al routing scheme.
Proof. We first show that the routing scheme described is a legitimate labeling, then that it is optimal, and finally that there are at most O Ž2 k . labels per edge. The fact that every node in V Ž G . is assigned a unique label is a consequence of Lemmas 6 and 8. By a straightforward examination of the edge labeling scheme, one can verify that for each node the intervals associated with the outgoing edges form a partition of w1 . . . n x. Finally, the fact that the labeling yields shortest paths is a consequence of the lemmas in Section 5. We now consider each type of edge and show that for each one, the number of intervals satisfies the stated bound.
Ž z, c z . : cluster Ž c z . This is a single interval, by the definition of the labeling.
Ž x i , x j . : x j 4 j cluster Ž N Ž x j . . y cluster Ž childrenŽ x i . . By Lemma 17 this is at most 2 iyjy1 q 1 intervals, or since 1 F i, j F k, at most 2 ky 2 q 1 intervals.
Ž ¨ , pi . : Ž where 2 F i F k . pi 4 j cluster Ž cous Ž ¨ , pi . . y cluster Ž childrenŽ ¨ . . . By Lemma 19, the number of intervals on this edge is at most 2 ky iq2 .
Ž ¨ , p1 . : V Ž G . y ¨ 4 j cluster Ž childrenŽ ¨ . . j
ž
k
D Ž pi 4 j cluster Ž cous Ž ¨ , pi . . . is2
/
346
NARAYANAN AND NISHIMURA
Since w1 . . . < V Ž G .
7. A 3-LABELING FOR 2-TREES In this section, we describe how to modify the labeling described in Section 4 to obtain an optimal 3-labeling for 2-trees. To motivate the description of the new labeling, we first examine the labeling from Section 4 as applied to 2-trees. Following the notation of Section 2, x 1 and x 2 are the original nodes of T, and for any node ¨ , AC Ž ¨ . s w opŽ ¨ ., ypŽ ¨ .x. We introduce the notation g Ž ¨ ., the grandparent of ¨ , to denote the node in AC Ž ypŽ ¨ .. y opŽ ¨ .4 , which is defined whenever ypŽ ¨ . is nonoriginal. To facilitate the description of the labeling, we introduce a finer grouping of nodes into sets. The children of a node ¨ can be categorized by their rank; for any node ¨ , we let C Ž ¨ , i . s b g V ŽT . N ¨ g AC Ž b . and rank Ž b . s rank Ž ¨ . q i4 . As before, x 1 has rank 1 and x 2 has rank 2, so C Ž x 1 , 2. s C Ž x 2 , 1. is the set of children of x 1 and x 2 . Any node ¨ is in C Ž opŽ ¨ ., i . for some value of i; if i is odd, we call ¨ an odd node, and if i is even, we call ¨ an e¨ en node. We will be interested in sets of children of particular pairs of nodes, such as O Ž ¨ . s childrenŽw opŽ ¨ ., ¨ x., Y Ž ¨ . s childrenŽw ypŽ ¨ ., ¨ x., and GŽ ¨ . s childrenŽw g Ž ¨ ., ypŽ ¨ .x.. The definitions of C, O, Y, and G can be extended to sets of nodes in the obvious way: for instance, O Ž A. s D ¨ g A O Ž ¨ .. By applying O to each of O Ž ¨ ., Y Ž ¨ ., and GŽ ¨ ., we group together children that share a single parent: O Ž O Ž ¨ .. s b g V ŽT . N AC Ž b . s w opŽ ¨ ., ax, where a g O Ž ¨ .4 ; O Ž Y Ž ¨ .. s b g V ŽT . N AC Ž b . s w ypŽ ¨ ., ax where a g Y Ž ¨ .4 ; and O Ž GŽ ¨ .. s b g V ŽT . N AC Ž b . s w g Ž ¨ ., ax where a g GŽ ¨ .4 . The terminology above gives rise to an alternative characterization of the children of ¨ . LEMMA 20. For any nonoriginal node ¨ , the set childrenŽ ¨ . s O Ž ¨ . j Y Ž ¨ . j D iG 2 C Ž ¨ , i . and the set cluster Ž ¨ . s ¨ 4 j D iG 2 cluster Ž C Ž ¨ , i ... Proof. We first observe that childrenŽ ¨ . s D iG 1 C Ž ¨ , i ., since each child of ¨ must belong to a set C for some value of i. A child u of ¨ will have rank rank Ž ¨ . q 1 only if ¨ is the younger parent of u. If ¨ is the
INTERVAL ROUTING ON
k-TREES
347
younger parent of u, the older parent of u must be a parent of ¨ , and hence either opŽ u. s opŽ ¨ . or opŽ u. s ypŽ ¨ .. From this argument it is not difficult to see that C Ž ¨ , 1. s O Ž ¨ . j Y Ž ¨ ., and hence that the first statement in the lemma holds. By Lemma 8, cluster Ž ¨ . is the union of ¨ 4 and the set of clusters of nodes u such that u is a child of ¨ and a child of a child of ¨ . If u is a child of both ¨ and a child of ¨ , then rank Ž u. G rank Ž ¨ . q 2; consequently, cluster Ž ¨ . s ¨ 4 j D iG 2 cluster Ž C Ž ¨ , i ... Using the new notation, the labeling of Section 4, when applied to 2-trees, can also be described as follows: x 1 , cluster Ž C Ž x 1 , 2 . . , cluster Ž C Ž x 1 , 3 . . , . . . , x 2 , cluster Ž C Ž x 2 , 2 . . , cluster Ž C Ž x 2 , 3 . . , . . . Sin ce V Ž G . y Ž ¨ 4 j cluster Ž children Ž ¨ .. j yp Ž ¨ .4 j cluster Ž cousŽ ¨ , ypŽ ¨ .... is the label on the edge Ž ¨ , opŽ ¨ .., it is a simple corollary of the following lemma that four intervals will be required if none of cluster Ž ¨ ., cluster Ž O Ž ¨ .., cluster Ž ypŽ ¨ .., and cluster Ž GŽ ¨ .. are adjacent in the labeling. L EMMA 21. ¨ 4 j cluster Ž children Ž ¨ .. j yp Ž ¨ .4 j cluster Ž cous Ž ¨ , ypŽ ¨ ... s cluster Ž ¨ . j cluster Ž O Ž ¨ .. j cluster Ž ypŽ ¨ .. j cluster Ž GŽ ¨ .. Proof. For ease of exposition, we define X as follows: X s ¨ 4 j cluster Ž children Ž ¨ . . j yp Ž ¨ . 4 j cluster Ž cous Ž ¨ , yp Ž ¨ . . . . By Lemma 20, childrenŽ ¨ . s O Ž ¨ . j Y Ž ¨ . j D iG 2 C Ž ¨ , i ., and hence cluster Ž childrenŽ ¨ .. s cluster Ž O Ž ¨ .. j cluster Ž Y Ž ¨ .. j D iG 2 cluster Ž C Ž ¨ , i ..., so that X s ¨ 4 j cluster Ž O Ž ¨ . . j cluster Ž Y Ž ¨ . . j
D cluster Ž C Ž ¨ , i . . iG2
j yp Ž ¨ . 4 j Ž cluster Ž cous Ž ¨ , yp Ž ¨ . . . y cluster Ž G Ž ¨ . . . j cluster Ž G Ž ¨ . . . Furthermore, by Lemma 20, cluster Ž ¨ . s ¨ 4 j D iG 2 cluster Ž C Ž ¨ , i .., hence X s cluster Ž ¨ . j cluster Ž O Ž ¨ . . j cluster Ž Y Ž ¨ . . j yp Ž ¨ . 4 j Ž cluster Ž cous Ž ¨ , yp Ž ¨ . . . y cluster Ž G Ž ¨ . . . jcluster Ž G Ž ¨ . . .
348
NARAYANAN AND NISHIMURA
By Lemma 8, cluster Ž ypŽ ¨ .. is the union of ypŽ ¨ .4 and the set of clusters of nodes u such that u is the child of ypŽ ¨ . and a child of ypŽ ¨ .. Each node in cousŽ ¨ , ypŽ ¨ .. has ypŽ ¨ . but not opŽ ¨ . as its parent; by extension, each node in cousŽ ¨ , ypŽ ¨ .. y GŽ ¨ . has ypŽ ¨ . but no parent of ypŽ ¨ . as its parent. Thus each node in cousŽ ¨ , ypŽ ¨ .. y GŽ ¨ . has as attachment clique ypŽ ¨ . and a child of ypŽ ¨ .. Consequently, we can express cluster Ž ypŽ ¨ .. as ypŽ ¨ .4 j cluster Ž cousŽ ¨ , ypŽ ¨ ... y cluster Ž GŽ ¨ ... It is not difficult to see that Y Ž ¨ . : cousŽ ¨ , ypŽ ¨ .., and hence X s cluster Ž ¨ . j cluster Ž O Ž ¨ . . j cluster Ž yp Ž ¨ . . j cluster Ž G Ž ¨ . . , as needed to complete the proof of the lemma. To reduce the number of intervals required, we alter the labeling so that for any node ¨ , two of the above four intervals will always be adjacent. THEOREM 2.
E¨ ery 2-tree has an optimal 3-labeling scheme.
Proof. For any 2-tree T, we define the following vertex labeling: x 1 , cluster Ž C Ž x 1 , 2 . j C Ž x 1 , 3 . . , cluster Ž C Ž x 1 , 4 . j C Ž x 1 , 5 . . , . . . , x 2 , cluster Ž C Ž x 2 , 2 . j C Ž x 2 , 3 . . , cluster Ž C Ž x 2 , 4 . j C Ž x 2 , 5 . . , . . . To further specify the labeling within each set of the form C Ž x, 2 i . j C Ž x, 2 i q 1., we first recursively establish an ordering $ on nodes in C Ž x, j . as follows. We use the term C Ž x, i .-contiguous to denote that the nodes in a set are contiguous under the restriction of $ to nodes in C Ž x, i .. As a base case, the nodes in C Ž x 1 , 2. Žchildren of x 1 and x 2 . are assigned an arbitrary order $ . Each node in C Ž x 2 , 2. is a child of x 2 and a node in C Ž x 1 , 2.; the order $ is extended to nodes in C Ž x 2 , 2., so that all children of a particular node b g C Ž x 1 , 2. are C Ž x 2 , 2.-contiguous, and if b $ c for b and c in C Ž x 1 , 2., then all children of b in C Ž x 2 , 2. precede all children of c in C Ž x 2 , 2.. Finally, in the general case, $ can be extended to nodes in the set C Ž x, j . by ensuring that siblings are C Ž x, j .contiguous, and if b $ c for b and c in C Ž x, j y 1., then b9 $ c9 for each child b9 of b and c9 of c in C Ž x, j .. We next note that any child of x of rank rank Ž x . q 2 i q 1 must be the child of x and a node of rank rank Ž x . q 2 i Žand hence a child of x itself.. Since x is the oldest parent of any node in C Ž x, 2 i ., the above statement can be written as the equation C Ž x, 2 i q 1. s O Ž C Ž x, 2 i ... Thus, to determine the ordering of labels of all elements in the set cluster Ž C Ž x, 2 i . j C Ž x, 2 i q 1.., we order the nodes in C Ž x, 2 i . in a manner consistent with $ and place cluster Ž O Ž b .. right after cluster Ž b . for each node b g C Ž x, 2 i ..
INTERVAL ROUTING ON
k-TREES
349
Finally, we specify the ordering among nodes in cluster Ž ¨ .. This ordering is similar to the ordering overall, in that next to ¨ are placed clusters of the children of ¨ in decreasing order of depth, pairing depths in twos. For d the highest difference between the depth of ¨ and the depth of any child of ¨ , ordering of cluster Ž ¨ . is as follows for d odd: ¨ , cluster Ž C Ž ¨ , 2 . j C Ž ¨ , 3 . . , . . . , cluster Ž C Ž ¨ , d y 1 . j C Ž ¨ , d . .
where for d even the last sets are cluster Ž C Ž ¨ , d y 2. j C Ž ¨ , d y 1.. and cluster Ž C Ž ¨ , d ... As in the case of children of original nodes, we can define an ordering $ on children and therefore descendants of ¨ . For each i such that C Ž ¨ , 2 i . and C Ž ¨ , 2 i q 1. are both nonempty, C Ž ¨ , 2 i q 1. s O Ž C Ž ¨ , 2 i ... We order the nodes in C Ž ¨ , 2 i . to be consistent with $ , and place cluster Ž O Ž b .. right after cluster Ž b . for each node b g C Ž ¨ , 2 i .. For convenience, for each low node ¨ , we use Sl to denote the set of siblings of ¨ that appear before ¨ in the labeling Žor, equivalently, Sl is the set of siblings u such that u $ ¨ . and Sr to denote the set of siblings of ¨ that appear after ¨ in the labeling Žor, equivalently, Sr is the set of siblings u such that ¨ $ u.. LEMMA 22. For an e¨ en node ¨ , the set cluster Ž ¨ . j cluster Ž O Ž ¨ .. forms a single inter¨ al in the labeling. Proof. Since ¨ is an even node, there exists a value i such that the rank of ¨ is 2 i greater than that of its parent z s opŽ ¨ .. It is not difficult to see that ¨ g C Ž z, 2 i . and that O Ž ¨ . : C Ž z, 2 i q 1.. As noted in the description of the ordering of nodes in cluster Ž z ., the nodes in the set cluster Ž C Ž z, 2 i . j C Ž z, 2 i q 1.. are ordered so that cluster Ž ¨ . and cluster Ž O Ž ¨ .. are adjacent, as claimed. LEMMA 23. For a set of e¨ en nodes A s childrenŽw ¨ 1 , ¨ 2 x., the set cluster Ž A. j cluster Ž OŽ A... forms a single inter¨ al in the labeling. Proof. Since each node in A has the same parents, each node in A has the same rank Žnamely one greater than rank Ž ¨ 2 ., since ¨ 2 is the younger parent.. Moreover, since A is a set of even nodes, A : C Ž ¨ 1 , 2 i . for some value of i. Clearly, cluster Ž A. j cluster Ž O Ž A.. : cluster Ž C Ž ¨ 1 , 2 i . j C Ž ¨ 1 , 2 i q 1... Suppose that there were nodes a and b in cluster Ž A. j cluster Ž O Ž A... and a node c f cluster Ž A. j cluster Ž O Ž A... such that c appeared between a and b in the labeling. Since all of cluster Ž C Ž ¨ 1 , 2 i . j C Ž ¨ 1 , 2 i q 1.. forms a single interval in the labeling, c g cluster Ž C Ž ¨ 1 , 2 i . j C Ž ¨ 1 , 2 i q 1.., and hence c g cluster Ž z . j cluster Ž O Ž z .. for some z g C Ž ¨ 1 , 2 i . y A. Similarly, a g cluster Ž x . j cluster Ž O Ž x .. and b g cluster Ž y . j cluster Ž O Ž y .. for x and y in A : C Ž ¨ 1 , 2 i ..
350
NARAYANAN AND NISHIMURA
By the definition of $ , the nodes in C Ž ¨ 1 , 2 i . are ordered such that siblings are C Ž ¨ 1 , 2 i .-contiguous. Since x and y are siblings but z is not, either z $ x $ y or x $ y $ z. In either case c could not appear between a and b in the labeling. We now describe the edge labeling for all nodes ¨ , where the label on a particular edge out of ¨ will depend on whether ¨ and ypŽ ¨ . are original or nonoriginal and even or odd. In each of the cases below, we describe the edge labeling and show that the number of intervals on any edge is at most three. In the following bounds, we make use of facts concerning Y Ž ¨ .. Since each node has a rank one greater than that of its younger parent, rank Ž ¨ . s rank Ž ypŽ ¨ .. q 1, and any node in Y Ž ¨ . has rank rank Ž ypŽ ¨ .. q 2. Since Y Ž ¨ . is always a set of even siblings, by Lemma 23 we can conclude that the set cluster Ž Y Ž ¨ . j O Ž Y Ž ¨ ... forms a single interval in the labeling. We will use this fact repeatedly in proving bounds on the number of intervals on edges of the type Ž ¨ , ypŽ ¨ ... We first consider the labels on an edge from a node ¨ to a child c of ¨ . It is not difficult to see that a child of a nonoriginal node ¨ will either have ¨ as its oldest parent, or belong to O Ž ¨ . j Y Ž ¨ .. Furthermore, a child of an original node ¨ will have ¨ as its oldest parent unless ¨ s x 2 and c g C Ž x 1 , 2..
Ž ¨ , c . Ž where op Ž c . s ¨ or ¨ is nonoriginal and even and c g O Ž ¨ . . : cluster Ž c . This is a single interval by the definition of the labeling.
Ž ¨ , c . Ž where ¨ is nonoriginal and odd and c g O Ž ¨ . or ¨ s x 2 and c g C Ž x 1 , 2 . . : cluster Ž c . j cluster Ž O Ž c . . Since in each case c is an even node, by Lemma 22 this is a single interval.
Ž ¨ , c . Ž where ¨ is nonoriginal and c g Y Ž ¨ . . : cluster Ž c . j cluster Ž O Ž c . . Since c g Y Ž ¨ . is an even node, by Lemma 22 this label comprises a single interval. To complete the labeling for edges outgoing from original nodes, we describe the labeling on the edges Ž x i , x j ..
Ž x 1 , x 2 . : x 2 4 j cluster Ž N Ž x 2 . . This is a single interval by the definition of the labeling.
Ž x 2 , x 1 . : x 1 4 j cluster Ž N Ž x 1 . . y cluster Ž C Ž x 1 , 2 . j C Ž x 1 , 3 . . From the description of the labeling, it is easy to see that x 14 j cluster Ž N Ž x 1 .. is a single interval, and that cluster Ž C Ž x 1 , 2. j C Ž x 1 , 3.. is a
INTERVAL ROUTING ON
k-TREES
351
single subinterval of that interval, thus yielding at most two intervals on the edge. It remains to describe the labels on the edges Ž ¨ , ypŽ ¨ .. and Ž ¨ , opŽ ¨ .. where ¨ is nonoriginal. It is straightforward to check that the following cases are exhaustive. Case 1. opŽ ¨ . s opŽ ypŽ ¨ .., ypŽ ¨ . is nonoriginal, and ¨ is even. By Lemma 5, both ¨ and ypŽ ¨ . are in cluster Ž opŽ ¨ .. if opŽ ¨ . is nonoriginal and in N Ž opŽ ¨ .. otherwise. Moreover, since in this case g Ž ¨ . s ypŽ ypŽ ¨ .., it follows that rank Ž ypŽ ¨ .. s rank Ž g Ž ¨ .. q 1. Therefore the set GŽ ¨ . is a set of even nodes, enabling the application of Lemma 23 to this set. Since the rank of ¨ is one greater than the rank of its younger parent and ¨ is even, ypŽ ¨ . is an odd node. The labeling on the edges outgoing from ¨ is described below:
Ž ¨ , yp Ž ¨ . . : cluster Ž yp Ž ¨ . . j cluster Ž G Ž ¨ . . j cluster Ž O Ž G Ž ¨ . . . y Ž cluster Ž Y Ž ¨ . . j cluster Ž O Ž Y Ž ¨ . . . By Lemma 23, cluster Ž GŽ ¨ .. j cluster Ž O Ž GŽ ¨ ... occupies a single interval, and the set cluster Ž Y Ž ¨ .. j cluster Ž O Ž Y Ž ¨ ... forms a single interval in the labeling. Thus the total number of intervals is at most three.
Ž ¨ , op Ž ¨ . . : V Ž G . y Ž cluster Ž yp Ž ¨ . . j cluster Ž ¨ . j cluster Ž O Ž ¨ . . jcluster Ž G Ž ¨ . . j cluster Ž O Ž G Ž ¨ . . . . By Lemma 22, the set cluster Ž ¨ . j cluster Ž O Ž ¨ .. forms a single interval, and by Lemma 23 the set cluster Ž GŽ ¨ . j O Ž GŽ ¨ ... also forms a single interval. Since the set cluster Ž ypŽ ¨ .. occupies a single interval, in total three intervals are excluded from the cyclic interval w1 . . . < V Ž G .
Ž ¨ , yp Ž ¨ . . : cluster Ž yp Ž ¨ . . j cluster Ž G Ž ¨ . . j cluster Ž O Ž G Ž ¨ . . . j cluster Ž Sl Ž ¨ . . y Ž cluster Ž Y Ž ¨ . . j cluster Ž O Ž Y Ž ¨ . . . . As above, cluster Ž GŽ ¨ .. j cluster Ž O Ž GŽ ¨ ... occupies a single interval. By Lemma 22, cluster Ž ypŽ ¨ .. j cluster Ž O Ž ypŽ ¨ ... is a single interval, and since the set O Ž yp Ž ¨ .. equals children Žw op Ž yp Ž ¨ .. , yp Ž ¨ .x. s
352
NARAYANAN AND NISHIMURA
childrenŽw opŽ ¨ ., ypŽ ¨ .x. s siblingsŽ ¨ ., cluster Ž ypŽ ¨ .. j cluster Ž siblingsŽ ¨ .. is a single interval. Any consecutive part of this interval forms a single interval, and therefore cluster Ž ypŽ ¨ .. j cluster Ž Sl Ž ¨ .. is a single interval. Finally by Lemma 23, the set cluster Ž Y Ž ¨ .. j cluster Ž O Ž Y Ž ¨ ... also occupies a single interval, yielding a total of three intervals for this edge.
Ž ¨ , op Ž ¨ . . : V Ž G . y Ž cluster Ž yp Ž ¨ . j cluster Ž Sl Ž ¨ . . j cluster Ž ¨ . jcluster Ž O Ž ¨ . . j cluster Ž O Ž O Ž ¨ . . . jcluster Ž G Ž ¨ . . j cluster Ž O Ž G Ž ¨ . . . . . As in the previous argument, cluster Ž ypŽ ¨ .. j cluster Ž siblingsŽ ¨ .. is a single interval and hence the set cluster Ž ypŽ ¨ .. j cluster Ž Sl Ž ¨ .. j cluster Ž ¨ . is a single interval. By Lemma 23, the set cluster Ž O Ž ¨ .. j cluster Ž O Ž O Ž ¨ ... forms a single interval, and the set cluster Ž GŽ ¨ .. j cluster Ž O Ž GŽ ¨ ... is a single interval. Case 3. opŽ ¨ . s ypŽ ypŽ ¨ .. and ypŽ ¨ . is even and nonoriginal. Since rank Ž ¨ . s rank Ž ypŽ ¨ .. q 1 and rank Ž ypŽ ¨ .. s rank Ž ypŽ ypŽ ¨ ... q 1 s rank Ž opŽ ¨ .. q 1, rank Ž ¨ . s rank Ž opŽ ¨ .. q 2, and hence ¨ is even. It is not difficult to see that ypŽ ¨ . and GŽ ¨ . are in cluster Ž g Ž ¨ .. and that ¨ g cluster Ž opŽ ¨ ... The set O Ž ¨ . is a set of odd nodes. When ypŽ ¨ . is even, the set GŽ ¨ . is a set of odd nodes.
Ž ¨ , yp Ž ¨ . . : cluster Ž yp Ž ¨ . . j cluster Ž G Ž ¨ . . y Ž cluster Ž Y Ž ¨ . . jcluster Ž O Ž Y Ž ¨ . . . . By Lemma 22, cluster Ž ypŽ ¨ .. j cluster Ž O Ž ypŽ ¨ ... forms a single interval in the labeling. It is not difficult to see that O Ž yp Ž ¨ .. s childrenŽw opŽ ypŽ ¨ .., ypŽ ¨ .x. s childrenŽw g Ž ¨ ., ypŽ ¨ .x. s GŽ ¨ .. Hence the set cluster Ž ypŽ ¨ .. j cluster Ž GŽ ¨ .. forms a single interval in the labeling, and by Lemma 23 the set cluster Ž Y Ž ¨ .. j cluster Ž O Ž Y Ž ¨ ... forms a single interval, which must be excluded. This gives a total of at most two intervals.
Ž ¨ , op Ž ¨ . . : V Ž G . y Ž cluster Ž yp Ž ¨ . . j cluster Ž ¨ . j cluster Ž O Ž ¨ . . jcluster Ž G Ž ¨ . . . We count the number of excluded intervals. By Lemma 22, since ¨ is even, the set cluster Ž ¨ . j cluster Ž O Ž ¨ .. occupies one interval, and since ypŽ ¨ . is even, the set cluster Ž ypŽ ¨ .. j cluster Ž GŽ ¨ .. occupies one interval, as argued in the previous subcase. Thus the total number of intervals on the edge Ž ¨ , opŽ ¨ .. is at most two.
INTERVAL ROUTING ON
k-TREES
353
Case 4. opŽ ¨ . s ypŽ ypŽ ¨ .. and ypŽ ¨ . is odd and nonoriginal. As argued in Case 3, O Ž ¨ . is a set of odd nodes and ¨ is even. In this case, since ypŽ ¨ . is odd, the set GŽ ¨ . is a set of even nodes.
Ž ¨ , yp Ž ¨ . . : cluster Ž yp Ž ¨ . . j cluster Ž G Ž ¨ . . j cluster Ž O Ž G Ž ¨ . . . y Ž cluster Ž Y Ž ¨ . . j cluster Ž O Ž Y Ž ¨ . . . . . By Lemma 23, the set cluster Ž GŽ ¨ .. j cluster Ž O Ž GŽ ¨ ... occupies one interval, and the set cluster Ž Y Ž ¨ .. j cluster Ž O Ž Y Ž ¨ ... occupies one interval. This gives a total of at most three intervals.
Ž ¨ , op Ž ¨ . . : V Ž G . y Ž cluster Ž yp Ž ¨ . . j cluster Ž ¨ . j cluster Ž O Ž ¨ . . jcluster Ž G Ž ¨ . . j cluster Ž O Ž G Ž ¨ . . . . . Since ¨ is even, by Lemma 22, the set cluster Ž ¨ . j cluster Ž O Ž ¨ .. occupies one interval, and the set cluster Ž GŽ ¨ .. j cluster Ž O Ž GŽ ¨ ... occupies a single interval. Thus the total number of intervals to be excluded from the cyclic interval w1 . . . < V Ž G .
Ž ¨ , x 2 . : x 2 4 j cluster Ž N Ž x 2 . . y Ž cluster Ž Y Ž ¨ . . j cluster Ž O Ž Y Ž ¨ . . . . . By Lemma 23, the set cluster Ž Y Ž ¨ .. j cluster Ž O Ž Y Ž ¨ ... forms a single interval. Since x 2 4 j cluster Ž N Ž x 2 .. is a single interval, the total number of intervals is at most two.
Ž ¨ , x 1 . : V Ž G . y Ž x 2 4 j cluster Ž N Ž x 2 . . j cluster Ž ¨ . j cluster Ž O Ž ¨ . . . . Since ¨ is an even node, by Lemma 23, the set cluster Ž ¨ . j cluster Ž O Ž ¨ .. forms a single interval in the labeling. The set x 2 4 j cluster Ž N Ž x 2 .. is also a single interval, yielding a total of at most two interval labels on the edge. The fact that the labeling described above is a valid labeling can be verified using Lemmas 20 and 6 and a straightforward examination of the labels on the edges. To complete the proof of the theorem, we demonstrate in Lemmas 24 Žfor edges Ž x i , x j .., 26 Žfor edges Ž ¨ , opŽ ¨ ..., 29 Žfor edges Ž ¨ , ypŽ ¨ .., and 10, 24, and 25 Žfor edges Ž ¨ , c .. that the labeling is optimal. LEMMA 24. For an original node x i and ¨ , a child of x i , there is a shortest path ¨ ia ¨ from x i to e¨ ery element in the set of nodes labeling the edge Ž x i , ¨ ..
354
NARAYANAN AND NISHIMURA
Proof. Since N Ž x 2 . l childrenŽ x 1 . s B, the result follows from Lemma 11 and Lemma 10 for the node x 1. Since N Ž x 1 . l childrenŽ x 2 . s C Ž x 1 , 2., we can conclude that cluster Ž N Ž x 1 .. y cluster Ž C Ž x 1 , 2. j C Ž x 1 , 3.. : cluster Ž N Ž x 1 .. y cluster Ž childrenŽ x 2 ... Thus the optimality of the label on the edge Ž x 2 , x 1 . is a consequence of Lemma 11, and that of the edges Ž x 2 ,c . where c f C Ž x 1 , 2. is a consequence of Lemma 10. Finally, we consider the label on Ž x 2 , c . where c g C Ž x 1 , 2. is a child of x 2 . For u g cluster Ž c ., the existence of a shortest path from x 2 to u via c follows from Lemma 10. Suppose instead that u g cluster Ž a. for some a g O Ž c .. Since AC Ž a. s w x 1 , c x, using Lemmas 2 and 3 and the fact that u is equidistant from x 1 and c, we can conclude that there is a shortest path via c from x 2 to u. LEMMA 25. For a nonoriginal node ¨ and c g Y Ž ¨ . j O Ž ¨ ., there is a shortest path ¨ ia c from ¨ to any node in cluster Ž O Ž c ... Proof. Suppose u g cluster Ž a. for some a g O Ž c ., and thus either AC Ž a. s w opŽ ¨ ., c x Žif c g O Ž ¨ .. or AC Ž a. s w ypŽ ¨ ., c x Žif c g Y Ž ¨ ... By Lemma 2 AC Ž a. is a u-¨ separator, and by Lemma 3 we can conclude that dist Ž ¨ , u. s min dist Ž ¨ , b . q dist Ž b, u. N b g AC Ž a.4 . Since u g cluster Ž a., u is equidistant from both nodes in AC Ž a.; since dist Ž ¨ , c . s 1 Žand ¨ f AC Ž a. implies that dist Ž ¨ , b . ) 0 for any b g AC Ž a.. there is a shortest path via c from ¨ to u. LEMMA 26. For any nonoriginal node ¨ , there is a shortest path ¨ ia opŽ ¨ . from ¨ to e¨ ery element in the set of nodes labeling the edge Ž ¨ , opŽ ¨ ... Proof. We consider separately the cases in which ¨ g C Ž x 1 , 2. and ¨ f C Ž x 1 , 2.. If ¨ g C Ž x 1 , 2., we let X denote the set of nodes excluded from the label on the edge Ž ¨ , x 1 ., or X s x 2 4 j cluster Ž N Ž x 2 .. j cluster Ž ¨ . j cluster Ž O Ž ¨ ... Since Y Ž ¨ . : N Ž x 2 . and by Lemma 20, cluster Ž childrenŽ ¨ .. s Ž cluster Ž ¨ . y ¨ 4. j cluster Ž Y Ž ¨ .. j cluster Ž O Ž ¨ .., it follows that X s x 2 4 j cluster Ž N Ž x 2 .. j ¨ 4 j cluster Ž childrenŽ ¨ ... This, in turn, is the same as the set x 2 4 j cluster Ž cousŽ ¨ , x 2 .. j ¨ 4 j cluster Ž childrenŽ ¨ .., which is the set excluded from this edge according to the labeling in Section 4. Thus it follows from Lemmas 13]15 that there is a shortest path from ¨ to every node in the label of the edge Ž ¨ , x 1 .. If instead ¨ f C Ž x 1 , 2., a straightforward examination of each case shows that X s cluster Ž yp Ž ¨ .. j cluster Ž ¨ . j cluster Ž O Ž ¨ .. j cluster Ž GŽ ¨ .. is a subset of the nodes excluded from the label on the edge Ž ¨ , opŽ ¨ ... From the proof of Lemma 21, since cluster Ž ypŽ ¨ .. s ypŽ ¨ .4 j cluster Ž cousŽ ¨ , ypŽ ¨ ... y cluster Ž GŽ ¨ .., we know that X s yp Ž ¨ . 4 j cluster Ž cous Ž ¨ , yp Ž ¨ . . . j cluster Ž ¨ . j cluster Ž O Ž ¨ . . .
INTERVAL ROUTING ON
k-TREES
355
As a consequence of Lemma 20, cluster Ž ¨ . j cluster Ž O Ž ¨ .. j cluster Ž Y Ž ¨ .. s ¨ 4 j cluster Ž childrenŽ ¨ ... Since Y Ž ¨ . : cousŽ ¨ , ypŽ ¨ .., we can then conclude that X s yp Ž ¨ . 4 j cluster Ž cous Ž ¨ , yp Ž ¨ . . . j ¨ 4 j cluster Ž children Ž ¨ . . . As before, by Lemmas 13 and 14, there is a shortest path via opŽ ¨ . from ¨ to any node in V Ž G . y X, and therefore to any node labeling an edge Ž ¨ , opŽ ¨ ... LEMMA 27. For a nonoriginal node ¨ , there is a shortest path ¨ ia ypŽ ¨ . from ¨ to any node in cluster Ž Sl Ž ¨ ... Proof. For u, an element of cluster Ž a. for some sibling a of ¨ , by Lemma 2, AC Ž ¨ . is a u-¨ separator. Since u g cluster Ž a., it is equidistant from both nodes in AC Ž a. s AC Ž ¨ ., and by Lemma 3, there is a shortest path from ¨ to u via ypŽ ¨ .. LEMMA 28. For ¨ , a node such that ypŽ ¨ . is nonoriginal, there is a shortest path ¨ ia ypŽ ¨ . from ¨ to any node in cluster Ž O Ž GŽ ¨ ... Proof. Suppose u g cluster Ž c . for some node c g O Ž GŽ ¨ .., and hence AC Ž c . s w g Ž ¨ ., ax where a g GŽ ¨ .. By Lemma 2 AC Ž c . is a u-¨ separator, and by Lemma 3 we can conclude that dist Ž ¨ , u. s min dist Ž ¨ , b . q dist Ž b, u. N b g AC Ž c .4 . Since there are shortest paths from ¨ to both nodes in AC Ž c . via ypŽ ¨ ., there is a shortest path from ¨ to u via ypŽ ¨ .. LEMMA 29. For any nonoriginal node ¨ , there is a shortest path ¨ ia ypŽ ¨ . from ¨ to e¨ ery element in the set of nodes labeling the edge Ž ¨ , ypŽ ¨ ... Proof. We first consider the case in which ¨ g C Ž x 1 , 2.. It is not difficult to verify that childrenŽ ¨ . l N Ž x 2 . s Y Ž ¨ ., and hence cluster Ž N Ž x 2 .. y Ž cluster Ž Y Ž ¨ .. j cluster Ž O Ž Y Ž ¨ .... : cluster Ž N Ž x 2 .. y cluster Ž Y Ž ¨ .. s cluster Ž N Ž x 2 .. y cluster Ž childrenŽ ¨ ... By Lemma 9, cluster Ž N Ž x 2 .. : cluster Ž cousŽ ¨ , x 2 .., and thus the set of nodes labeling the edge Ž ¨ , x 2 . is a subset of the set x 2 4 j cluster Ž cousŽ ¨ , x 2 .. y cluster Ž childrenŽ ¨ ..; by Lemmas 12 and 13, there is a shortest path from ¨ via x 2 to every node in the label of the edge Ž ¨ , x 2 .. We now suppose instead that ¨ f C Ž x 1 , 2., that is, ypŽ ¨ . is nonoriginal. A straightforward examination shows that for any such node ¨ , the set of nodes labeling the edge Ž ¨ , ypŽ ¨ .. is a subset of the set X s cluster Ž yp Ž ¨ . . j cluster Ž G Ž ¨ . . j cluster Ž O Ž G Ž ¨ . . . jcluster Ž S l Ž ¨ . . y cluster Ž Y Ž ¨ . . .
356
NARAYANAN AND NISHIMURA
From the proof of Lemma 21, we know that cluster Ž ypŽ ¨ .. s ypŽ ¨ .4 j cluster Ž cousŽ ¨ , ypŽ ¨ ... y cluster Ž GŽ ¨ ... Hence X s Ž yp Ž ¨ . 4 j cluster Ž cous Ž ¨ , yp Ž ¨ . . . y cluster Ž G Ž ¨ . . . jcluster Ž G Ž ¨ . . j cluster Ž O Ž G Ž ¨ . . . jcluster Ž Sl Ž ¨ . . y cluster Ž Y Ž ¨ . . , or, more simply, X s yp Ž ¨ . 4 j cluster Ž cous Ž ¨ , yp Ž ¨ . . j cluster Ž O Ž G Ž ¨ . . . jcluster Ž Sl Ž ¨ . . y cluster Ž Y Ž ¨ . . . It is not difficult to see that childrenŽ ¨ . l cousŽ ¨ , ypŽ ¨ .. s Y Ž ¨ .. By extension to clusters, cluster Ž cousŽ ¨ , ypŽ ¨ ... y cluster Ž childrenŽ ¨ .. s cluster Ž cousŽ ¨ , ypŽ ¨ ... y cluster Ž Y Ž ¨ ... Since cluster Ž childrenŽ ¨ .. l Ž X y cluster Ž cousŽ ¨ , ypŽ ¨ .... s B, X s yp Ž ¨ . 4 j cluster Ž cous Ž ¨ , yp Ž ¨ . . j cluster Ž O Ž G Ž ¨ . . . jcluster Ž Sl Ž ¨ . . y cluster Ž children Ž ¨ . . . The lemma is now a consequence of the fact that by Lemmas 12, 13, 27, and 28, there is a shortest path from ¨ via ypŽ ¨ . to any node in X. Figure 5 illustrates a 3-labeling of the 2-tree considered in Fig. 4. It is not difficult to see that C Ž x 1 , 2. s c, a4 , C Ž x 1 , 3. s b, j4 , C Ž x 1 , 4. s i4 , and C Ž x 2 , 2. s d, k 4 . We choose c $ a, which implies that b $ j and d $ k. The vertex labels are thus defined to have the following order: x 1 , cluster Ž c, a, b, j 4 . , cluster Ž i 4 . , x 2 , cluster Ž d, k 4 . . Moreover, because of the membership in the O sets, as indicated in Table 2, we obtain a final ordering of x 1 , cluster Ž c . , cluster Ž O Ž c . . , cluster Ž a . , cluster Ž O Ž a . . , cluster Ž i . , x 2 , d, k, or x 1 , c, f , h, g , b, e, a, j, i , x 2 , d, k. In contrast to the earlier labeling, here we have a total of three intervals labeling the edge Ž b, x 1 ., or w8..9xw11xw13..1x, determined as follows: V Ž G . y Ž cluster Ž yp Ž ¨ . . j cluster Ž S l Ž ¨ . . j cluster Ž ¨ . j cluster Ž O Ž ¨ . . jcluster Ž O Ž O Ž ¨ . . . j cluster Ž G Ž ¨ . . j cluster Ž O Ž G Ž ¨ . . . .
INTERVAL ROUTING ON
k-TREES
357
FIG. 5. A 3-labeling of a 2-tree.
which can be determined to be V Ž G . y Ž cluster Ž c . j B j cluster Ž b . j cluster Ž i . jB j cluster Ž d . j B . or V Ž G . y Ž c, f , g , h4 j b, e 4 j i 4 j d 4 . . TABLE 2 Derivation of Labels for Fig. 5 ¨
x1 x2 a b c d e f g h i j k
cluster Ž ¨ .
a4 b, e4 c, f, g, h4 d4 e4 f4 g4 h4 i4 j4 k4
OŽ ¨ .
j4 i4 b4 B B B B g4 B B B
Y Ž¨ .
k4 f4 d4 B B e4 B B B B B
GŽ ¨ .
LŽ ¨ .
} d4 } b4 B i4 B B f4 k4 j4
1 11 8 6 2 12 7 3 5 4 10 9 13
358
NARAYANAN AND NISHIMURA
8. COUNTEREXAMPLE FOR 2-LABELINGS FOR 2-TREES In this section we demonstrate a 2-tree T that cannot be optimally 2-labeled. The graph T consists of nodes x, y and a i , bi , c i , d i , and e i for 1 F i F 15, where for each i there are edges Ž x, y ., Ž x, c i ., Ž y, c i ., Ž x, bi ., Ž c, bi ., Ž x, a i ., Ž bi , a i ., Ž c, d i ., Ž y, d i ., Ž d i , e i ., and Ž y, e i .. It is not difficult to verify that T is a 2-tree. One component of T is illustrated in Fig. 6. In the following, we define the endpoint of a subinterval to be either the leftmost Žsmallest. or the rightmost Žlargest. element in the subinterval. We use the functions l and r to specify the left and right endpoints of a given subinterval. Let n s < V ŽT .<, A s a i N 1 F i F 154 and let B, C, D, E be defined analogously. Furthermore, let X s x 4 j A j B and Y s y4 j D j E. Clearly, X j Y j C s V ŽT .. LEMMA 30. In any optimal 2-labeling of T, there exists a subinter¨ al I X of w1 . . . n x such that the ¨ ertices in X all ha¨ e labels in I X and none of the ¨ ertices in Y ha¨ e labels in I X , and a subinter¨ al I Y of w1 . . . n x such that the ¨ ertices in Y all ha¨ e labels in I Y and none of the ¨ ertices in X ha¨ e labels in IY . Proof. We prove the existence of I X by contradiction; the proof of the existence of I Y is analogous and hence is omitted. We suppose there is no such I X , and consider the minimum number of disjoint subintervals S s S1 , . . . Sl 4 , l G 2, such that no Si contains any labels in Y and the union of the subintervals contains all of the labels of vertices in X. For each i Ž1 F i F 15., to ensure shortest paths, the edge Ž c i , x . must have labels containing X y a i , bi 4 , but none of the labels of vertices in Y,
FIG. 6. The ith component of T.
INTERVAL ROUTING ON
k-TREES
359
where inclusion of a i is optional. It is not difficult to verify that the number of intervals required to label the edge Ž c i , x . will be as given below: l y 2 if there exist i1 and i 2 such that S i1 s a i 4 and Si 2 s bi 4 Žeach of a i and bi make up a single subinterval in S . l y 1 if one of the following situations occurs: there exists i1 such that Si1 s a i , bi 4 ; there exist i1 and i 2 such that Si1 s a i 4 and bi is one of the endpoints of Si 2 ; or there exists i1 such that S i1 s bi 4 l if there exist i1 and i 2 such that a i is an endpoint of Si1 and bi is an endpoint of Si 2 , or a i and bi are adjacent in Si1 and one of a i or bi is an endpoint. If l G 5, then Ž c i , x . will be labeled by at least l y 2 G 3 intervals, contradicting the assumption that t is a 2-labeling. If l F 4, then to have a total of two intervals, each a i and bi must either be an endpoint or in its own subinterval, for a total of at least u15r2v ) 4 G l subintervals, yielding a contradiction and completing the proof. In what follows, we will consider I X Žand I Y . to be minimal; this implies that the endpoints are labels of elements of A j B, that is, a label of a vertex in C cannot be at an end of I X . Since we are concerned with cyclic intervals, without loss of generality, we can assume that I X contains the label 1, and consequently that the smallest label in I Y is larger than the largest label in I X . Let ID i be the maximum subinterval of I Y containing d i but no vertices in C, and IB i be the maximum subinterval of I X containing bi but no vertices in C. Finally, note that since the labeling scheme is not necessarily strict, t Ž bi . can be on the label of any edge emanating from bi . When we say that t Ž bi . is in¨ isible, two numbers are considered to be consecutive when either no label or only t Ž bi . lies between them. LEMMA 31. In any optimal 2-labeling t of T, there are at least fi¨ e ¨ alues of i such that a i and c i ha¨ e consecuti¨ e labels Ž where t Ž bi . is in¨ isible ., or at least fi¨ e ¨ alues of i such that c i and e i ha¨ e consecuti¨ e labels Ž where t Ž d i . is in¨ isible.. Proof. For any vertex bi , the edge Ž bi , x . must be labeled with X j C y a i , c i , d i 4 , and possibly part of Y y d i 4 . For the label of Ž bi , x . to contain at most two disjoint intervals, one of the following cases must hold: Case 1. t Ž a i . s l Ž I X . s 1 and r Ž ID i . s n Žt Ž bi , x . is labeled with w2 . . . Ž t c i . y 1x and wt Ž c i . q 1 . . . l Ž ID i . y 1x.. Case 2. t Ž a i . s r Ž I X . s l Ž ID i . y 1 Žt Ž bi , x . is labeled with w r Ž ID i . q 1 . . . t Ž c i . y 1x and wt Ž c i . q 1 . . . t Ž a i . y 1x..
360
NARAYANAN AND NISHIMURA
Case 3. t Ž c i . s l Ž ID i . y 1 Žt Ž bi , x . is labeled with w r Ž ID i . q 1 . . . t Ž a i . y 1x and wt Ž a i . q 1 . . . t Ž c i . y 1x.. Case 4. t Ž c i . s r Ž ID i . q 1 Žt Ž bi , x . is labeled with wt Ž c i . q 1 . . . t Ž a i . y 1x and wt Ž a i . q 1 . . . l Ž ID i . y 1x.. Case 5. t Ž c i . s t Ž a i . " 1. We can apply the same argument with respect to the edges Ž d i , y ., which must be labeled with Y j C y e i , c i , d i 4 . We complete the proof of the lemma with a proof by contradiction. Suppose instead that there are at most four values of i such that a i and c i have consecutive labels, and at most four values of i such that c i and d i have consecutive labels. There are thus at most four values of i satisfying Case 5 for Ž bi , x . and at most four values satisfying Case 5 for Ž d i , y ., for a total of eight values of i. Of the remaining seven values of i, at most one can satisfy Case 1 for Ž bi , x . Žsince there is a unique vertex labeled 1., at most one can satisfy Case 1 for Ž d i , y . Žsince there is a unique vertex labeled n., at most one can satisfy Case 2 for Ž bi , x . Žsince there is a unique vertex at position r Ž I X .., and at most one can satisfy Case 2 for Ž d i , y . Žsince there is a unique vertex at position l Ž I Y .., for a total of four satisfying Case 1 or 2 for Ž bi , x . or Ž d i , y .. For each of the final three values of i, both Ž bi , x . and Ž d i , y . must satisfy either Case 3 or Case 4. For this to occur, c i must be adjacent to both ID i and IB i , so that c i is the unique node between r Ž I X . and l Ž I Y . or the unique node between r Ž I Y . and l Ž I X .. Since there can be at most two such c i ’s, we obtain a contradiction. LEMMA 32. If in an optimal labeling t there are fi¨ e different ¨ alues of i such that a i and c i ha¨ e consecuti¨ e labels Ž where t Ž bi . is in¨ isible., or if there are fi¨ e different ¨ alues of i such that e i and c i ha¨ e consecuti¨ e labels Ž where t Ž d i . is in¨ isible., then t is not a 2-labeling. Proof. The edge Ž y, x . must be labeled with x j A y C. Since there are five a i , c i pairs that have consecutive labels, the edge Ž y, x . cannot be labeled with two subintervals. The proof for consecutive e i , c i pairs is analogous, making use of the edge Ž x, y .. Based on the three lemmas, we can conclude the following. THEOREM 3. There exists a 2-tree T such that T f 2-IRS.
INTERVAL ROUTING ON
k-TREES
361
9. CONCLUSIONS AND OPEN QUESTIONS In this paper we have shown that any 2-tree has a 3-labeling, and in fact that any k-tree has a 2 kq 1-labeling, but that there exists a 2-tree that does not have a 2-labeling. We would like to determine a precise function f Ž k . such that every k-tree has an f Ž k .-labeling but no f Ž k . y 1-labeling. A first step might be to determine the tightness of the 2 kq 1-labeling bound, perhaps by use of experimental results for particular values of k. The existence of a partial 2-tree of size n, for any n, that cannot be labeled with fewer than ? n1r3 @ y 2 intervals w9x, indicates that our results on 2-trees cannot be generalized to partial 2-trees. It remains to be determined for which graphs of treewidth two our results hold, and in particular which characteristics of those graphs are being exploited. Our counterexample for a 2-labeling has two nodes of high degree; we would like to be able to determine general relations among treewidth, degree, and the number of intervals needed in any optimal multilabel scheme. Finally, we would like to consider the assumption of dynamic cost links. A graph that has an optimal l-labeling under the distance metric may not be optimal under the assumption of dynamic cost links, since there may exist an assignment of costs to edges that makes the labeling suboptimal. It would be helpful to be able to determine the relationships, if any, between the two settings.
A. PROOF OF LEMMA 14 LEMMA 14. For a low node ¨ with AC Ž ¨ . s w p1 , p 2 , . . . , pk x there is a shortest path ¨ ia opŽ ¨ . from ¨ to any node u that is not a descendant of ¨ and k Ž is in V Ž G . y Ž cluster Ž childrenŽ ¨ .. j D is2 pi j cluster Ž cousŽ ¨ , pi ..... Proof. We denote the parents of ¨ by w p1 , p 2 , . . . , pk x, or the set P, and the parents of opŽ ¨ . s p1 by w g 1 , g 2 , . . . , g k x, or the set Q. If u is not a descendant of Q, then by statement 1 of Lemma 2, any shortest path from ¨ to u must go through a node in Q. Since there is a shortest path from ¨ to each node in Q via opŽ ¨ ., clearly there is a shortest path from ¨ to u via opŽ ¨ .. If, instead, u is a descendant of Q, we consider the youngest clique C such that u is a descendant of C and C l Ž P j Q . / f . The following claim establishes properties of C and C l Ž P j Q .. Claim 1. For Z s C l Ž P j Q ., if < Z < ) 1, then C s AC Ž u.; if Z s pi 4 for any i / 1, then ¨ is not a descendant of C; and if Z s g i 4 for any i / 1, then ¨ is not a descendant of C.
362
NARAYANAN AND NISHIMURA
Proof. To prove the first part of the claim, suppose instead that < Z < ) 1 and C / AC Ž u.. Since u is a descendant of C, there exists an ancestor w of u such that C s AC Ž w . and an element z in C such that u is a descendant of the clique C9 s Ž w4 j C . y z 4 . Since < Z < ) 1, C9 is a clique younger than C such that u is a descendant of C9 and C9 l Ž P j Q . / B, contradicting the minimality of C. To prove the second part of the lemma, suppose instead that Z is pi 4 for some i / 1 and that ¨ is a descendant of C. Since opŽ ¨ . is a parent of ¨ and opŽ ¨ . f C, opŽ ¨ . and ¨ are in the same component of the graph induced on V Ž G . y C. Consequently, opŽ ¨ . must be a descendant of C, with rank greater than that of any node in C. In particular, rank Ž p1 . ) rank Ž pi ., a contradiction. Finally, suppose instead that Z is g i 4 for some i / 1 and that ¨ is a descendant of C. Using the same argument as in the previous paragraph, g 1 , opŽ ¨ ., and ¨ must all be in the same component of the graph induced by GŽ V . y C. Consequently, g 1 must be a descendant of C, with rank greater than that of any node in C, or rank Ž g 1 . ) rank Ž g i ., a contradiction. In the remainder of the proof, we can assume that u is a descendant of Q. If suffices to consider the following two cases. Case 1. u is an ancestor of ¨ . Since the proof of the lemma is trivial if u s opŽ ¨ . and the statement of the lemma excludes the possibility of u being any other node in P, we can assume that u f P. Moreover, since u is an ancestor of ¨ and a descendant of Q, u must be either a parent of a node in P or a child of a node in Q Žor both.. Case 1a. u is a parent of a node in P. By Lemma 1, opŽ ¨ . is also a parent of any other node in P. Since two parents of a node must share a clique, there must be an edge between u and opŽ ¨ .. There is thus a path of length 2 from u to ¨ via opŽ ¨ ., and since u is an ancestor of ¨ , which is not in P, clearly there is no edge from u to ¨ . This completes the proof for this case. Case 1b. u is a child of a node in Q. Since u is an ancestor of ¨ , the shortest path from u to ¨ must pass through a node in P. Since u f P, there is no path of length 1. A path of length 2 would pass through a parent pj : since opŽ ¨ . and u would both be parents of pj , there would be an edge between opŽ ¨ . and u, hence a shortest path via opŽ ¨ .. If there is no path of length 2, then there is a shortest path of length 3 from ¨ to opŽ ¨ . to a node in Q to u. In either case, there is a shortest path via opŽ ¨ ., as claimed.
INTERVAL ROUTING ON
k-TREES
363
Case 2. u is not an ancestor of ¨ . We now consider the members of the set C l Ž P j Q . and show that in each case below there is a shortest path from ¨ to u via opŽ ¨ .. < C l Ž P j Q .< ) 1: By Claim 1 C s AC Ž u., and since ¨ is not a descendant of u, it follows from Lemmas 2 and 3 that dist Ž ¨ , u. s min dist Ž ¨ , b . q dist Ž b, u. N b g C 4 . It is straightforward to see that one of the following cases must hold: If opŽ ¨ . g C, then clearly there is a path of length two from ¨ to u, a shortest path. If opŽ ¨ . f C and C l P / f , we let p be the element of minimum rank in C l P. By definition, u g cousŽ ¨ , p ., violating the definition of u in the statement of the lemma. If opŽ ¨ . f C and C l P s f , every path from ¨ to u has to go through at least one element of P and at least one element of C, forming a path of length at least three. Since there is a path of length three from ¨ to u via opŽ ¨ ., this must be a shortest path. C l Ž P j Q . s opŽ ¨ .4 : In addition to opŽ ¨ ., C can only contain children of opŽ ¨ .. If AC Ž u. s C, then there is a path of length 2 from ¨ to u via opŽ ¨ ., a shortest path. If AC Ž u. / C, then since C was chosen to be the youngest possible, there is a node w f P such that C s AC Ž w . and u is a descendant of the clique D s C y opŽ ¨ .4 j w4 . It is not difficult to see that no element of D is a child or a parent of ¨ . Thus dist Ž ¨ , d . ) 1 for any d g D. Furthermore, since ¨ is not a descendant of D, by Lemmas 2 and 3, D is a u-¨ separator. Since opŽ ¨ . is connected to every node in D, there is a path of length 2 from ¨ to every node in D via opŽ ¨ . and thus a shortest path from ¨ to u via opŽ ¨ .. C l Ž P j Q . s pi 4 for some i / 1: By Claim 1 and Lemmas 2 and 3, dist Ž ¨ , u. s min dist Ž ¨ , b . q dist Ž b, u. N b g C 4 . Furthermore, by Lemma 1, C must consist entirely of pi and parents and children of pi . We let d m be the element of minimum rank in C such that dist Ž u, d m . F dist Ž u, d . for any d g C; by Lemma 7 u g cluster Ž d m . for d m nonoriginal and u g cluster Ž N Ž d m .. for d m original. We consider the possible cases: If d m s pi , then u g cluster Ž pi . : cluster Ž cousŽ ¨ , pi .. by Lemma 9, contradicting the definition of u in the statement of the lemma. If d m is a child of pi , we let pj be the element of minimum rank in AC Ž d m . l P. If p j / op Ž ¨ ., d m g cous Ž ¨ , p j . and hence u g cluster Ž cousŽ ¨ , pj .., a contradiction. If pj s opŽ ¨ ., then there is a path of length 2 from d m to ¨ via opŽ ¨ ., but clearly there is no edge. It is not difficult to see that dist Ž ¨ , u. s dist Ž ¨ , d m . q dist Ž d m , u., as there is no
364
NARAYANAN AND NISHIMURA
other element of C closer to both u and ¨ , and hence there is a shortest path from u to ¨ via opŽ ¨ .. If d m is a parent of pi , then dist Ž ¨ , d m . ) 1. Since opŽ ¨ . is also a parent of pi , there must be an edge between opŽ ¨ . and d m , and hence a path of length 2 from ¨ to d m via opŽ ¨ . and a shortest path from ¨ to u via opŽ ¨ .. C l Ž P j Q . s g i 4 for some i / 1: By Claim 1 and Lemmas 2 and 3, dist Ž ¨ , u. s min dist Ž ¨ , b . q dist Ž b, u. N b g C 4 , and by Lemma 1, the other elements of C must be parents and children of g i . We let d m be the element of minimum rank in C such that dist Ž u, d m . F dist Ž u, d . for any d g C; by Lemma 7 u g cluster Ž d m . for d m nonoriginal and u g cluster Ž N Ž d m .. otherwise. Clearly, dist Ž ¨ , g i . s 2 and 2 F dist Ž ¨ , d . F 3 for all d g C. We consider the possible cases: If d m s g i , then since dist Ž u, g i . F dist Ž u, d . for d g C, g i is on a shortest path from u to ¨ . Since opŽ ¨ . is on a shortest path from ¨ to g i , opŽ ¨ . is on a shortest path from u to ¨ . If d m is a child of g i , then we consider the set E of edges between d m and elements of P. If E s B, then dist Ž ¨ , d m . s 3 and there is a shortest path via opŽ ¨ . from ¨ to d m and hence from ¨ to u. If Ž d m , opŽ ¨ .. g E, then dist Ž ¨ , d m . s 2, so that dist Ž ¨ , u. s dist Ž ¨ , d m . q dist Ž d m , u., with a path via opŽ ¨ .. If Ž d m , opŽ ¨ .. f E and Ž d m , pj . g E for j / 1 and d m a parent of pj , then since opŽ ¨ . and d m are both parents of pj , Ž d m , opŽ ¨ .. g E, a contradiction. If Ž d m , opŽ ¨ .. f E and Ž d m , pj . g E for j / 1 and d m a child of pj , without loss of generality we let pj be the node of P of minimum rank that is a parent of d m . Then d m g cousŽ ¨ , pj . and u g cluster Ž cousŽ ¨ , pj .., violating the definition of u in the statement of the lemma. If d m is a parent of g i , then there is a shortest path from ¨ to d m via opŽ ¨ . Žif d m is a parent of any pj , there is an edge Ž opŽ ¨ ., d m .., as well as a shortest path from ¨ to g i via opŽ ¨ .. Since ¨ is closest to g i and u to d m among the nodes in C and there is an edge between d m and g i , either d m or g i will be on a shortest path from u and ¨ , and hence opŽ ¨ .. C l Ž P j Q . s g 14 : If AC Ž u. s C, then there is a path of length 3 from ¨ to u via opŽ ¨ . and g 1 and no path of length 2, since AC Ž u. does not contain any parent of ¨ . If, instead, AC Ž u. / C, then since C was chosen to be the youngest possible, there is a node w f P such that C s AC Ž w . and u is a descendant of the clique D s C y g 14 j w4 . Since ¨ is not a descendant of D, by Lemmas 2 and 3, dist Ž ¨ , u. s min dist Ž ¨ , b . q dist Ž b, u. N b g D4 . We let d m be the element of mini-
INTERVAL ROUTING ON
k-TREES
365
mum rank in D such that dist Ž u, d m . F dist Ž u, d . for any d g D; by Lemma 7, u g cluster Ž d m . for d m nonoriginal and u g cluster Ž N Ž d m .. otherwise. Clearly, 2 F dist Ž ¨ , d . F 3 for all d g D. We consider the possible cases: If d m is a child of g 1 , then the existence of a shortest path from ¨ to u via opŽ ¨ . can be proved by an analysis identical to the case when C l Ž P j Q . s g i 4 for i / 1 and d m a child of g i . If d m is a parent of g 1 , then dist Ž ¨ , d m . s 3, there is a path of length 3 from ¨ to d m via opŽ ¨ ., and hence a shortest path from ¨ to u via opŽ ¨ ..
B. PROOF OF LEMMA 15 LEMMA 15. For any nonoriginal high node w with OP Ž w . s w x i1, . . . , x i l x for some l ) 0 and NP Ž w . s w p1 , . . . , pkyl x, there is a shortest path from w ¨ ia opŽ w . s x i1 to any nonoriginal node u that is not a descendant of w, such ky l Ž that u g V Ž G . y ŽD is pi 4 j cluster Ž cous Ž w, pi ... j D ljs 2 Ž x i j 4 j 1 cluster Ž cousŽ w, x i j ..... Proof. The proof is similar in structure to that of Lemma 14. We let O be the set of k original nodes and let D be the youngest clique, such that u is a descendant of D and D l Ž O j NP Ž w .. / B. Claim 2 establishes properties of D l Ž O j NP Ž w ... Claim 2. For Z s D l Ž Q j NP Ž w .., if < Z < ) 1, then D s AC Ž u., and if < Z < s 1 and < Z < / opŽ w .4 , then w is not a descendant of D. Proof. To prove the first part of the claim, suppose instead that < Z < ) 1 and D / AC Ž u.. Since u is a descendant of D, there exists an ancestor ¨ of u such that D s AC Ž ¨ .. There exists an element z g Z such that u is a descendant of the clique D9 s Ž ¨ 4 j D . y z 4 . Since < Z < ) 1, D9 is a clique younger than D such that u is a descendant of D9 and D9 l Ž O j NP Ž w .. / B, contradicting the minimality of D. The second part of the claim follows from the fact that since opŽ w . g AC Ž w . is an original node, any clique older than AC Ž w . must also contain opŽ w .. We now consider the possible contents of D l Ž O j NP Ž w .. and demonstrate in each case that there is a shortest path from w to u via opŽ w .. In many of the cases we consider the node d m , the element of minimum rank in D such that dist Ž u, d m . F dist Ž u, d . for any d g D; by Lemma 7, u g cluster Ž d m . for a nonoriginal node d m and u g cluster Ž N Ž d m .. for an original node d m . Since d m can be any element in D, we will consider all of the cases: when we have identified one element z of
366
NARAYANAN AND NISHIMURA
D, we then know by Lemma 1 that it suffices to consider z, parents of z, and children of z. < D l Ž O j NP Ž w ..< ) 1: By Claim 2, D s AC Ž u., and it follows from Lemmas 2 and 3 that dist Ž w, u. s min dist Ž w, b . q dist Ž b, u. N b g D4 . One of the following cases must hold: If opŽ w . g D, then clearly there is a path of length 2 from w to u, a shortest path. If opŽ w . f D and D l AC Ž w . / f , we let p be the element of minimum rank in D l AC Ž w .. By definition, u g cousŽ w, p ., violating the definition of u in the statement of the lemma. If opŽ w . f D and D l AC Ž w . s f , every path from w to u has to go through at least one element of AC Ž w . and at least one element of D, forming a path of length at least 3. Since there is a path of length 3 from w to u via opŽ w ., this must be a shortest path. D l Ž O j NP Ž w .. s z 4 , for z g AC Ž w . y opŽ w .4 : It follows from Claim 2 and Lemmas 2 and 3 that dist Ž w, u. s min dist Ž w, b . q dist Ž b, u. N b g D4 . Note that if z is original, then since no other original node can be in D in this case, d m can be either z or a child of z. If d m s z, then u g cluster Ž z . if z is nonoriginal and u g cluster Ž N Ž z .. if u is original. In either case, by Lemma 9, u g cluster Ž cousŽ w, z .., contradicting the definition of u n the statement of the lemma. If d m is a child of z, we let p be the element of minimum rank in AC Ž d m . l AC Ž w .. If p / opŽ w ., then d m and hence u is in the cluster of a cousin, a contradiction. If p s opŽ w ., then there is a path of length 2 from d m to w via opŽ w ., but clearly there is no edge. It is not difficult to see that dist Ž w, u. s dist Ž w, d m . q dist Ž d m , u., as there is no other element of D closer to both u and w, and hence there is a shortest path from w to u via opŽ w .. If d m is a parent of z and z is nonoriginal, then dist Ž w, d m . ) 1. Since opŽ w . is also a parent of z, there must be an edge between opŽ w . and d m , a path of length 2 from w to d m via opŽ w ., and hence a shortest path from w to u via opŽ w .. D l Ž O j NP Ž w .. s x j 4 , for x j f OP Ž w .: It follows from Claim 2 and Lemmas 2 and 3 that dist Ž w, u. s min dist Ž w, b . q dist Ž b, u. N b g D4 . Clearly, dist Ž w, x j . s 2 and 2 F dist Ž w, b . F 3 for all b g D. Since x j is the only original node in D, d m can be either x j itself or a child of x j . If d m s x j , then since dist Ž w, x j . F dist Ž w, b . for b g D, x j is on a shortest path from w to u. Since opŽ w . is on a shortest path from w to x j , opŽ w . is on a shortest path from w to u.
INTERVAL ROUTING ON
k-TREES
367
If d m is a child of x j , then we consider the set E of edges between d m and elements of AC Ž w .. If E s B, then dist Ž w, d m . s 3 and there is a shortest path via Ž . op w from w to d m and hence from w to u. If Ž d m , opŽ w .. g E, then dist Ž w, d m . s 2, so that dist Ž w, u. s dist Ž w, d m . q dist Ž d m , u., with a path via opŽ w .. If Ž d m , opŽ w .. f E and Ž d m , p . g E for p / opŽ w . and d m a parent of p, then since opŽ w . and d m are both parents of p, Ž d m , opŽ w .. g E, a contradiction. If Ž d m , opŽ w .. f E and Ž d m , p . g E for p / opŽ w . and d m is a child of p, without loss of generality we let p be the node of AC Ž w . of minimum rank that is a parent of d m . Then d m g cousŽ w, p . and u g cluster Ž cousŽ w, p .., violating the definition of u in the statement of the lemma. D l Ž O j NP Ž w .. s opŽ w .4 : In addition to opŽ w ., D can contain only children of opŽ w .. If AC Ž u. s D, then there is a path of length 2 from w to u via opŽ w ., a shortest path. If AC Ž u. / D, then since D was chosen to be as young as possible, there must be a node s f O j NP Ž w . such that AC Ž s . s D and u is a descendant of E s D j s4 y opŽ w .4 . Clearly, w is not a descendant of E, and by Lemmas 2 and 3 it follows that dist Ž w, u. s min dist Ž w, b . q dist Ž b, u. N b g E4 . Since every node in E is a child of opŽ w ., there is a path of length 2 from w to any node in E via opŽ w . and no path of length 1. Thus there is a shortest path from w to u via opŽ w ..
C. INTERVAL LABELING ALGORITHM In this section we briefly discuss a quadratic-time algorithm for labeling a k-tree using the scheme presented in Section 4. Given that the labeling of a particular graph is a one-time operation and that the primary motivation for designing interval labeling schemes is the efficiency of the subsequent routing, the efficiency of the labeling algorithm is not an important consideration. The algorithm discussed in this appendix is thus presented at a high level, with the intention of covering the main ideas and ignoring fine-tuning. To efficiently label nodes and edges in an input k-tree G, we first preprocess the graph, creating a few useful data structures. A perfect elimination ordering for the graph can be determined in linear time w11x,
368
NARAYANAN AND NISHIMURA
and from this we can easily derive parent]child relations and attachment cliques for all nodes. It is not difficult to see that in time O Ž n log n. we can create a list AC of length < V Ž G .< containing a pair Žattachment clique, node. for each node in the graph, where the nodes in each attachment clique and all pairs in the list are stored in lexicographical order. In addition, we create for each node ¨ a list ccŽ ¨ . containing in lexicographical order all nodes in childrenŽ ¨ . l cluster Ž ¨ . Žor childrenŽ ¨ . l N Ž ¨ . for an original node ¨ .. All cc lists can be formed in linear time by traversing AC, inserting u in order into ccŽ ¨ . for each entry in AC with opŽ u. s ¨ . The node labeling can be accomplished using a recursive algorithm. The algorithm works through the original nodes from last to first, according to the perfect elimination ordering, for each node x assigning the next segment of available labels to x and cluster Ž N Ž x ... In general, to process a node ¨ and nodes in cluster Ž ¨ . Žor cluster Ž N Ž x .. for ¨ an original node., the algorithm traverses ccŽ ¨ . in order, processing each entry u and cluster Ž u. in turn. Along the way, we store at each node ¨ the largest label used for any node in cluster Ž ¨ .. It is straightforward to see that a constant amount of time is spent on each node, and thus the total time to construct the labeling is O Ž n.. To construct edge labels, it suffices to extract intervals occupied by vertices and their clusters, as established during the node labeling, and to identify cousins. For a parent pi / opŽ ¨ . of ¨ , it is possible to find all nodes in the set cousŽ ¨ , pi . by scanning through AC in linear time, determining at each entry whether the node in question is in the set and not a child of ¨ . As each node u g cousŽ ¨ , pi . y childrenŽ ¨ . is encountered, the interval for u4 j cluster Ž u. is included in the set of intervals being determined. Processing labels for other types of edges is similar. Since the label for each edge can be determined in linear time, the fact that a k-tree has O Ž< V Ž G .<. edges implies that the labeling can be achieved in quadratic time.
ACKNOWLEDGMENTS This research was supported by the Natural Sciences and Engineering Research Council of Canada and a Concordia University Faculty Research and Development grant.
REFERENCES 1. B. Awerbuch, A. Bar-now, N. Linial, and D. Peleg, Improved routing strategies with succinct tables, J. Algorithms 11 Ž1990., 307]341. 2. E. Bakker, J. van Leeuwen, and R. Tan, Linear interval routing, Algorithms Re¨ . 2 Ž1991., 45]61.
INTERVAL ROUTING ON
k-TREES
369
3. H. Bodlaender, J. van Leeuwen, R. Tan, and D. Thilikos, On interval routing schemes and treewidth, in ‘‘Workshop on Graph-Theoretic Concepts in Computer Science ŽWG.,’’ Lecture Notes in Computer Science, Vol. 1017, pp. 181]186, Springer-Verlag, New York, 1995. 4. P. Fraigniaud and C. Gavoille, Optimal interval routing, in ‘‘Parallel Processing, CONPAR 94]VAPP VI,’’ Lecture Notes in Computer Science, Vol. 854, pp. 785]796, Springer-Verlag, New York, 1994. 5. G. Frederickson and R. Janardan, Designing networks with compact routing tables, Algorithmica 3 Ž1988., 171]190. 6. G. Frederickson and R. Janardan, Efficient message routing in planar networks, SIAM J. Comput. 18 Ž1989., 843]857. 7. G. Frederickson and R. Janardan, Space-efficient message routing in c-decomposable networks, SIAM J. Comput. 19 Ž1990., 164]181. 8. T. Kloks, ‘‘Treewidth}Computations and Approximations,’’ Lecture Notes in Computer Science, Vol. 842, Springer-Verlag, New York, 1994. 9. E. Kranakis, D. Krizanc, and S. Ravi, On multi-label linear interval routing schemes, in ‘‘Workshop on Graph-Theoretic Concepts in Computer Science ŽWG.,’’ Lecture Notes in Computer Science, Vol. 790, pp. 338]349, Springer-Verlag, New York, 1993. 10. L. Narayanan and S. Shende, Characterizations of networks supporting shortest path interval routing schemes, in ‘‘Proceedings of the Third International Colloquium on Structural Information and Communication Complexity,’’ pp. 73]87, June 1996. 11. D. J. Rose and R. E. Tarjan, Algorithmic aspects of vertex elimination, in ‘‘Proceedings of the 7th Annual ACM Symposium on Theory of Computing,’’ pp. 317]322, 1975. 12. N. Santoro and R. Khatib, Labelling and implicit routing in networks, Comput. J. 28 Ž1985., 5]8. 13. J. van Leeuwen and R. Tan, Interval routing, Comput. J. 30 Ž1987., 298]307.