Abstract 1 Introduction 2 Preliminaries 3 Overview 4 Optimal roundtrip routing in undirected graphs 5 Extending Section 4 to directed graphs References Appendix A 𝟕-stretch directed roundtrip routing with |RT(𝒖)|=𝑶(𝒏𝟏/𝟑)

Compact Routing Schemes in Undirected and Directed Graphs

Avi Kadria ORCID Bar Ilan University, Ramat Gan, Israel Liam Roditty ORCID Bar Ilan University, Ramat Gan, Israel
Abstract

In this paper, we study the problem of compact routing schemes in weighted undirected and directed graphs.

For weighted undirected graphs, more than a decade ago, Chechik [PODC’13] presented a 3.68k-stretch compact routing scheme that uses O~(n1/klogD) local storage, where D is the normalized diameter, for every k>1. We present a 2.64k-stretch compact routing scheme that uses O~(n1/k) local storage on average in each vertex. This is the first compact routing scheme that uses total local storage of O~(n1+1/k) while achieving a ck stretch, for a constant c<3.

In real-world network protocols, messages are usually transmitted as part of a communication session between two parties. Therefore, more than two decades ago, Thorup and Zwick [SPAA’01] considered compact routing schemes that establish a communication session using a handshake. In their handshake-based compact routing scheme, the handshake is routed along a (4k5)-stretch path, and the rest of the communication session is routed along an optimal (2k1)-stretch path. It is straightforward to improve the (4k5)-stretch of the handshake to 3.68k-stretch using the compact routing scheme of Chechik [PODC’13]. We improve the handshake stretch to the optimal (2k1), by borrowing the concept of roundtrip routing from directed graphs to undirected graphs.

For weighted directed graphs, more than two decades ago, Roditty, Thorup, and Zwick [SODA’02 and TALG’08] presented a (4k+ε)-stretch compact roundtrip routing scheme that uses O~(n1/k) local storage for every k3. For k=3, this gives a (12+ε)-roundtrip stretch using O~(n1/3) local storage. We improve the stretch by developing a 7-roundtrip stretch routing scheme with O~(n1/3) local storage. In addition, we consider graphs with bounded hop diameter and present an optimal (2k1)-roundtrip stretch routing scheme that uses O~(DHOPn1/k), where DHOP is the hop diameter of the graph.

Keywords and phrases:
Routing schemes, Compact routing schemes, Distance oracles, Computer networks, Graph algorithms
Funding:
Liam Roditty: Supported in part by BSF grants 2016365 and 2020356.
Copyright and License:
[Uncaptioned image] © Avi Kadria and Liam Roditty; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Routing and network design problems
Related Version:
Full Version: https://arxiv.org/abs/2503.13753 [15]
Editor:
Dariusz R. Kowalski

1 Introduction

Routing is a fundamental task in computer networks. A routing scheme is a mechanism designed to deliver messages efficiently from a source vertex to a destination vertex within the network. In this paper, we study both undirected and directed weighted graphs, aiming to route along short paths.

More specifically, a routing scheme is composed of a preprocessing phase and a routing phase. In the preprocessing phase, the entire graph is accessible, allowing the preprocessing algorithm to compute a routing table and a label for each vertex111In this paper, we study labeled routing schemes, where the preprocessing algorithm can assign labels to the vertices. When the vertex labels are fixed and cannot be changed, the routing scheme is called an name-independent routing scheme (see, for example, [1, 16, 17, 2, 13]), which is then stored in the local storage of each vertex. In the routing phase, the routing algorithm at each vertex on the routing path can only access the local storage of the vertex. The routing algorithm gets as input a message, a destination label, and possibly a header, and decides which of the vertex neighbors is the next vertex on the routing path. The routing continues until the message reaches the destination.

A compact routing scheme is a routing scheme that uses o(n) space in the local storage on average at each vertex, where n is the number of vertices in the graph. Let u be a source vertex and let v be a destination vertex. We denote by d^(u,v) the length of the path used by the routing algorithm to route a message from u to v. The stretch of the routing scheme is defined as maxu,vV(d^(u,v)d(u,v)), where d(u,v) is the distance from u to v. The roundtrip stretch is defined as maxu,vV(d^(u,v)+d^(v,u)d(u,v)+d(v,u)).

The design of efficient compact routing schemes in undirected graphs has been a well-studied subject in the last few decades, see for example [19, 3, 4, 8, 11, 24, 22, 7]. In Table 1 we summarize the previous results.

From the Erdős girth conjecture, it follows that every routing scheme with stretch <2k+1 must use a total storage of Ω(n1+1/k) bits. The approximate distance oracle data structure of Thorup and Zwick [25], which is implemented in the centralized model, where all the information is available upon a distance query to the data structure, has an optimal (2k1)-stretch with O~(n1+1/k) total storage. In light of the gap between routing schemes and approximate distance oracles, the following problem is natural.

Problem 1.

For every k2, given a weighted undirected graph, what is the best stretch of a routing scheme that uses O~(n1+1/k) total storage?

The 3.68k-stretch compact routing scheme of Chechik [7], from more than a decade ago, is the current best stretch with O~(n1/k) worst-case local storage. In this paper, we improve the stretch to 2.64k by allowing an average local storage of O~(n1/k), as presented in the following theorem.

Theorem 1.

Let G=(V,E,w) be a weighted undirected graph. For every k3, there is an 2.64k-stretch compact routing scheme that uses local routing tables of an average size of O~(n1/k), vertex labels of size O~(k) and packet headers of size O~(k).

All the compact routing schemes mentioned so far solve the problem of sending a single message from the source to the destination, while in most real-world network applications, two parties communicate over the network for a session. A communication session is composed of two phases. In the first phase, a connection is established between the source and the destination, and in the second phase, a stream of messages is exchanged between the parties. Many real-world protocols, such as TLS, QUIC, TCP, SSH, Wi-Fi, and Bluetooth, adhere to this framework.

We consider the handshake mechanism for the establishment phase, as presented by Thorup and Zwick [24]. The handshake is composed of two messages of size O~(1), that are exchanged between the parties to establish the connection. The first message is sent from the source to the destination, and the second message is sent from the destination back to the source. Since the handshake is composed of a message sent from the source to the destination and back, the stretch of the handshake is the roundtrip stretch defined earlier.

Thorup and Zwick [24] presented a compact routing scheme that uses a handshake, in which two messages are routed along a (4k5)-stretch path, to establish a connection. Then, a stream of messages is routed along an optimal (2k1)-stretch path. While the compact routing scheme of Chechik [7] achieves an 3.68k-roundtrip stretch for the handshake, there is still a significant gap from the optimal (2k1)-stretch followed by the Erdős girth conjecture. Therefore, the main open problem for routing in a communication session is to reduce the stretch of the handshake phase and obtain a compact roundtrip routing scheme with improved stretch.

Problem 2.

For every k2, given a weighted undirected graph, what is the best roundtrip stretch of a routing scheme that uses O~(n1/k) local storage?

In this paper we solve Problem 2 by presenting an optimal (2k1)-roundtrip stretch for the handshake phase, that matches the lower bound that follows from the Erdős girth conjecture, as presented in the following theorem.

Theorem 2.

Let G=(V,E,w) be a weighted undirected graph. Let k1 be an integer. There is a (2k1)-stretch compact roundtrip routing scheme that uses local routing tables of size O~(n1/k), vertex labels of size O~(k) and packet headers of size O~(k).

