Hyperbolic trees for efficient routing computation

Complex system theory is increasingly applied to develop control protocols for distributed computational and networking resources. The paper deals with the important subproblem of finding complex connected structures having excellent navigability properties using limited computational resources. Recently, the two-dimensional hyperbolic space turned out to be an efficient geometry for generative models of complex networks. The networks generated using the hyperbolic metric space share their basic structural properties (like small diameter or scale-free degree distribution) with several real networks. In the paper, a new model is proposed for generating navigation trees for complex networks embedded in the two-dimensional hyperbolic plane. The generative model is not based on known hyperbolic network models: the trees are not inferred from the existing links of any network; they are generated from scratch instead and based purely on the hyperbolic coordinates of nodes. We show that these hyperbolic trees have scale-free degree distributions and are present to a large extent both in synthetic hyperbolic complex networks and real ones (Internet autonomous system topology, US flight network) embedded in the hyperbolic plane. As the main result, we show that routing on the generated hyperbolic trees is optimal in terms of total memory usage of forwarding tables.

• Second, it is also demonstrated that the hyperbolic trees are highly present in synthetic hyperbolic networks, as well as in real networks embedded in the hyperbolic plane. • Third, as the highlighted contribution of the paper, it is shown based on extensive numerical investigations, that the expected memory usage of hop-by-hop routing with hyperbolic trees has optimal scaling with respect to the size of the trees.

Related work
The characterization of real network structures through binding evolutionary forces to properties like being navigable [8], searchable [9] or controllable [10] is a popular approach since the birth of complex network theory. The principal idea behind many of them is the assumption that network formation is led by a hidden metric among the nodes. The idea of characterizing networks by embedding them into the hyperbolic space [11] stems from the observation that artificial generation of nature-like hyperbolic networks can readily be done by surprisingly compact generative models. Related studies [12,13] show that scattering points as nodes on the hyperbolic plane evenly within a disk and adding edges between nodes being closer than a threshold directly give rise to scale-free networks similar to many real networks. Applications of this line of research consist of, e.g., designing routable data centers [14] or fitting protein interaction networks [15]. Recent developments in the area propose hyperbolic routing techniques to achieve low delay data transmission in NDN (Named Data Networks) [16] or robust learning strategies in Hyperbolic Deep Neural Networks [17]. In the paper, we aim to apply hyperbolic embedding-based network design to make the network routable using small table sizes in the participating nodes. Related research works in the area [11,12] concentrated on making the network navigable directly by the assigned hyperbolic coordinates. Current paper assumes no structure built into the assigned coordinates. It uses any general popularity versus similarity type hyperbolic embedding schemes [18,19] and shows that the required memory to successfully route the entire network scales optimally with respect to the number of network nodes. For that purpose, a tree is generated using the coordinates derived from the initial embedding, and routing is restrained to the edges of the tree. Although the tree may contain extra edges not existing in the original network, according to experimental results, the excess link ratio quickly diminishes as network size increases.

The hyperbolic plane
The hyperbolic plane (the two-dimensional hyperbolic space) is a metric space, hence there is a well-defined distance calculation such as (hyperbolic cosine theorem) where r u and r v are the radial components of the polar coordinates of points u and v, and = u − v is the difference of the angular components of the polar coordinates Hyperbolic trees for efficient routing computation [20,21]. Note that it significantly differs from the Euclidean cosine theorem. The fundamental nature of hyperbolic space is its constant negative curvature, which is not specified here because we do not directly need it. From now on, we assume unit negative curvature, which corresponds to the distance calculation formula above. The direct consequence of negative curvature is the exponential behavior; for example, the circumference and area of circles are exponential functions of the radii instead of polynomials like in the Euclidean space. The area of a hyperbolic disk with radius R is A further exciting and counter-intuitive property of the hyperbolic plane is that the area of triangles is bounded above by and equals to (in case of unit negative curvature) where , , are the angles of the triangle. The immediate consequence is that the triangle areas can usually be neglected, which can significantly simplify the calculations. For example, the area of a circle sector with R = 5 and = ∕2 (a quarter circle) is 2 (cosh 5 − 1) ≈ 115 while the area of the right-angled triangle with sides 5 a is less than ∕2 ≈ 1.57 . This means that the area of a circle sector is mainly concentrated to the circle segment. The above equations represent the three main properties, the careful use of which provides the basis of our calculations and derivations.

