Many graph processing algorithms require determination of shortest-path distances between arbitrary numbers of node pairs. Since computation of exact distances between all node-pairs of a large graph, e.g., 10M nodes and up, is prohibitively expensive both in computational time and storage space, distance approximation is often used in place of exact computation. A distance oracle is a data structure that answers inter-point distance queries more efficiently than in standard O(n 2 ) in time or storage space for an n node graph, e.g., in O(nlogn). In this paper, we present a novel and scalable distance oracle that leverages the hyperbolic core of real-world large graphs for fast and scalable distance approximation via spanning trees. We show empirically that the proposed oracle significantly outperforms prior oracles on a random set of test cases drawn from public domain graph libraries. There are two sets of prior work against which we benchmark our approach. The first set, which often outperforms all other oracles, employs embedding of the graph into low dimensional Euclidean spaces with carefully constructed hyperbolic distances, but provides no guarantees on the distance estimation error. The second set leverages Gromov-type tree contraction of the graph with the additive error guaranteed not to exceed 2δ logn, where δ is the hyperbolic constant of the graph. We show that our proposed oracle 1) is significantly faster than those oracles that use hyperbolic embedding (first set) with similar approximation error and, perhaps surprisingly, 2) exhibits substantially lower average estimation error compared to Gromovlike tree contractions (second set). We substantiate our claims through numerical computations on a collection of a dozen real world networks and synthetic test cases from multiple domains, ranging in size from 10s of thousand to 10s of millions of nodes.
Let G = (V,E) be a weighted undirected graph with |V | = n and |E| = m. An estimate ( u,v ) of the distance ( u,v ) in G between u, v V is said to be of stretch t iff ( u,v ) ( u,v ) t ? ( u,v ). The most efficient algorithms known for computing small stretch distances in G are the approximate distance oracles of [16] and the three algorithms in [9] to compute all-pairs stretch t distances for t = 2, 7 3, and 3. We present faster algorithms for these problems. For any integer k 1, Thorup and Zwick in [16] gave an O(kmn^ 1 k ) algorithm to construct a data structure of size O(kn^ 1+1 k ) which, given a query (u, v) V ? V , returns in O(k) time, a 2k - 1 stretch estimate of ( u,v ). But for small values of k, the time to construct the oracle is rather high. Here we present an O(n^2 log n) algorithm to construct such a data structure of size O(kn^ 1+1 k ) for all integers k 2. Our query answering time is O(k) for k 2 and (log n) for k = 2. We use a new generic scheme for all-pairs approximate shortest paths for these results. This scheme also enables us to design faster algorithms for allpairs t-stretch distances for t = 2 and 7 3, and compute all-pairs almost stretch 2 distances in O(n^2 log n) time. Let G = (V,E) be an undirected weighted graph with vVv = n and vEv = m. Let k ≥ 1 be an integer. We show that G = (V,E) can be preprocessed in O(kmn1 k) expected time, constructing a data structure of size O(kn1p1 k), such that any subsequent distance query can be answered, approximately, in O(k) time. The approximate distance returned is of stretch at most 2k−1, that is, the quotient obtained by dividing the estimated distance by the actual distance lies between 1 and 2k−1. A 1963 girth conjecture of Erdos, implies that Ω(n1p1 k) space is needed in the worst case for any real stretch strictly smaller than 2kp1. The space requirement of our algorithm is, therefore, essentially optimal. The most impressive feature of our data structure is its constant query time, hence the name "oracle". Previously, data structures that used only O(n1p1 k) space had a query time of Ω(n1 k).Our algorithms are extremely simple and easy to implement efficiently. They also provide faster constructions of sparse spanners of weighted graphs, and improved tree covers and distance labelings of weighted or unweighted graphs. We give the first improvement to the space approximation trade-off of distance oracles since the seminal result of Thorup and Zwick [STOC'01]. For unweighted graphs, our distance oracle has size @math and, when queried about vertices at distance @math , returns a path of length @math . For weighted graphs with @math edges, our distance oracle has size @math and returns a factor 2 approximation. Based on a plausible conjecture about the hardness of set intersection queries, we show that a 2-approximate distance oracle requires space @math . For unweighted graphs, this implies a @math space lower bound to achieve approximation @math . Thorup and Zwick, in the seminal paper [Journal of ACM, 52(1),2005, pp 1-24], showed that a weighted undirected graph onnvertices can be preprocessed in subcubic time to designa data structure which occupies only subquadratic space, and yet,for any pair of vertices, can answer distance query approximatelyin constant time. The data structure is termed as approximatedistance oracle. Subsequently, there has been improvement in theirpreprocessing time, and presently the best known algorithms [4,3]achieve expected O(n2) preprocessingtime for these oracles. For a class of graphs, these algorithmsindeed run in θ(n2) time. Inthis paper, we are able to break this quadratic barrier at theexpense of introducing a (small) constant additive error forunweighted graphs. In achieving this goal, we have been able topreserve the optimal size-stretch trade offs of the oracles. One ofour algorithms can be extended to weighted graphs, where theadditive error becomes 2·wmax(u,v) - herewmax(u,v) is the heaviestedge in the shortest path between vertices u,v. Let G e (V, E) be an undirected graph on n vertices, and let Δ(u, v) denote the distance in G between two vertices u and v. Thorup and Zwick showed that for any positive integer t, the graph G can be preprocessed to build a data structure that can efficiently report t-approximate distance between any pair of vertices. That is, for any u, v ∈ V, the distance reported is at least Δ(u, v) and at most tΔ(u, v). The remarkable feature of this data structure is that, for t≥3, it occupies subquadratic space, that is, it does not store all-pairs distances explicitly, and still it can answer any t-approximate distance query in constant time. They named the data structure “approximate distance oracle” because of this feature. Furthermore, the trade-off between the stretch t and the size of the data structure is essentially optimal.In this article, we show that we can actually construct approximate distance oracles in expected O(n2) time if the graph is unweighted. One of the new ideas used in the improved algorithm also leads to the first expected linear-time algorithm for computing an optimal size (2, 1)-spanner of an unweighted graph. A (2, 1) spanner of an undirected unweighted graph G e (V, E) is a subgraph (V, E), E ⊆ E, such that for any two vertices u and v in the graph, their distance in the subgraph is at most 2Δ(u, v) p 1. This paper addresses the non-linear isomorphic Dvoretzky theorem and the design of good approximate distance oracles for large distortion. We introduce and construct optimal Ramsey partitions, and use them to show that for every (0, 1), any n-point metric space has a subset of size n^ 1 - which embeds into Hilbert space with distortion O(1 ). This result is best possible and improves part of the metric Ramsey theorem of Bartal, Linial, Mendel and Naor [5], in addition to considerably simplifying its proof. We use our new Ramsey partitions to design approximate distance oracles with a universal constant query time, closing a gap left open by Thorup and Zwick in [26]. Namely, we show that for any n point metric space X, and k 1, there exists an O(k)-approximate distance oracle whose storage requirement is O(n^ 1 + 1 k ), and whose query time is a universal constant. We also discuss applications to various other geometric data structures, and the relation to well separated pair decompositions.