Using this result with the handshake-based routing scheme of Thorup and Zwick [24], one obtains an optimal (2k1)-stretch compact routing scheme for any communication session. We summarize our new results for undirected graphs and compare them to the previous work in Table 1.

Table 1: Compact routing schemes in undirected graphs.
Stretch Local storage
Uses average
local storage?
Ref. Comments
O(k) O~(n1/k) yes [19] unweighted graphs
2k1 O~(n1/k) yes [3]
O(k2) O~(n1/k) no [4]
4k5 O~(n1/k) no [24]
3.68k O~(n1/k) no [7]
4k7+ε O~(n1/k) no [22]
2.64k O~(n1/k) yes Theorem 1
2k1 O~(n1/k) no Theorem 2 roundtrip stretch

Next, we turn our attention to weighted directed graphs. Since preserving the asymmetric reachability structure of directed graphs requires Ω(n2) space222In a bipartite graph in which all the edges are from one side to the other, there are Θ(n2) edges and removing each of them makes the destination not reachable from the source. Thus, storing reachability requires Ω(n2) space., no spanner, emulator, or compact routing scheme can exist for directed graphs. Cowen and Wagner [9] circumvented the Ω(n2) space lower bound by introducing roundtrip distances in directed graphs, defined as d(uv)=d(u,v)+d(v,u).

In the last few decades, a few compact roundtrip routing schemes were presented, see for example [9, 10, 21]. The state-of-the-art result was obtained by Roditty, Thorup, and Zwick [21]. They presented a 3-stretch compact roundtrip routing scheme that uses O~(n1/2) local storage and also a (4k+ε)-stretch compact roundtrip routing scheme that uses O~(n1/k) local storage for every k3.

From the Erdős girth conjecture, it follows that every compact roundtrip routing scheme with stretch <2k+1 must use total storage of Ω(n1+1/k) bits. Closing the gap between the upper and the lower bound is the main open problem regarding compact roundtrip routing schemes.

Problem 3.

For every k2, given a directed weighted graph, what is the best stretch of a roundtrip routing scheme that uses O~(n1/k) local storage?

In recent years, roundtrip distances have been extensively studied but only in the context of roundtrip spanners and roundtrip emulators (see, for example [14, 6, 21, 23, 5, 18]). Despite all the recent progress, no improvements were obtained for compact roundtrip routing schemes since the (4k+ε)-stretch roundtrip routing scheme of [21] from more than two decades ago.

In this paper, we improve upon [21] for the case that k=3. More specifically, using O~(n1/3) local storage, Roditty, Thorup, and Zwick [21] obtained a (12+ε)-stretch roundtrip routing scheme. We present a 7-stretch roundtrip routing scheme that uses O~(n1/3) local storage, as presented in the following theorem.

Theorem 3.

Let G=(V,E,w) be a weighted directed graph. There is a 7-stretch compact roundtrip routing scheme that uses local routing tables of size O~(n1/3), vertex labels of size O~(1) and packet headers of size O~(1).

In addition, in the following theorem, we present an optimal333Assuming the Erdős conjecture, it is easy to create a graph G with Ω(n1+1/k) edges such that the girth of G is 2k+2, and the diameter of G is at most 2k+1. Given a graph with Ω(n1+1/k) edges and 2k+2 girth, if there is a pair of vertices u,vV such that d(u,v)2k+2, we can add an edge between u and v to the graph without reducing the girth. By repeating this process until there are no pairs u,vV such that d(u,v)2k+2, we get that the diameter is at most 2k+1. , up to polylogarithmic factors, compact roundtrip routing scheme in graphs with Dhop=O~(k), where Dhop is the hop diameter of the graph.

Theorem 4.

Let G=(V,E,w) be a weighted directed graph. Let k1 be an integer. There is a (2k1)-stretch compact roundtrip routing scheme that uses local routing tables of size O~(Dhopn1/k), vertex labels of size O~(Dhopk) and packet headers of size O~(Dhop).

We summarize our new results for directed graphs and compare them to the previous work in footnote 5.

Table 2: Compact roundtrip routing results in directed weighted graphs.555poly-logarithmic factors are omitted.
Stretch local storage
Uses average
local storage?
Ref. Comments
3 O~(n1/2) yes [9]
3 O~(n2/3) no [9]
2k1 O~(n1/k) yes [10]
3 O~(n1/2) no [21]
4k+ε O~(1εn1/k) no [21] ε>0
12+ε O~(1εn1/3) no [21] ε>0
7 O~(n1/3) no Theorem 3
2k1 O~(Dhopn1/k) no Theorem 4 Dhop is the hop diameter of G.

The rest of this paper is organized as follows. In Section 2 we present some necessary preliminaries. In Section 3 we present an overview of our technical contributions and our new compact routing schemes. In Section 4 we present our optimal compact roundtrip routing scheme for weighted undirected graphs. In Section 5 we extend Section 4 to directed graphs with small hop diameter. In Appendix A we present our 7-stretch compact roundtrip routing scheme for weighted directed graphs. Finally, in Section 6 in the full version of this paper [15], we present our single message compact routing scheme for weighted undirected graphs that use average local storage.

2 Preliminaries

Let G=(V,E,w) be a weighted graph with n vertices and m edges, where w:E+. We consider both connected undirected graphs and strongly connected directed graphs666If the graph is not connected (or not strongly connected), we add a dummy vertex and connect it with bi-directional edges of weight to every vertex of the graph..

Let the distance dG(u,v) from u to v be the length of the shortest path from u to v in G, where the length of a path is the sum of its edge weights, and let PG(u,v) be the shortest path from u to v, G is omitted when it is clear from context. The roundtrip distance d(uv) is defined as d(u,v)+d(v,u). Throughout this paper, we assume that for any two vertices u and v, there exists a unique shortest path between them. In the case of multiple shortest paths of the same length, we break ties by selecting the path with the lexicographically smallest sequence of vertex identifiers.

Let XV. The distance d(u,X) from u to X is the distance between u and the closest vertex to u from X, that is, d(u,X)=minxX(d(u,x)). Similarly, the roundtrip distance from u to X is defined as d(uX)=minxX(d(ux)). Let p(u,X)=argminxX(d(ux)) (ties are broken in favor of the vertex with a smaller identifier).

Next, following the ideas of Thorup and Zwick [25], we define bunches and clusters. Let uV and let X,YV. The bunch of u with respect to X and Y is defined as B(u,X,Y)={vXd(uv)<d(uY)}. The ball of u with respect to Y is defined as B(u,Y)={vVd(uv)<d(uY)} (notice that B(u,Y)=B(u,V,Y)). The cluster of u with respect to Y is defined as C(u,Y)={vVd(uv)<d(vY)}.

The starting point in many algorithms, distance oracles, and compact routing schemes, and in particular in Thorup and Zwick [24] routing scheme, is a hierarchy of vertex sets A0,A1,,Ak, where A0=V, Ak=, Ai+1Ai and |Ai|=n1i/k for 0ik1.