Hyperbolic trees
For generating hyperbolic random trees, let the model be the following. Let N points having uniform distribution random coordinates be generated on a hyperbolic disk of radius R. The uniform distribution means that the node density (i.e., the number of nodes per unit area) on the R−disk is constant. From this and (1), it follows that the probability density of the angle coordinates of the points is uniform between 0 and 2 , while the radial coordinate density is given by In a generated point set, the coordinates of the points are randomly sampled from the distributions above. The construction of the hyperbolic tree is given by the following rules. Each point in the set generated corresponds to a node in the tree. First, the points are ordered by increasing radial coordinates. The first node (the point with the smallest radial coordinate) is the root of the tree. Then the i th node ( i = 2, ..., N ) is connected to the closest one among ( 1, ..., i − 1 ), that is to the closest one having smaller radial coordinate. An example can be seen in Fig. 1 in which N = 200 nodes are placed uniformly on a disk of radius R = 9 . For illustration purposes, on the figure, the native representation of hyperbolic space is used; that is, in the drawings, we use hyperbolic coordinates as if they were Euclidean. Although this may cause some strange phenomena in the figures, the textual descriptions of the algorithms and examples become more comfortable to interpret. As the calculations and derivations do not rely on the properties of any specific representations, there is no reason to use more sophisticated models like the Poincarè disk or the Klein model in our investigations. In Fig. 2, a more complex example can be seen with R = 14 , N = 1000 . One can immediately notice that the nodes seem to be non-uniformly distributed on the disk. This is due to the non-isometric nature of the native representation. Note that all other representation models in the Euclidean plan lack isometry, the hyperbolic plane simply "too big", e.g., contains exponentially larger amount of space than the Euclidean one. In the case of the disk with a radius of 14, the total area is 2 (cosh 14 − 1) ≈ 3.78 × 10 6 . The half of this area is 1.8910 6 , which can be covered Points generated on a radius R = 9 hyperbolic disk according to uniform distribution (left side) and the hyperbolic tree inferred from this point (right side). One can observe that several links in the tree are oriented toward radial directions due to the explanation of hyperbolic distance characteristics Another strange phenomenon in Figs. 1 and 2 is that the orientation of most of the connections lies close to the radial direction. It seems that lots of node pairs (especially in the outer rim of the disk) should have been connected because they look to lie close enough to each other; further evidence that the hyperbolic distance calculation significantly differs from the Euclidean one. We demonstrate that with simple examples. In and 999 turn out to be much farther from each other than it seems in the native representation, becoming the first node the closest neighbor to both. Hence, they should not be connected. In fact, if the radial coordinates of two nodes are close to each other, the hyperbolic distance rapidly increases with increasing angular difference, especially in the range of small values. Figure 3 illustrates this behavior, in which the angular coordinate 999 of node 999 is varying from 936 to 936 − .
One can observe that node 999 would be closer to node 936 only in an extremely small range of 0 < < 0.00076 ; for all larger d(936, 999) > d(1, 999) holds.