For every 0ik1, the i-th pivot of u is defined as pi(u)=p(u,Ai), and hi(u) is defined as d(u,Ai). The i-th bunch of u is defined as Bi(u)=B(u,Ai,Ai+1). The bunch of u is defined as the union of its individual bunches, that is, B(u)=i=0k1Bi(u). The cluster of a vertex wAiAi+1 is defined as the cluster of w with respect to the set Ai+1, that is, C(w)=C(w,Ai+1). We denote by [k] the set {0,1,2,,k1}.

In the following lemma, we provide an upper bound for the size of B(u), which is O(kn1/k), as demonstrated by Thorup and Zwick [25].

Lemma 5 ([25, 20]).

Given an integer parameter k2, we can compute sets A1,,Ak1, such that |Ai|=O(n1i/k), for every 1ik1. For every i[k] the size of Bi(u) is O~(n1/k).

In the following lemma, we provide an upper bound for the size of C(u), which is O(n1/k), as demonstrated by Thorup and Zwick [24].

Lemma 6 ([24]).

Given a parameter p, we can compute a set A of size O~(np) such that, |C(w,A)|=O(1/p), for every vertex wVA, and |B(v,V,A)|=O(1/p) for every vV.

Let SV. We define Tout(u,S) as a tree containing the directed shortest paths from u to all the vertices in S, and Tin(u,S) as a tree containing the directed shortest paths from all the vertices in S to u. When u is clear from context, we omit it, for example, we use T(C(u))=T(u,C(u)), and T(B(u))=T(u,B(u)). Note that it is possible for |Tout(u,S)| to be bigger than |S| in cases where the shortest path from u to a vertex in S passes through a vertex not in S. 777We denote with |H| the number of edges in H, i.e. |H|=|E(H)|. Let T(u,X)=Tin(u,X)Tout(u,X), as defined in [21], when u is clear from context we omit it and write T(X). Notice that in undirected graphs, since Tin(u,X)=Tout(u,X), we have that T(u,X)=Tin(u,X)=Tout(u,X). Next, we show that if S is a ball, i.e. S=B(u,X)=B(u,V,X) for some set X, then |Tout(u,S)|=|S| and |Tin(u,S)|=|S|, and therefore |T(u,S)|2|S|.

Lemma 7 ([21]).

|Tout(u,B(u,X))|=|B(u,X)| and |Tin(u,B(u,X))|=|B(u,X)|.

Proof.

Let uV, vB(u,X), and let wP(u,v). We will show that wB(u,X). Since all the vertices in Tout are on the shortest path from u to a vertex in B(u,X), we obtain that |Tout(u,B(u,X))||B(u,X)|, as required. The proof for the in-ball is identical for reversed paths. From the triangle inequality, we know that

d(uw)=d(u,w)+d(w,u)d(u,w)+d(w,v)+d(v,u)=d(uv)<d(uX),

where the last inequality follows from the fact that vB(u,X).888 denotes an inequality that follows from the triangle inequality. Since d(uw)<d(uX) we get that wB(u,X), as required.

The following lemma was originally proven in [25] for any metric space and therefore holds also for roundtrip distances. For completeness, we prove the lemma for roundtrip distances.

Lemma 8.

Let u,vV and let 0<ik1. If pj(u)B(v) and pj(v)B(u) for every 0<j<i, then

d(upi(u))id(uv)andd(vpi(v))id(uv).

Proof.

We prove the claim by induction for every 0i. For i=0, the lemma holds since d(vv)=0 and d(uu)=0. Next, we prove the induction step. We assume the correctness of the claim for i1 and show its correctness for i. Therefore, d(vpi1(v))(i1)d(uv) and d(upi1(u))(i1)d(uv). Without loss of generality, we show that d(upi(u))id(uv). The proof for v is identical.

Since i, it follows that i1<. Therefore, from the lemma’s assumptions, we know that pi1(v)B(u). From the definition of B(u), it follows that d(upi(u))d(upi1(v)). From the triangle inequality, it follows that d(upi1(v))d(uv)+d(vpi1(v)). Recall that from the induction assumption we know that d(vpi1(v))(i1)d(uv). Therefore, we get that:

d(upi(u)) d(upi1(v))d(uv)+d(vpi1(v))
d(uv)+(i1)d(uv)=id(uv),

as required.

Next, we show that if pi1(v)B(u), then d(vpi(v))d(vpi1(v))+2d(uv).

Lemma 9.

Let u,vV, if pi1(v)B(u) then d(vpi(v))d(vpi1(v))+2d(uv)

Proof.

From the definition of pi(v), we know that it is the closest vertex to v in Ai, and since pi(u)Ai we get that d(vpi(v))d(vpi(u)). From the triangle inequality, it follows that d(vpi(u))d(vu)+d(upi(u)). From the lemma assumption, we know that pi1(v)B(u). Therefore, d(upi(u))d(upi1(v)). From the triangle inequality, it follows that d(upi1(v))d(uv)+d(vpi1(v)). Overall, we get that:

d(vpi(v)) d(vpi(u))d(vu)+d(upi(u))d(vu)+d(upi1(v))
d(vu)+d(uv)+d(vpi1(v))=2d(uv)+d(v,pi1(v)),

as required.

The following lemma holds only for undirected graphs and is presented in [25].

Lemma 10 ([25]).

Let G=(V,E,w) be a weighted undirected graph. Let vAiAi+1, let uC(v), and let wP(v,u) then wC(v).

Proof.

For the sake of contradiction, assume that wC(v). From the definition of C(v), we have that d(vw)d(wAi+1).

By the triangle inequality, we have: d(uAi+1)d(uw)+d(wAi+1). Since d(wAi+1)d(vw), we get d(uAi+1)d(uw)+d(wAi+1)d(uw)+d(vw). Since wP(v,u), and the graph is undirected, it follows that d(uw)+d(vw)=d(vu). Thus, d(uAi+1)d(vu), a contradiction to the fact that uC(v).

2.1 General framework

A routing scheme comprises two phases: a preprocessing phase and a routing phase. In the preprocessing phase, the entire graph is accessible to the algorithm. The preprocessing algorithm computes for every uV a routing table RT(u) and a label L(u). Each vertex u saves RT(u) and L(u) in its local storage. A routing scheme is considered compact if the size of the routing tables is sub-linear in the number of vertices, i.e., |RT(u)|=o(n).

In the routing phase, the goal is to route a message from a source vertex u to a destination vertex v. Specifically, the routing algorithm at the source vertex u gets as input the routing table RT(u), and the labels L(u) and L(v). Based on this input, the routing algorithm determines a neighboring vertex of u to which the message should be forwarded. The routing algorithm can also attach a header to the message. When a vertex w receives a message, the routing algorithm at w gets as input the routing table RT(w), and the labels L(w) and L(v) (and possibly a header). Based on this input, the routing algorithm determines a neighboring vertex of w to which the message should be forwarded. The message is routed from a vertex to one of its neighbors until the message reaches its destination vertex v.

We denote by d^(u,v) the distance that a message whose source vertex is u and whose destination vertex is v traverses from u to v. The stretch of the routing scheme is defined as maxu,vV(d^(u,v)d(u,v)).

Several variants of compact routing schemes exist. In a labeled routing scheme, the preprocessing algorithm can assign labels to the vertices. In a fixed-port routing scheme, the order of the neighbors of each vertex is fixed and cannot be changed by the preprocessing algorithm. In this work, we focus on labeled, fixed-port compact routing schemes.

2.2 Routing in trees

An essential ingredient in our compact routing schemes for general graphs is the following compact routing scheme for trees. Given a tree T, the preprocessing algorithm assigns a label L(v,T) to every vertex v in T. The routing algorithm then routes a message from a source vertex u to a destination vertex v on the shortest path from u to v in T. Thorup and Zwick [24] presented a tree routing scheme that uses only vertex labels of size (1+o(1))logn and no routing tables. In the fixed-port model, however, the label size increases to O(log2n). A similar scheme was presented by Fraigniaud and Gavoille [12]. The following lemma outlines the known results for tree compact routing schemes.

Lemma 11 ([12, 24]).

Let T=(V,E) be an undirected tree on n vertices with each edge eE assigned a unique O(logn)-bit port number. Then, it is possible to efficiently assign each vertex vV an O(log2n/loglogn)-bit label, denoted label(v), such that if u,vV, then given label(u) and label(v), and nothing else, it is possible to find in constant time, the port number assigned to the first edge on the path in T from u to v.

2.3 Routing in directed graphs

Roditty, Thorup, and Zwick [21] extended the compact routing scheme from trees to double trees to handle directed graphs. In our work on directed graphs (Section 5 and Appendix A), we employ this double-tree adaptation when routing within double-trees. Moreover, for the routing in clusters to work in directed graphs, they adjusted the definition of cluster adaptation using the following definition of roundtrip ordering.

Definition 12.

We assume that V={1,,n}. Let u1,u2,vV. We say that u1vu2 if one of the following holds:

  • d(vu1)<d(vu1)

  • d(vu1)=d(vu1) and d(u1v)<d(u1v)

  • d(vu1)=d(vu1) and d(u1v)=d(u1v) and u1<u2

Using this definition, the cluster of u with respect to Y is defined as C(u,Y)={vVuvpY(u)}, where pY(u) satisfies that pY(u)vw for every wY.

Using this definition, they proved the following lemma:

Lemma 13 ([21]).

If vC(u) and wP(u,v), then vC(w)

3 Overview

In this section, we present an overview of our new compact routing schemes and their main technical contributions. Throughout the overview, let V=A0,,Ak= be a hierarchy such that, |Ai|=O~(n1i/k) and |B(u)|=O~(n1/k), for every uV, created using Section 2. We denote with xy routing from x to y on P(x,y).

Roundtrip routing scheme in undirected graphs.

Notice that any t-stretch compact routing scheme is also a t-roundtrip stretch compact routing scheme. In undirected graphs, where d(u,v)=d(v,u), we have d(uv)=d(u,v)+d(v,u)=2d(u,v). This might lead one to question the potential benefits of considering roundtrip routing in undirected graphs. In other words, why might the problem of roundtrip routing be easier than the problem of single message routing, even though d(uv)=2d(u,v)?

During the routing process, the information available to the routing algorithm at u may differ from the information available at v. Therefore, the routing path from u to v may differ from the routing path from v to u, which might lead to the case that d^(u,v)d^(v,u). Consider for example the case that d^(u,v)=3d(u,v) and d^(v,u)=27d(u,v). In this case, the roundtrip stretch is 15 while the single message stretch is 27, and even though d(uv)=2d(u,v), the roundtrip stretch is much smaller than the single message stretch.

Next, we provide an overview of our optimal (2k1)-roundtrip stretch compact routing scheme (for the complete description, see Section 4). The preprocessing algorithm sets RT(u)={L(u,T(C(v)))vB(u)} and L(u)={L(u,T(C(pi(u))))i[k]}, for every uV. Let (x,y)=min{ipi(y)B(x)}, and let b=(u,v), and let a=(v,u). The roundtrip routing path is upb(v)vpa(u)u (see Figure 1).

Our main technical contribution is in Lemma 4, where we show that while the path upb(v)v might be of length at most (4k3)d(u,v), the entire path upb(v)vpa(u)u is of length of at most (4k2)d(u,v)=(2k1)d(uv), and therefore the roundtrip stretch is the optimal (2k1)-stretch.

Next, we provide some intuition why d^(uv)(2k1)d(uv). From the triangle inequality, we have that d^(uv)d(uv)+d(upa(u))+d(vpb(v)). From the definition of a and b, for every 0<i<abk1 we have pi(u)B(v) and pi(v)B(u), and for every ai<b we have pi(v)B(u). This allows us to prove that d(upa(u))ad(uv) and d(vpb(v))ad(uv)+(ba)2d(vpb(v)). Overall:

d(upa(u))+d(vpb(v)) ad(uv)+ad(uv)+(ba)2d(uv)
=2bd(uv)2(k1)d(uv)

and therefore d^(uv)d(uv)+d(upa(u))+d(vpb(v))(2k1)d(uv).

Directed roundtrip routing schemes.

One might wonder why the general compact roundtrip routing scheme presented above for undirected graphs can not be extended to directed graphs. The problem lies in the structure of clusters. In undirected graphs, if uC(w) then P(u,w)C(w) (see Section 2), and therefore we can route from u to every w, such that uC(w). Unfortunately, in directed graphs, this nice property of clusters does not necessarily hold. More specifically, it might be that P(u,w)C(w) even when uC(w) and as a result, we cannot route from u to w while using only the cluster C(w) as in undirected graphs. A simple approach to overcome this problem is to store P(u,w), for every wB(u), in RT(u). Using this approach, we can extend the roundtrip routing scheme from undirected graphs to directed graphs with small hop diameter (see Theorem 4).

For routing tables of size O~(n1/3), we overcome the problem that P(u,w)C(w) using a more sophisticated solution. For an hierarchy with k=3 we have V=A0,A1,A2,A3= and three bunches, B0(u),B1(u) and B2(u), for every uV. Let u,vV. To follow the compact roundtrip of undirected graphs we need to be able to route from u to v, if vB0(u), from u to p1(v), if p1(v)B1(u), and from u to p2(v), otherwise. Since B0(u) is a ball P(u,v)B0(u), for every vB0(u) (see Section 2). Therefore, we can route from u to every vertex in B0(u). Moreover, since C(p2(v))=V, we can route from u to p2(v). This leaves us with the challenge of routing from u to p1(v) when p1(v)B1(u).

To handle this challenge, we divide the routing from u to p1(v) into two cases. If P(u,p1(v))C(p1(v)), we simply route on the path P(u,p1(v)). Otherwise, if P(u,p1(v))C(p1(v)), we let zP(u,p1(v)) be the first vertex such that zC(p1(v)). In this case, we route along the path up2(z)p1(v). Using the fact that zC(p1(v)) we show that d(u,p2(z))+d(p2(z),p1(v))d(u,p1(v))+d(up1(v)), and that d^(uv)7d(uv) (see Appendix A).

Average single message routing schemes in undirected graphs.

Recall that hi(u)=d(u,Ai). In the preprocessing algorithm, we set RT(u)={L(u,T(C(v)))vB(u)}{L(v,T(C(u)))vC(u)}, and L(u)={hi(u),L(u,T(C(pi(u))))i[k]}, for every uV.