Degree distribution of hyperbolic trees
In this section, the degree distribution of the nodes in the hyperbolic tree is investigated. First approximate analytical derivations are performed, than numerical experiments are presented. The derivation of the approximate degree distribution formula consists of three main steps. In the first step, the connection probability p(u, v) for In the second step, the conditional expected degree k (r u ) 1 is computed based on p(u, v) and the probability density of node v.
In the third step, the degree distribution is inferred from k (r u ) with appropriate deconditioning. Assume that N points are randomly placed on a disk of radius R evenly distributed over its area and a tree is generated applying the previously described algorithm. We can establish the probability p(u, v) that an arbitrary node pair (u, v) is connected. More specifically, p(u, v) is the probability that u and v are connected under the condition that r u < r v . 2 In Fig. 4, a node pair u, v are shown with r u < r v . According to the tree generation rule, v is connected to the closest node which has a smaller radial coordinate than r v . In a geometric interpretation, v connects to the closest node inside the O-centered disk of radius r v (red disk in the figure). The closest node will be exactly u when no points lie inside the intersection of the O-centered disk with radius r v and the v-centered disk with radius d(u, v) (green disk in the figure). The probability that all the N − 2 points fall outside the intersection area is , where A QP denotes the area of the intersection, and A R = 2 (cosh R − 1) is the area of the whole disk. It follows that where is the node density: What remains to be done to calculate the probability p(u, v) is to establish A QP . One can observe in Fig. 4 that A QP is equal to the sum of the two circle sectors POQ (red, sector angle is 2 ) and PvQ (green, sector angle is 2 ) minus the area of the two triangles PQO and PQv: where the area of the two triangles 2( − − 2 ) is already neglected. The angles and can be determined by applying the hyperbolic cosine law (1) to the triangle vOQ with edges OQ and vQ. From these and Now the Eqs. (6), (7) and (8) can be combined to get A QP as a function of d(u, v) and r v . Because the formula is a bit lengthy and not very expressive, it is not repeated here. However, based on a sequence of approximations a much simpler and useful expression can be obtained as by which we get a simple formulae for the approximation of the connection probability: At this point, it is practical to postpone the in-depth analysis of the details and quality of these approximations, as two more weighing functions are to appear in the computation of k (r u ) . Instead, an illustrative example is shown in Fig. 5 to study the performance of the different approximations of A QP , where r v = 7 is fixed and One can observe that for a wide range of d(u, v) values, the simpler approximation (9) is quite close to the more tedious one; the relative difference is below 5% is also a function of r u and r v itself, it is worth expanding it exploiting (1) as Now we can continue with the derivation of k (r u ) . Roughly speaking, k (r u ) is the expected number of neighbors of u when all nodes v, (r u < r v < R) are counted for which u is the closest. There is surely one more "downward" connection of u to a node with an even lower radial coordinate due to the tree generation rule (except when u has the smallest r u , but this exception does not influence the results). More formally, p(u, v) is to be integrated with the probability densities of r v and ( ) ∶= v − u (and a constant 1 should be added), that is First, consider the integral with respect to the angle difference : Interestingly enough, if we use approximation (14), it can be expressed exactly with two distinguished functions: the zero-order modified Bessel function I I I 0 (x) and the zero-order modified Struve function L L L 0 (x) where x = 4 e r u +r v 2 . It is known that for large x, I I I 0 (x) − L L L 0 (x) quickly tends 3 . to 2 x , therefore the right-hand side of the equation above is approximated by (11) cosh d(u, v) = cosh r u cosh r v − sinh r u sinh r v cos , 3 The asymptotic series expansion of I I I 0 (x) − L L L 0 (x) at x = ∞ starts with 2 x , see [22] . The asymptotic series expansion in this case means that lim x→∞ Putting it back to Eq. (15), we get Using the definition of node density = N 2 (cosh R−1) , we get Finally, we get the stunningly simple formula The final formula reflects the property observed in the previous numerical examples, namely that nodes with smaller radial coordinates tend to have a much higher number of connections. There is an interesting and easy way to perform a sanity check on the formula. All trees with N nodes have exactly N − 1 links, that is the grand average node degree is k = 2(N − 1)∕N ≈ 2 . This means that the result of integrating k (r u ) with respect to the density r u should be very close to 2: which differs from 2 with a negligible factor when R is not too small (for example, in case of R = 10 k = 1.98652).
As a third step, the complement cumulant degree distribution is derived, i.e., the probability that an arbitrary node degree is larger than a given value k, P(degree > k) is computed. Here we present an approximate and more perceptible reasoning instead of a sophisticated but tedious one. If we accept the approximation (21), than from its monotonicity if follows, that nodes with higher expected degrees than a given k are exactly inside the circle of radius r u (k) , where r u (k) is the inverse function of (21). One can also state that nodes with degrees exactly higher than a given k are expectedly inside the circle with radius r u (k) . These two statements are approximately equivalent; therefore, P(degree > k) can be approximated by the ratio of the area of r u (k)-disk and the R-disk Substituting the inverse function r u (k) = R − 2 log k into this equation is obtained, that is approximately a power-law distribution with parameter 2.