For the sake of simplicity, we assume that when routing from the source vertex u to the destination vertex v, the value d(u,v) is known to the routing algorithm. In this case, we present an optimal (2k1)-stretch routing scheme in Section 6 of the full version of this paper [15]. The algorithm at the source u works as follows. For each 0ik1, if pi(v)Bi(u), it routes from u to v in T(C(pi(v))). Otherwise, if the inequality hi+1(v)>d(u,v)+hi(u) holds, then we have that vC(pi(u)) and therefore the algorithm routes from u to v in T(C(pi(u))). If neither condition is satisfied, the algorithm proceeds to the next iteration. The (2k1)-stretch of the routing scheme follows by induction using standard tools (see the full version[15] for the complete proof).

In Section 6 of the full version[15], we present a routing algorithm that routes from u to v without knowing the value of d(u,v). To achieve this, we introduce an estimate δ^ satisfying δ^d(u,v), which serves as our current best lower bound for d(u,v). Note that since δ^ is only an estimate and may be strictly smaller than d(u,v), it is possible that h2i+1(v)>δ^+h2i(u) and vC(p2i(u)).999We alternate between bounding hi(u) and hi(v), but by the definition of δ^, we have that hi+1(u)δ^+hi(v) for every i. Therefore, it suffices to only bound the h2i+1(v)h2i(u) for 0ia. Therefore, we introduce a condition that, if satisfied, means that δ^h2i+1(v)h2i(u). If the condition is satisfied, the routing algorithm routes to p2i(u) and checks in RT(p2i(u)) whether vC(p2i(u)). If vC(p2i(u)) the algorithm simply routes from p2i(u) to v. Otherwise, if vC(p2i(u)), then we know that h2i+1(v)h2i(u)d(u,v), and we can safely update δ^ to h2i+1(v)h2i(u). We proceed by routing back from p2i(u) to u and then continuing to the next iteration of the algorithm.

The routing algorithm is simple and works as follows. Let =min{ipi(v)B(u)}, and let δ^=max0i(hi+1(u)hi(v)). For each 0i/2, let 1<ci<2 be a constant:

  1. 1.

    If h2i+1(v)ciδ^+h2i(u), then the algorithm continues to the next iteration.

  2. 2.

    Otherwise, if h2i+1(v)>ciδ^+h2i(u), then the algorithm routes to p2i(u) and accesses RT(p2i(u)):

    1. (a)

      If vC(p2i(u)) then the algorithm routes directly from p2i(u) to v in T(C(p2i(u))).

    2. (b)

      Otherwise, if vC(p2i(u)), the algorithm sets δ^ to h2i+1(v)h2i(u) and routes back to u from p2i(u). The algorithm then continues to the next iteration.

In contrast to the simplicity of the routing algorithm, analyzing its stretch is rather involved. For a complete proof, see Section 6 of the full version[15].

4 Optimal roundtrip routing in undirected graphs

In this section, we consider roundtrip routing in weighted undirected graphs. In undirected graphs d(u,v)=d(v,u), the roundtrip distance d(uv) is simply d(u,v)+d(v,u)=2d(u,v).

This observation naturally leads to the question: what are the potential advantages of studying roundtrip routing in undirected graphs? In particular, why might roundtrip routing be easier to approximate than single-message routing, despite the fact that the roundtrip distance is always twice the one-way distance, i.e., d(uv)=2d(u,v)?

The key distinction lies in the asymmetry of available information during the routing process. When routing from a source vertex u to a destination vertex v, the algorithm has access only to the routing table RT(u) and the label L(v). However, routing from v to u is based solely on RT(v) and L(u). Since these inputs may differ significantly, the resulting routing paths may differ significantly, and we may have that d^(u,v)d^(v,u).

In single-message routing, the stretch must hold for the worst-case direction. Therefore, max(d^(u,v),d^(v,u))d(u,v) is bounded. However, roundtrip routing requires only that the average of the two directions be bounded. Therefore, d^(uv)d(uv)=d^(u,v)+d^(v,u)2d(u,v) is bounded.

This relaxation in the approximation requirement allows us to achieve an optimal stretch compact roundtrip routing scheme, as presented in the following theorem.

Reminder of Theorem 2. Let G=(V,E,w) be a weighted undirected graph. Let k1 be an integer. There is a (2k1)-stretch compact roundtrip routing scheme that uses local routing tables of size O~(n1/k), vertex labels of size O~(k) and packet headers of size O~(k).

First, we describe the preprocessing algorithm, which computes the routing tables and assigns vertex labels. The input to the algorithm is a graph G=(V,E,w) and an integer parameter k>1. The algorithm uses Section 2 to build a hierarchy of vertex sets A0,A1,,Ak, where A0=V, Ak=, Ai+1Ai, |Ai|=n1i/k and |Bi(u)|=O~(n1/k), for every 0ik1. Next, for every uV, the preprocessing algorithm computes B(u) and C(u). Then, for every uV, the algorithm sets the routing table RT(u) to:

RT(u)={L(u,T(C(v)))vB(u)},

and the label L(u) to:

L(u)={L(u,T(C(pi(u))))i[k]}.

We now turn to bound the size of the routing tables and the vertex labels.

Lemma 14.

|RT(u)|=O~(n1/k), and |L(u)|=O~(k), for every uV.

Proof.

From Section 2 it follows that |B(u)|=O~(n1/k). From Subsection 2.2 it follows that for every tree T it holds that |L(u,T)|=O~(1). Therefore, |RT(u)|=|B(u)|O~(1)=O~(n1/k), as required. The label of each vertex is composed of k tree labels L(u,T(C(pi(u)))) for every i[k]. From Subsection 2.2 we know that |L(u,T(C(pi(u))))|=O~(1). Therefore, |L(u)|=kO~(1)=O~(k), as required.

The routing algorithm routes a message from u to v as follows. Let (x,y)=min{ipi(y)B(x)} and let =(u,v). We route from u to v on the shortest path between u and v in T(C(p(v))). In figure 1 we show the roundtrip route between u and v according to this routing algorithm.

Next, we show that for every w on the shortest path from u to v in T(C(p(v))) we have that L(w,T(C(p(v))))RT(w) and therefore w can route to v in T(C(p(v))).

Lemma 15.

For every wP(u,p(v))P(p(v),v) it holds that L(w,T(C(p(v))))RT(w)

Proof.

If wP(u,p(v)), then by Section 2, we know that wC(p(v)). Similarly, if wP(p(v),v), then from Section 2, we know that wC(p(v)). Since wC(p(v)) it follows from the definition of C(p(v)) that p(v)B(w). By the definition of RT(w) since p(v)B(w) it follows that L(w,T(C(p(v))))RT(w), as required.

We now turn to the main technical contribution of this section and prove that the stretch of the compact roundtrip routing scheme is 2k1.

Lemma 16.

d^(uv)(2k1)d(uv)

Proof.

Let u,vV, let b=(u,v)=min{i[k]pi(v)B(u)}, and let a=(v,u)=min{i[k]pi(u)B(v)}. Assume, without loss of generality, that ba. See Figure 1 for an illustration.

Figure 1: The roundtrip routing of Theorem 2. Let a=(v,u),b=(u,v), where (x,y)=min{ipi(y)B(x)}. (We assume wlog that ba.).

In the routing phase, we route from u to v on the shortest path between u and v in T(C(pb(v))). Similarly, we route from v to u on the shortest path between v and u in T(C(pa(u))). Therefore,

d^(u,v) =dT(C(pb(v)))(u,v)d(u,pb(v))+d(pb(v),v) and d^(v,u)
=dT(C(pa(u)))(u,v)d(v,pa(u))+d(pa(u),u).

From the triangle inequality, we have d(u,pb(v))d(u,v)+d(v,pb(v)), therefore we get that:

d^(u,v)=d(u,pb(v))+d(pb(v),v)d(u,v)+d(v,pb(v))+d(pb(v),v)=d(u,v)+d(vpb(v))

By symmetry, we also get that d^(v,u)d(v,u)+d(upa(u)). By definition d^(uv)=d^(u,v)+d^(v,u). Therefore, we get:

d^(uv) =d^(u,v)+d^(v,u)
d(u,v)+d(vpb(v))+d(v,u)+d(upa(u))
=d(uv)+d(vpb(v))+d(upa(u)).

To get that d^(uv)(2k1)d(uv), we show that d(vpb(v))+d(upa(u))2(k1)d(uv) in the following claim.

Claim 16.1.

d(vpb(v))+d(upa(u))2(k1)d(uv)

Proof.

Let Δiv=d(vpi(v))d(vpi1(v)), for every 0<i<k. Notice that for every 0<j<k, it holds that:
i=1jΔiv =d(vpj(v))d(vpj1(v))+d(vpj1(v))+d(vp1(v))d(vp0(v)) =d(vpj(v)).

Since we assume (wlog) that ba, we have:

d(vpb(v))=i=1bΔiv=i=1aΔiv+i=a+1bΔiv=d(vpa(v))+i=a+1bΔiv. (1)

From the definition of b and a, for every 0<i<ab, we have that both pi(u)B(v) and pi(v)B(u). Therefore, by applying Section 2 we get:

d(upa(u))ad(uv)andd(vpa(v))ad(uv). (2)

For every ai<b, since pi(v)B(u), we can apply Section 2 to get that Δiv<2d(uv). Therefore, we get:

i=a+1bΔivi=a+1b2d(uv)=2(ba)d(uv) (3)

Using the above three inequalities, we get:

d(upa(u))+d(vpb(v)) =(1)d(upa(u))+d(vpa(v))+i=a+1bΔiv
(2)ad(uv)+ad(uv)+i=a+1bΔiv
(3)ad(uv)+ad(uv)+(ba)2d(uv)
=2bd(uv)2(k1)d(uv),

where the last inequality follows from the fact that bk1.

Finally, since we know that d^(uv)d(uv)+d(vpb(v))+d(upa(u)), and from Claim 16.1 we have that d(vpb(v))+d(upa(u))2(k1)d(uv) we get:

d^(uv) d(uv)+d(vpb(v))+d(upa(u))
d(uv)+2(k1)d(uv)=(2k1)d(uv),

As required. Theorem 2 follows from Section 4, Section 4 and Section 4.

5 Extending Section 4 to directed graphs

In this section, we consider roundtrip routing in weighted directed graphs. One might wonder why the routing scheme of Theorem 2 does not apply to or cannot be adapted to directed graphs. The key issue lies in the fact that Section 2 holds only for undirected graphs. Without this lemma, the routing process fails in directed graphs. Specifically, in directed graphs, there exist cases where uC(v) and wP(u,v), but wC(v). Consequently, even if we store the set {L(u,T(C(v)))vB(u)}, for every vertex u, we may not be able to route correctly from u to v when vB(u).

To overcome this issue, we consider bounded hop diameter graphs, where the hop diameter is the maximum number of edges on a shortest path between any two vertices u,v in the graph, i.e. Dhop=maxu,vV(|P(u,v)|). In such a case, we can achieve the following theorem.

Reminder of Theorem 4. Let G=(V,E,w) be a weighted directed graph. Let k1 be an integer. There is a (2k1)-stretch compact roundtrip routing scheme that uses local routing tables of size O~(Dhopn1/k), vertex labels of size O~(Dhopk) and packet headers of size O~(Dhop).

Proof.

The preprocessing algorithm is identical to that of Theorem 2, with one key modification: instead of setting RT(u)={L(u,T(C(v)))vB(u)}, we store RT(u)={P(u,v)vB(u)}, where P(u,v) is the entire path from u to v, and similarly instead of setting L(u)={pi(u)i[k]} we store L(u)={P(pi(u),u)i[k]}.

In the routing algorithm at the source vertex u to a destination vertex v, after determining =min{ipi(v)B(u)}. The entire path P(u,p(v))P(p(v),v) is attached to the header to ensure that intermediate vertices can route correctly. The remainder of the proof follows the same steps as in Section 4.