3 6 Numerical analysis
In this section, numerical results are presented in connection with synthetic and real networks embedded on the hyperbolic plane. First, the generative model for synthesizing complex networks on the hyperbolic plane is considered [12] . In the simplest case, the network generation rule is as follows: distribute N nodes uniformly on a hyperbolic disk with radius R then connect every node pair which are closer than R. It is analytically shown and numerically confirmed that the degree distribution of such networks follows power law, and the ccdf is proportional to k −2 [12,23].
Two numerical examples are presented for N = 1000 , R = 13 and for N = 3000 , R = 14 . In Figs. 6 and 7 the hyperbolic trees generated and the synthetic networks  can be seen. It is observable that despite the completely different generation rule the structure of the synthetic network is strongly hierarchical and resembles to the tree network. Moreover, 860 of the total 999 links can be found in the original network too. In the second example ( N = 3000 ) 2857 of the total 2999 tree links are also present in the synthetic network. The tree inclusion ratio in the first example is 860∕999 = 0.86 , while in the second example is as high as 2857∕2999 = 0.95 . We have performed more detailed numerical investigations on the inclusion ratio versus network size. The general observation is that the tree inclusion ratio is quickly increasing with increasing size of the network N. Table 1 summarizes the tree inclusion ratios for different sizes of networks averaged over 100 networks for every size.
The structural similarity is confirmed by the histograms for the degree distributions which are shown in Fig. 8. Note that the theoretical function k −2 well fits to the measured degree distribution of the tree and is in accordance with the similar decay in the synthetic network for larger values of k.
The degree distributions are also investigated on several networks with different sizes N. In all cases, the decay of the degree distributions is in accordance with the theoretical prediction, especially for larger networks and larger values of degree. In Fig. 9 the histograms of the degrees are shown for N = 1000, 2000, 5000, 10000 . One can observe that for small values of degrees ( k = 1..5 ), the theoretical function underestimates the measured frequency in all sizes a bit, and the estimation becomes more accurate for N > 2000 and k > 5 . Note that the very tail of the histograms are statistically less reliable due to the lack of enough data in the vicinity of the maximum degree, in these regions (i.e., N = 10000, k = 60-100) well fit to the theoretical curve cannot be expected. The hyperbolic tree networks are also generated and tested on two types of real networks embedded in the hyperbolic plane. Here we do not outline the embedding process; just note that the embedding process does not use algorithms based on any trees inferred from the original network. For more details of the embedding see [12,24,25]. Thus, our hyperbolic tree generation method does not "know" directly anything about any trees contained in the original real networks.
The first network is the US flight network, that was downloaded from the Bureau of Transportation Statistics http://transtats.bts.gov/ on 5 November 2017. It consists of 283 nodes and 1973 edges. In the network, the nodes are US airports. Two nodes are linked if a direct flight connects them. The hyperbolic tree and the original network are drawn in Fig. 10. The hyperbolic tree has 282 links of which 246 are also in the original network. It corresponds to a 87.2% tree inclusion ratio. The degree distributions of the hyperbolic tree and the original flight network can be seen in Fig. 11. One can observe that the decay of the histograms is different; however, both  are power-law functions which confirms our theoretical results. The flight network is embedded into a 11.3 radius disk determined by the embedding algorithm, so the average node density on this disk is about 0.0035.
The other network is the much larger Internet AS level topology. The corresponding data set representing the global Internet structure at the autonomous system (AS) level is from [26]. In this network, we use the inner core of 10000 nodes (out of the total 23748), the number of edges is 40605, and the network is embedded into a 26.87 radius disk. In this case, the node density is much lower, 6.83 × 10 −9 . The degree distribution can be seen in Fig. 12. Similar power-law behavior also appears here, the difference between the decay rates is smaller than in the previous case. The inclusion ratio of the hyperbolic tree in the original network is also as high as 84.7% . In both cases, the difference between the exponents of the power functions can be attributed to the fact that real network embeddings usually cause non-uniform node distributions. According to our numerical experiments, Fig. 11 US flight network and its tree degree distribution. The tree is generated based only on the hyperbolic coordinates Fig. 12 Internet AS level topology (inner core of 10000 nodes) and its tree degree distribution this non-uniformity results in a smaller change in the tree degree distribution than in that of the original network.

Routing efficiency of hyperbolic trees
In this section, the memory requirements of hop-by-hop routing is analyzed numerically when hyperbolic tree is used as a scaffold for the routing function. The analysis also contains the comparison to other spanning-tree-based routing algorithms. As presented in [4], the calculation of the information theoretical entropy of routing tables turned out to be a useful tool for estimating the total memory requirements. The hop-by-hop routing forwarding table of a node in an N-node network is an N− length string with the alphabet consisting of the node neighbor identifiers. The i th element of the table is j at node k means that the packet arrived at node k should be forwarded to node j (as next hop) in order to reach node i. The entropy of the node k routing table can be defined as where n i is the number of entries with the i th neighbor identifier, and k is the number of neighbors of node k. NH k can be interpreted as the information theoretic lower bound of the required number of bits to encode the whole routing table, and therefore, the required number of bits to represent all routing tables is at least N ∑ N k=1 H k . Therefore, from scalability point of view, the dependency of the whole routing entropy of the network H(N) ∶= ∑ N k=1 H k with respect to N has an utmost importance.
For the numerical analysis, first, a sequence of hyperbolic trees was generated with different sizes ( N = 100, 200, 500, 1000, 2000, 5000, 10000 ) ranging two orders of magnitudes of N. Then the forwarding tables of the hop-by-hop routing were inferred, and the entropy of the tables was calculated. At all sizes of N 100, random trees were generated in order to eliminate statistical fluctuations. The following table shows the average entropies H (N) (standard deviations in brackets) of hyperbolic trees with different sizes ( Table 2).
One can observe from the data set that the average total entropy H (N) increases with increasing N in a sub-linear manner. More accurate trend can be identified, if the data is plotted with a logarithmic scale x axis and a linear scale y axis.
As can be seen in Fig. 13 the average entropy values well fit on a line in this log-linear scaling, which means that the increase of H (N) with respect to N might approximately be in the order of O(log N) . This is a very nice  Because NH(N) is a lower bound for the expected total memory requirement of routing, we have also implemented the binary codes of the routing tables for all sizes mentioned above and counted the actual total memory usage of the forwarding tables. Huffman coding has been used, which is suitable for encoding routing tables due to its prefix nature. The actual memory usage is very close to the entropybased lower bound in all cases (the relative error is below 3%), Table 3 shows this observation.
In our next research task, we are going to show analytically this scaling behavior of routing table entropy in hyperbolic random trees.

Discussion
The scalability of memory usage in arbitrary trees can widely vary [4] depending on the structure of the tree. For example, in case of pure binary trees the total routing entropy function scales as O(log 2 (N)) , where N is the number of nodes in the tree. Another extreme example is the star network in which the total entropy is exactly The above scaling is desirable, but in case of general networks, it is impossible to generate spanning trees out of the original network edges that have similar structural characteristics. Furthermore, standard spanning tree generation algorithms neither can provide the structural similarities to the original network, which might be a further reason of the diverse scaling behavior of tree routing in general. Reversing the train of thoughts, one can suspect that increasing trees showing structural similarities might result in a focused, and well-characterizable scaling behavior. Because the hyperbolic plane can be used to generate increasing sequence of networks sharing similar structural properties, we expected the same in our hyperbolic tree generation method. This is confirmed by the observed similar scale-free degree distributions for two orders of magnitude in tree sizes (Fig. 9). With respect to the high inclusion ratios of hyperbolic trees in real-world complex networks the phenomenon can mainly be attributed to the strong hierarchical and self-similar characteristic of complex networks [27]. Finally, we note that according to our preliminary numerical studies, in the presented hyperbolic tree model, not only the node degrees are distributed in a scale-free manner, but the size of the subtrees originating from the nodes at different levels has also scale-free distribution. Sub-tree sizes play a direct role in the routing entropy calculations; the good scaling behavior of routing entropy in our hyperbolic trees is likely due to the widely-spread sub-tree size distribution.

Conclusion
A new hyperbolic tree generation method has been presented. The generating algorithm is based on the presumption that the successful navigability of many real networks is key to their evolution. Both analytically and by numerical experiments on synthetic and real data, it is shown that the degree distribution of the trees generated is approximately a power function. It has also been demonstrated that the trees are present to a large extent in real and synthetic networks and that hop-by-hop routing with hyperbolic trees is efficient in terms of total memory usage of forwarding tables.
The generation of the synthetic networks is carried out purely in a technical computing environment, as only topology information is to be used for the research. Due to the compact models applied, the complexity of the generation did not exceeded the square of the number of the nodes in the network: The  O(log(N)) .
hyperbolic networks used simple random node generation on a planar disk with edges added depending on the distances between the nodes. Further, routing tables in synthetic, as well as, in networks obtained from public measurement databases are calculated on-the-fly during the edge creation phase. In a real environment, simple modification of spanning tree protocols like STP (Spanning Tree Protocol) are available to carry out that function. With respect to direct application of the results, the question arises as to how to circumvent the (although rare) problem of the addition of non-existent physical connections in real technological networks. On the other hand, thinking in terms of the softwarized networking paradigm like the SDN (Software Defined Networking), in overlay networks, topology changes like the generation of new edges boils down to a simple reconfiguration process. Further real implementation problems may arise in heavy dynamic environments where the generation time of the navigation tree has strong real-time constraints. In such cases, e.g., auxiliary routing mechanisms may temporarily be applied to eliminate connection service disruption in the system. Finally, our results open further research questions on the deeper relation between navigable hyperbolic trees and the structural evolution of networks.
Funding Open access funding provided by Budapest University of Technology and Economics. Project no. 124171, 128062 and 135606 have been implemented with the support provided from the National Research, Development and Innovation Fund of Hungary, financed under the K_17, K_18 and ANN_20 funding schemes respectively.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.