References

  • [1] Ittai Abraham, Cyril Gavoille, Dahlia Malkhi, Noam Nisan, and Mikkel Thorup. Compact name-independent routing with minimum stretch. In Phillip B. Gibbons and Micah Adler, editors, SPAA 2004: Proceedings of the Sixteenth Annual ACM Symposium on Parallelism in Algorithms and Architectures, June 27-30, 2004, Barcelona, Spain, pages 20–24. ACM, 2004. doi:10.1145/1007912.1007916.
  • [2] Ittai Abraham, Cyril Gavoille, Dahlia Malkhi, Noam Nisan, and Mikkel Thorup. Compact name-independent routing with minimum stretch. ACM Trans. Algorithms, 4(3):37:1–37:12, 2008. doi:10.1145/1367064.1367077.
  • [3] Baruch Awerbuch, Amotz Bar-Noy, Nathan Linial, and David Peleg. Improved routing strategies with succinct tables. J. Algorithms, 11(3):307–341, 1990. doi:10.1016/0196-6774(90)90017-9.
  • [4] Baruch Awerbuch and David Peleg. Routing with polynomial communication-space trade-off. SIAM J. Discret. Math., 5(2):151–162, 1992. doi:10.1137/0405013.
  • [5] Ruoxu Cen and Ran Duan. Roundtrip spanners with (2k1) stretch. CoRR, abs/1911.12411, 2019. arXiv:1911.12411.
  • [6] Ruoxu Cen, Ran Duan, and Yong Gu. Roundtrip spanners with (2k-1) stretch. In Artur Czumaj, Anuj Dawar, and Emanuela Merelli, editors, 47th International Colloquium on Automata, Languages, and Programming, ICALP 2020, July 8-11, 2020, Saarbrücken, Germany (Virtual Conference), volume 168 of LIPIcs, pages 24:1–24:11. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2020. doi:10.4230/LIPICS.ICALP.2020.24.
  • [7] Shiri Chechik. Compact routing schemes with improved stretch. In Panagiota Fatourou and Gadi Taubenfeld, editors, ACM Symposium on Principles of Distributed Computing, PODC ’13, Montreal, QC, Canada, July 22-24, 2013, pages 33–41. ACM, 2013. doi:10.1145/2484239.2484268.
  • [8] Lenore Cowen. Compact routing with minimum stretch. J. Algorithms, 38(1):170–183, 2001. doi:10.1006/JAGM.2000.1134.
  • [9] Lenore Cowen and Christopher G. Wagner. Compact roundtrip routing for digraphs. In Robert Endre Tarjan and Tandy J. Warnow, editors, Proceedings of the Tenth Annual ACM-SIAM Symposium on Discrete Algorithms, 17-19 January 1999, Baltimore, Maryland, USA, pages 885–886. ACM/SIAM, 1999. URL: http://dl.acm.org/citation.cfm?id=314500.315068.
  • [10] Lenore Cowen and Christopher G. Wagner. Compact roundtrip routing in directed networks. J. Algorithms, 50(1):79–95, 2004. doi:10.1016/J.JALGOR.2003.08.001.
  • [11] Tamar Eilam, Cyril Gavoille, and David Peleg. Compact routing schemes with low stretch factor. J. Algorithms, 46(2):97–114, 2003. doi:10.1016/S0196-6774(03)00002-6.
  • [12] Pierre Fraigniaud and Cyril Gavoille. A space lower bound for routing in trees. In Helmut Alt and Afonso Ferreira, editors, STACS 2002, 19th Annual Symposium on Theoretical Aspects of Computer Science, Antibes - Juan les Pins, France, March 14-16, 2002, Proceedings, volume 2285 of Lecture Notes in Computer Science, pages 65–75. Springer, 2002. doi:10.1007/3-540-45841-7_4.
  • [13] Cyril Gavoille, Christian Glacet, Nicolas Hanusse, and David Ilcinkas. On the communication complexity of distributed name-independent routing schemes. In Yehuda Afek, editor, Distributed Computing - 27th International Symposium, DISC 2013, Jerusalem, Israel, October 14-18, 2013. Proceedings, volume 8205 of Lecture Notes in Computer Science, pages 418–432. Springer, 2013. doi:10.1007/978-3-642-41527-2_29.
  • [14] Alina Harbuzova, Ce Jin, Virginia Vassilevska Williams, and Zixuan Xu. Improved roundtrip spanners, emulators, and directed girth approximation. In David P. Woodruff, editor, Proceedings of the 2024 ACM-SIAM Symposium on Discrete Algorithms, SODA 2024, Alexandria, VA, USA, January 7-10, 2024, pages 4641–4669. SIAM, 2024. doi:10.1137/1.9781611977912.166.
  • [15] Avi Kadria and Liam Roditty. Compact routing schemes in undirected and directed graphs. arXiv preprint arXiv:2503.13753, 2025. doi:10.48550/arXiv.2503.13753.
  • [16] Goran Konjevod, Andréa W. Richa, and Donglin Xia. Optimal-stretch name-independent compact routing in doubling metrics. In Eric Ruppert and Dahlia Malkhi, editors, Proceedings of the Twenty-Fifth Annual ACM Symposium on Principles of Distributed Computing, PODC 2006, Denver, CO, USA, July 23-26, 2006, pages 198–207. ACM, 2006. doi:10.1145/1146381.1146412.
  • [17] Kofi A. Laing. Name-independent compact routing in trees. Inf. Process. Lett., 103(2):57–60, 2007. doi:10.1016/J.IPL.2007.02.015.
  • [18] Jakub Pachocki, Liam Roditty, Aaron Sidford, Roei Tov, and Virginia Vassilevska Williams. Approximating cycles in directed graphs: Fast algorithms for girth and roundtrip spanners. In Artur Czumaj, editor, Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2018, New Orleans, LA, USA, January 7-10, 2018, pages 1374–1392. SIAM, 2018. doi:10.1137/1.9781611975031.91.
  • [19] David Peleg and Eli Upfal. A trade-off between space and efficiency for routing tables. J. ACM, 36(3):510–530, 1989. doi:10.1145/65950.65953.
  • [20] Liam Roditty, Mikkel Thorup, and Uri Zwick. Deterministic constructions of approximate distance oracles and spanners. In Luís Caires, Giuseppe F. Italiano, Luís Monteiro, Catuscia Palamidessi, and Moti Yung, editors, Automata, Languages and Programming, 32nd International Colloquium, ICALP 2005, Lisbon, Portugal, July 11-15, 2005, Proceedings, volume 3580 of Lecture Notes in Computer Science, pages 261–272. Springer, 2005. doi:10.1007/11523468_22.
  • [21] Liam Roditty, Mikkel Thorup, and Uri Zwick. Roundtrip spanners and roundtrip routing in directed graphs. ACM Trans. Algorithms, 4(3):29:1–29:17, 2008. doi:10.1145/1367064.1367069.
  • [22] Liam Roditty and Roei Tov. New routing techniques and their applications. In Chryssis Georgiou and Paul G. Spirakis, editors, Proceedings of the 2015 ACM Symposium on Principles of Distributed Computing, PODC 2015, Donostia-San Sebastián, Spain, July 21 - 23, 2015, pages 23–32. ACM, 2015. doi:10.1145/2767386.2767409.
  • [23] Eli Stafford and Chunjiang Zhu. Improved sourcewise roundtrip spanners with constant stretch. In Weili Wu and Guangmo Tong, editors, Computing and Combinatorics - 29th International Conference, COCOON 2023, Hawaii, HI, USA, December 15-17, 2023, Proceedings, Part I, volume 14422 of Lecture Notes in Computer Science, pages 297–309. Springer, 2023. doi:10.1007/978-3-031-49190-0_21.
  • [24] Mikkel Thorup and Uri Zwick. Compact routing schemes. In Arnold L. Rosenberg, editor, Proceedings of the Thirteenth Annual ACM Symposium on Parallel Algorithms and Architectures, SPAA 2001, Heraklion, Crete Island, Greece, July 4-6, 2001, pages 1–10. ACM, 2001. doi:10.1145/378580.378581.
  • [25] Mikkel Thorup and Uri Zwick. Approximate distance oracles. J. ACM, 52(1):1–24, 2005. doi:10.1145/1044731.1044732.

Appendix A 𝟕-stretch directed roundtrip routing with |RT(𝒖)|=𝑶(𝒏𝟏/𝟑)

In this section, we consider roundtrip routing in general weighted directed graphs. Roditty et. al [21] obtained a roundtrip routing scheme with (4k+ε)-stretch and routing tables of size O~(1εn1/klogW). If we set k=3 we get a (12+ε)-stretch roundtrip routing scheme with routing tables of size O~(1εn1/3logW). In this section, we present a 7-stretch roundtrip routing scheme with routing tables of size O~(n1/3). We prove:

Reminder of Theorem 3. Let G=(V,E,w) be a weighted directed graph. There is a 7-stretch compact roundtrip routing scheme that uses local routing tables of size O~(n1/3), vertex labels of size O~(1) and packet headers of size O~(1).

First, we describe the preprocessing algorithm, which computes the routing tables and assigns vertex labels. The input to the algorithm is a graph G=(V,E,w). The algorithm uses Section 2 and Section 2 to build a hierarchy of vertex sets V=A0A1A2A3=, where |Ai|=n1i/k. For every uV it holds that |C(u,A1)|=O~(n1/3) and |Bi(u)|=O~(n1/k), where 0i3. Next, for every uV, the preprocessing algorithm computes B(u) and C(u). Then, for every uV, the algorithm sets the routing table RT(u) to:

RT(u)={L(w,T(B0(u)))for every wB0(u)L(u,T(B0(w)))for every w s.t. uT(B0(w))L(u,T(C(w)))for every wA2L(u,T(C(w)))for every wB1(u), if P(u,w)C(w)L(w,T(C(p2(z))))for every wB1(u),z=argminxP(u,w),xC(w){d(u,x)}

and the label L(u) to:

L(u)={L(u,T(B0(u))),L(p1(u),T(B0(u))),L(u,T(C(p2(u))))}

We now bound the size of the routing tables and the vertex labels.

Lemma 17.

|RT(u)|=O~(n1/3) and |L(u)|=O~(1)

Proof.

From Section 2 it follows that |Bi(u)|=O~(n1/3), for every 1i2. In addition we get that |A2|=O~(n1/3). From Section 2 it follows that |B0(u)|=O~(n1/3) and |C(u,A1)|=O~(n1/3). From Subsection 2.2 it follows that for every tree T it holds that |L(u,T)|=O~(1). Therefore, |RT(u)|O~(1)(|B0(u)|+|C(u,A1)|+|A2|+|B1(u)|+|B1(u)|)=O~(n1/3), as required.

The label of each vertex is composed of three tree labels. From Subsection 2.2 it follows that each tree label is of size O~(1). Therefore, |L(u)|=3O~(1)=O~(1), as required. The routing algorithm routes a message from u to v as follows. If vB0(u), then the algorithm routes the message using the tree T(B0(u)). Otherwise, if vC(u,A1) then the algorithm routes the message using the tree T(B0(v)). If vB0(u) and vC(u,A1), then the algorithm checks if p1(v)B1(u). In this case, if P(u,p1(v))C(p1(v)) then the algorithm routes on T(C(p1(v))) from u to p1(v), and then from p1(v) to v on the tree T(B0(v)) (see Figure 2 (a)). Otherwise, if P(u,p1(v))C(p1(v)), then the algorithm routes from u to p1(v) on the tree T(C(p2(z))), where z=argminxP(u,p1(v)),xC(p1(v)){d(u,x)}, and then the algorithm routes from p1(v) to v on the tree T(B0(v)) (see Figure 2 (b)).

Finally, if p1(v)B1(u), then the algorithm routes from u to v on the tree T(C(p2(v))) (see Figure 2 (c)). A pseudo-code for the routing algorithm is given in Algorithm 1.

Algorithm 1 Route(u,v).

In the next lemma, we show that all intermediate vertices have the necessary information to complete the routing process once the routing tree is determined.

Lemma 18.

The following properties hold:

  1. 1.

    If vB0(u), then for every wP(u,v), we have L(w,T(B0(u)))RT(w).

  2. 2.

    If vC(u,A1), then for every zP(u,v), we have L(z,T(B0(v)))RT(z).

  3. 3.

    If p1(v)B1(u) and P(u,p1(v))C(v), then for every zP(u,p1(v)), we have L(z,T(C(p1(v))))RT(z).

  4. 4.

    If wA2, then for every zP(u,w)P(w,v), we have L(z,T(C(w)))RT(z).

  5. 5.

    For every wP(p1(v),v), we have L(w,B0(v))RT(w)L(v).

Proof.

From Section 2, we know that for every vB(u,X) and wP(u,v), we have that wB(u,X). Therefore, properties 1 and 2 hold.

For property 3, we have that the entire path P(u,p1(v)) is contained in C(p1(v)). Hence, any sub-path of P(u,p1(v)) is also in C(p1(v)), and we have L(z,T(C(p1(v))))RT(z) for every zP(u,p1(v)).

For property 4, since wA2, we know that C(w)=V. Therefore, all vertices in the graph (and specifically z) hold L(z,T(C(w)).

For property 5, for p1(v), we have L(p1(v),T(B0(v)))L(v). For every other wP(p1(v),v), we have from Subsection 2.3 that vC(w) and therefore wT(B(v)), and we have L(w,T(B0(v))) in RT(w), as required.

We now turn to prove that the stretch of the compact roundtrip routing scheme is 7.

Lemma 19.

d^(uv)7d(uv)

Proof.

First, consider the case that vB0(u). In this case, the routing algorithm routes from u to v along P(u,v), so d^(u,v)=d(u,v). Since vB0(u), by the definition of C(v,A1), we know that uC(v,A1). Therefore, the routing algorithm from v to u follows P(v,u. Thus,

d^(uv)=d^(u,v)+d^(v,u)=d(u,v)+d(v,u)=d(uv),

as required. Similarly, if vC(u,A1), using symmetrical arguments, we get that d^(uv)=d(uv), as required.

Next, consider the case that vB0(u) and vC(u,A1). In the following claim, we show that in this case, d^(u,v)d(u,v)+3d(uv). Using this claim, we obtain:

d^(uv)=d^(u,v)+d^(v,u)d(u,v)+3d(uv)+d(v,u)+3d(uv)7d(uv),

as required.

Claim 19.2.

If vB0(u) and vC(u,A1), then:

d^(u,v)d(u,v)+3d(uv).

Proof.

Since vB0(u) and vC(u,A1), we know from the definitions of B0(u) and C(u,A1) that:

d(up1(u))d(uv)andd(vp1(v))d(uv). (1)

We divide the proof into two cases: the case that p1(v)B(u) and the case that p1(v)B(u). If p1(v)B(u) we can apply Section 2 and get:

d(vp2(v))2d(uv)+d(vp1(v))(1)3d(uv). (2)

Since p1(v)B(u), the routing algorithm routes from u to v on the tree T(C(p2(v)). Therefore, we have:

d^(u,v) =dT(C(p2(v)))(u,v)d(u,p2(v))+d(p2(v),v)
d(u,v)+d(vp2(v))(2)d(u,v)+3d(uv),

as required.

Figure 2: The routing of Theorem 3. vB0(u)C(u,A1).

Next, consider the case that p1(v)B1(u). If P(u,p1(v))C(p1(v)), then the routing algorithm routes along the shortest path from u to p1(v). Therefore, we have:

d^(u,v)d(u,p1(v))+d(p1(v),v)d(u,v)+d(vp1(v))(1)d(u,v)+d(uv),

as required.

Otherwise, if P(u,p1(v))C(p1(v)), let z be the first vertex in P(u,p1(v)) such that zC(p1(v)). From the definition of C(p1(v)), it follows that p1(v)B1(z. From the definition of B1(z) we get that d(zp2(z))d(zp1(v)). Since zP(u,p1(v)), it follows that d(zp1(v))d(up1(v)). Combining these inequalities, we get that: d(zp2(z))d(up1(v)).

In this case, the routing algorithm routes from u to p1(v) on the tree T(C(p2(z)), and then from p1(v) to v. We get that:

d^(u,v) =dT(C(p2(z)))(u,p1(v))+d(p1(v),v)
d(u,p2(z))+d(p2(z),p1(v))+d(p1(v),v)
d(u,z)+d(z,p2(z))+d(p2(z),z)+d(z,p1(v))+d(p1(v),v)
=d(u,z)+d(zp2(z))+d(z,p1(v))+d(p1(v),v).

Since zP(u,p1(v)), we know that d(u,z)+d(z,p1(v))=d(u,p1(v)). Recall that d(zp2(z))d(up1(v)). Therefore:

d^(u,v) d(u,z)+d(z,p1(v))+d(p1(v),v)+d(zp2(z))
d(u,p1(v))+d(p1(v),v)+d(up1(v))
d(u,v)+d(vp1(v))+d(uv)+d(vp1(v))
(1)d(u,v)+d(uv)+d(uv)+d(uv)=d(u,v)+3d(uv),

as required.

From Claim 19.2, we have that d^(u,v)d(u,v)+3d(uv) and d^(v,u)d(u,v)+3d(uv). Therefore:

d^(uv)=d^(u,v)+d^(v,u)d(u,v)+3d(uv)+d(v,u)+3d(uv)=7d(uv),

as required.