The Interdisciplinary Center, Herzlia Efi Arazi School of Computer Science
M.Sc. program - Research Track
Efficient Dynamic Approximate
Distance Oracles for Vertex-
Labeled Planar Graphs
Submitted by Itay Laish
Under the supervision of Dr. Shay Mozes.
M.Sc. dissertation, submitted in partial fulfillment of the requirements
for the M.Sc. degree, research track, School of Computer Science
The Interdisciplinary Center, Herzliya
July 2017
Acknowledgements
First of all, I would like to thank my advisor Dr. Shay Mozes, for providing me much
needed directions, especially, when I was sure I'm facing a dead end, and for introducing
me to the world of research, and investing exponential amount of time, teaching and
tutoring me. His way of thinking and passion to find efficient, yet elegant solutions inspired
me, and gave me the drive to look deeper and wider, and to seek for ideas in different
places.
Second, I would like to thank PaweÅ Gawrychowski and Oren Weimann for fruitful
discussions, and for well appreciated tips, that found their way into this research.
Abstract
Let šŗ be a graph where each vertex is associated with a label. An Approximate Vertex-
Labeled Distance Oracle is a data structure that, given a vertex š£ and a label š, returns a
(1 + š)-approximation of the distance from š£ to the closest vertex with label š in šŗ. Such
an oracle is dynamic if it also supports label changes. In this thesis we present three
different dynamic approximate vertex-labeled distance oracles for planar graphs, all with
polylogarithmic query and update times, and nearly linear space requirements. No
previously known approximate vertex-labeled distance oracle supported both queries and
updates in sublinear time.
Contents
1 Introduction 5
1.1 Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . 61.2 Our Results and Techniques . . . . . . . . . . . . . . . . . . 7
2 Preliminaries 10
2.1 Existing techniques . . . . . . . . . . . . . . . . . . . . . . . 12
3 Undirected Graphs With Faster Query 16
3.1 Warm Up: The Static Case . . . . . . . . . . . . . . . . . . 173.2 The Dynamic Case . . . . . . . . . . . . . . . . . . . . . . . 20
4 Directed Graphs 23
4.1 Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264.2 Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5 Undirected Graphs With Faster Update 32
6 Concluding remarks 38
Bibliography 40
Appendix 43
4
1 Introduction
Consider the following scenario. A 911 dispatcher receives a call about are and needs to dispatch the closest re truck. There are two dicultieswith locating the appropriate vehicle to dispatch. First, the vehicles areon a constant move. Second, there are dierent types of emergency vehi-cles, whereas the dispatcher specically needs a re truck. Locating theclosest unit of certain type under these assumptions is the dynamic vertex-labeled distance query problem on the road network graph. Each vertex inthis graph can be annotated with a label that represents the type of theemergency vehicle currently located at that vertex. An alternative scenariowhere this problem is relevant is when one wishes to nd a service provider(e.g., gas station, coee shop), but dierent locations are open at dierenttimes of the day.
A data structure that answers distance queries between a vertex and alabel, and supports label updates is called a dynamic vertex-labeled distanceoracle. We model the road map as a planar graph, and extend previousresults for the static case (where labels are xed). We present oracles withpolylogarithmic update and query times (in the number of vertices) thatrequire nearly linear space.
We focus on approximate vertex-labeled distance oracles for xed pa-rameter Īµ ā„ 0. When queried, such an oracle returns at least the truedistance, but not more than (1 + Īµ) times the true distance. These are alsoknown as stretch-(1 + Īµ) distance oracles. Note that, in our context, thegraph is xed, and only the vertex labels change.
5
1. INTRODUCTION 6
1.1 Related Work
Approximate vertex-to-vertex distance oracles
We outline related results, and refer the reader to an extensive survey dueto Sommer [Som14]. For general graphs, Thorup and Zwick [TZ01] pre-sented for every k ā„ 2 a stretch-(2k ā 1) vertex-to-vertex distance oracle
for undirected graphs with O(kn1+ 1k ) space, and O(k) query time. Their
oracle can be constructed in O(kmn1+ 1k ) time. Wul-Nilsen [Wul12] gave
an oracle with similar space and query time, and O(kn1+ ck ) construction
time. Here c is some universal constant.For planar graphs, Thorup [Tho04] presented a stretch-(1 + Īµ) distance
oracle for directed planar graphs, for any 0 < Īµ < 1. His oracle requiresO(Īµā1n log n log(nN)) space and answers queries in O(log log (nN) + Īµā1)time. Here N denotes the ratio of the largest to smallest arc length. Forundirected planar graphs Thorup presented an oracle that can be stored us-ingO(Īµā1n log n) space, and can answer queries inO(Īµā1) time. Klein [Kle02,Kle05] independently described a stretch-(1 + Īµ) distance oracle for undi-rected graphs with the same bounds, but faster preprocessing time. Kawarabayashi,Klein and Sommer [KKS11], extended Thorup's result to other families ofrestricted graphs (e.g. minor free, bounded genus) and improved its spacerequirements to O(n) in the cost of increasing the query time by a factorof Īµā1 log2 n. Kawarabayashi, Sommer and Thorup [KST13] reduced thespace dependency by a factor of Īµā1 log n, while keeping the query time ofO(Īµā1). They also show an oracle for unweighted graphs that can be storedusing O(n) space, and has O(Īµā1) query time. Abraham, Chechik andGavoille [ACG12] presented a stretch-(1 + Īµ) distance oracle that supportsboth query and edge length updates in O(n1/2) time worst case. Abra-ham et al. [ACD+16] later provided an oracle with polylogarithmic updateand query time for planar graphs, when the edge lengths can only changewithin a predetermined ratio. In this work, we consider a dierent setting ofupdates, where the edge lengths are xed, and only the vertex label change.
Approximate vertex-to-label distance oracles
The vertex-to-label query problem was introduced at ICALP'11 by Her-melin, Levy, Weimann and Yuster [HLWY11]. For any k ā„ 2, They pre-sented a stretch-(4k ā 5) distance oracle for undirected general (i.e. not
1. INTRODUCTION 7
necessarily planar) graphs with O(kn1+ 1k ) space and query time O(k). In
a second result, they gave a dynamic label-to-vertex distance oracle thatcan handle label changes in sub-linear time, but with exponential stretch interms of k, (2 Ā· 3kā1 + 1). Chechik [Che12] later improved their results,
and presented a stretch-(4k ā 5) distance oracle that requires O(n1+ 1k )
expected space, and supports queries in O(k) time, and label changes in
O(n1k log1ā 1
k n log log n) time. Her oracle can be constructed usingO(kmn1k )
time.The rst result for the static vertex-to-label query problem for undirected
planar graphs is due to Li, Ma and Ning [LMN13]. They described a stretch-(1 + Īµ) distance oracle that is based on Klein's results [Kle02]. Their oraclerequires O(Īµā1n log n) space, and answers queries in O(Īµā1 log n log ā) time.Here ā is the hop-diameter of the graph, which can be Ī(n). Mozes andSkop [MS15], building on Thorup's oracle, described a stretch-(1 + Īµ) dis-tance oracle for directed planar graphs that can be stored usingO(Īµā1n log n log(nN))space, and has O(log log n log log nN + Īµā1) query time.
Li Ma and Ning [LMN13] considered the dynamic case, but their updatemethod was trivial and takes Ī(n log n) time in the worst case. Ā”cki etal. [aOP+15] presented a dierent dynamic vertex-to-label oracle for undi-rected planar graphs, in the context of computing Steiner trees. Theirorcale requires O(
ān log2 n logDĪµā1) amortized time per update or query
(in expectation), where D is the stretch of the metric of the graph (could benN). Their oracle however does not support changing the label of a specicvertex. Instead, they represent the labels in a forest, and support mergingtwo labels by connecting two trees in the forest. Likewise, they supportsplitting labels by removing an edge from the forest, dividing a single treeinto two trees.
To the best of our knowledge, our distance oracles are the rst stretch(1 + Īµ) vertex-to-label distance oracles with polylogarithmic query and up-date times, and the rst that support directed planar graphs.
1.2 Our Results and Techniques
We present three approximate vertex-labeled distance oracles with polylog-arithmic query and update times and nearly linear space and preprocessingtimes. Our update and construction times are expected amortized due to
1. INTRODUCTION 8
the use of dynamic hashing.1 Our solutions dier in the tradeo betweenquery and update times. One solution works for directed planar graphs,whereas the other two only work for undirected planar graphs.
We obtain our results by building on and combining existing techniquesfor the static case. All of our oracles rely on recursively decomposing thegraph using shortest paths separators. Our rst oracle for undirected graphs(Section 3) uses uniformly spaced connections, and eciently handles themusing fast predecessor data structures. The upshot of this approach is thatthere are relatively few connections. The caveat is that this approach onlyworks when working with bounded distances, so a scaling technique [Tho04]is required.
Our second oracle for undirected graphs (Section 5) uses the approachtaken by Li, Ma and Ning [LMN13] in the static case. Each vertex has adierent set of connections, which are handled eciently using a dynamicprex minimum query data structure. Such a data structure can be ob-tained using a data structure for reporting points in a rectangular region ofthe plane [Wil14].
Our oracle for directed planar graphs (Section 4) is based on the staticvertex-labeled distance oracle of [MS15], which uses connections for sets ofvertices (i.e., a label) rather than connections for individual vertices. Weshow how to eciently maintain the connections for a dynamically changingset of vertices using a bottom-up approach along the decomposition of thegraph.
Our data structures support both queries and updates in polylogarith-mic time. No previously known data structure supported both queries andupdates in sublinear time. The following table summarizes the comparisonbetween our oracles and the relevant previously known ones.
1We assume that a single comparison or addition of two numbers takes constant
time.
1. INTRODUCTION 9
Table 1.1: Vertex-to-Label Distance Oracles Time Bound Comparison
D/U Query time Update time
Li, Ma and Ning [LMN13] U O(Īµā1 log n log ā) O(n log n)
Ā”cki at el. [aOP+15] U O(Īµā1ān log2 n logD) O(Īµā1
ān log2 n logD)
Section 3 (faster query) U O(Īµā1 log n log log nN) O(Īµā1 log n log log Īµā1 log nN)
Section 5 (faster update) U O(Īµā1 log2 (Īµā1n)log log (Īµā1n)
) O(Īµā1 log1.51(Īµā1n))
Mozes and Skop [MS15] D O(Īµā1 + log log n log log nN) N/A
Section 4 D O(Īµā1 log n log log nN) O(Īµā1 log3 n log nN)In the table above, D/U stands for Directed and Undirected graphs.
2 Preliminaries
An undirected (respectively directed) graph G is a tuple consisting of anite set of objects named vertices, denoted by V (G), and a set of edges(resp, arcs) denoted by E(G). An undirected (resp. directed) edge (resp.arc), is an unordered (resp. ordered) pair of vertices. Given an edge e = uv,we say that u and v are the endpoints of e. If e is an arc (in a directedgraph), we say that the orientation of e is from u to v. An undirected (resp.directed) u-to-v path P is a sequence of vertices in V (G), that starts withu, ends with v, and for every pair (x, y) ā P there exists an edge (resp. anarc) xy ā E(G). A path P is called a simple path if every vertex in V (G)appears at most once in P . A cycle C is a path that begins and ends in thesame vertex. Analogously, a simple cycle is a cycle such that every vertexin C appears at most once, except from the rst vertex, that is also thelast.
For a directed graph G, we let Gā² be the underlying undirected graphwhose vertices V (Gā²) = V (G), and for every u, v ā V (G), E(Gā²) containsan edge uv if and only if E(G) contains the arc uv or the arc vu. We saythat the graph G is connected if for every u, v ā V (G) there exists an u-to-vpath in Gā².
An undirected tree T is an undirected connected graph that contains nocycles. I.e. for every pair of vertices u, v there exists a unique path fromu to v. A vertex v ā V (T ) is called a leaf of T if it is adjacent to atmost one other vertex. A rooted undirected tree is a tree T equipped witha vertex r ā V (T ) referred to as root. A spanning tree T of a graph Gis a subgraph of G (respectively, if G is directed, T is a subgraph of theunderlying undirected graph Gā²) consisting of |V (G)ā 1| edges from E(G)(resp. E(Gā²)), that forms a tree, such that for every v ā V (G) there existsa r-to-v path in T .
Let T be an undirected rooted tree. Let A(Ā·) be a boolean property that
10
2. PRELIMINARIES 11
is dened over the vertices of T . For every v ā V (T ), we say that a vertexu is the root-most vertex on the v-to-root path P in T that fullls A, if uis the closest vertex to the root of T on the v-to-root path that fullls A.
Given an undirected graph G with a spanning tree T rooted at r andan edge uv not in T , the fundamental cycle of uv (with respect to T ) is thecycle composed of the r-to-u and r-to-v paths in T , and the edge uv.
Let ` : E(G) ā R+ be a non-negative length function. Let N be theratio of the maximum and minimum values of `(Ā·). Let P be a path from u-to-v. The length of P is Ī£eāP `(e). The shortest u-to-v path is a path thatminimizes that distance. We dene the distance form u-to-v denoted byĪ“G(u, v), as the length of a shortest u-to-v path. We assume, only for easeof presentation, that shortest paths are unique. This assumption is onlyused when we present our algorithms and refer the shortest path betweentwo vertices. Our data structures do not require this assumption. For asimple path Q and a vertex set U ā V (Q) with |U | ā„ 2, we dene QU , thereduction of Q to U as a path whose vertices are U . Consider the verticesof U in the order in which they appear in Q. For every two consecutivevertices u1, u2 of U in this order, there is an arc u1u2 in QU whose lengthis the length of the u1-to-u2 sub-path of Q.
Let L be a set of labels. We say that a graph G is vertex-labeled if everyvertex is assigned a single label from L. For a label Ī» ā L, let SĪ»G denotethe set of vertices in G with label Ī». We dene the distance from a vertexu ā V (G) to the label Ī» by Ī“G(u, Ī») = minvāSĪ»G Ī“G(u, v). If G does not
contain the label Ī», or Ī» is unreachable from u, we say that Ī“G(u, Ī») =ā.
Denition 1. For a xed parameter Īµ ā„ 0, a stretch-(1 + Īµ) vertex-labeleddistance oracle is a data structure that, given a vertex u ā V (G) and a labelĪ» ā L, returns a distance d satisfying Ī“G(u, Ī») ā¤ d ā¤ (1 + Īµ)Ī“G(u, Ī»).
Denition 2. For xed parameters Ī±, Īµ ā„ 0, a scale-(Ī±, Īµ) vertex-labeleddistance oracle is a data structure that, given a vertex u ā V (G) and a labelĪ» ā L, such that Ī“G(u, Ī») ā¤ Ī±, returns a distance d satisfying Ī“G(u, Ī») ā¤d ā¤ Ī“G(u, Ī») + ĪµĪ±. If Ī“G(u, Ī») > Ī±, the oracle returns ā.
The only properties of planar graphs that we use in this paper are theexistence of shortest path separators (see below), and the fact that singlesource shortest paths can be computed in O(n) time in a planar graph withn vertices [HKRS97].
2. PRELIMINARIES 12
Denition 3. Let G be a directed graph. Let Gā² be the undirected graphinduced by G. Let P be a path in Gā². Let S be a set of vertex disjoint directedshortest paths in G. We say that P is composed of S if (the undirected pathcorresponding to) each shortest path in S is a subpath of P and each vertexof P is in some shortest path in S.
Denition 4. Let G be a directed embedded planar graph. An undirectedcycle C is a balanced cycle separator of G if each of the strict interior andthe strict exterior of C contains at most 2|V (G)|/3 vertices. If, additionally,C is composed of a constant number of directed shortest paths, then C iscalled a shortest path separator.
Let G be a planar graph. We assume that G is triangulated since we cantriangulate G with innite length edges, so that distances are not aected.It is well known [LT79, Tho04] that for any spanning tree of G, there existsa fundamental cycle C that is a balanced cycle separator. The cycle C canbe found in linear time. Note that, if T is chosen to be a shortest pathtree, or if any root-to-leaf path of T is composed of a constant number ofshortest paths, then the fundamental cycle C is a shortest path separator.
2.1 Existing Techniques for Approximate
Distance Oracles for Planar Graphs
Thorup shows that to obtain a stretch-(1 + Īµ) distance oracle, it suces toshow scale-(Ī±, Īµ) oracles for so-called Ī±-layered graphs. An Ī±-layered graphis one equipped with a spanning tree T such that each root-to-leaf path inT is composed of O(1) shortest paths, each of length at most Ī±. This issummarized in the following lemma:
Lemma 1. [Tho04, Lemma 3.9] For any planar graph G and xed param-eter Īµ, a stretch-(1 + Īµ) distance oracle can be constructed using O(log nN)scale-(Ī±, Īµā²) distance oracles for Ī±-layered graphs, where Ī± = 2i, i = 0, ...dlog nNeand Īµā² ā 1/2, Īµ/4. If the scale-(Ī±, Īµā²) has query time t(Īµā²) independent ofĪ±, the stretch-(1 + Īµ) distance oracle can answer queries in O(t(1/2)Īµā1 +t(Īµ/4) log log (nN)).
All of our distance oracles are based on a recursive decomposition of Gusing shortest path separators. If G is undirected (but not necessarily Ī±-layered), we can use any shortest path tree to nd a shortest path separator
2. PRELIMINARIES 13
in linear time. Similarly, if G is Ī±-layered, we can use the spanning tree Gis equipped with to nd a shortest path separator in linear time.
We recursively decompose G into subgraphs using shortest path separa-tors until each subgraph has a constant number of vertices. We representthis decomposition by a binary tree TG. To distinguish the vertices of TGfrom the vertices of G we refer the former as nodes.
Each node r of TG is associated with a subgraph Gr. The root of TGis associated with the entire graph G. We sometimes abuse notation andequate nodes of TG with their associated subgraphs. For each non-leaf noder ā TG, let Cr be the shortest path separator of Gr. Let Sepr be the set ofshortest paths Cr is composed of. The subgraphs Gr1 and Gr2 associatedwith the two children of r in TG are the interior and exterior of Cr (w.r.t.Gr), respectively. Note that Cr belongs to both Gr1 and Gr2 . For a vertexv ā V (G), we denote by rv the leaf node of TG that contains v. See Fig. 2.1for an illustration.
We now describe the basic building block used in our (and in manyprevious) distance oracle. Let u, v be vertices in G. Let Q be a path onthe root-most separator (i.e., the separator in the node of TG closest to itsroot) that is intersected by the shortest u-to-v path P . Let t be a vertex inQā©P . Note that Ī“G(u, v) = Ī“G(u, t)+Ī“G(t, v). Therefore, if we stored for uthe distance to every vertex on Q, and for v the distance from every vertexon Q, we would be able to nd Ī“G(u, v) by iterating over the vertices of Q,and nding the one minimizing the distance above. This, however, is notecient since the number of vertices on Q might be Īø(|V (G)|). Instead, westore the distances for a subset of Q. This set is called an (Ī±, Īµ)-coveringconnections set.
Denition 5 ((Ī±, Īµ)-covering connections set). [Tho04, Section 3.2.1] LetĪµ, Ī± ā„ 0 be xed constants. Let G be a directed graph. Let Q be a shortestpath in G of length at most Ī±. For u ā V (G) we say that CG(u,Q) ā V (Q)is an (Ī±, Īµ)-covering connections set from u to Q if and only if for everyvertex t on Q s.t. Ī“G(u, t) ā¤ Ī±, there exists a vertex q ā CG(u,Q) such thatĪ“G(u, q) + Ī“G(q, t) ā¤ Ī“G(u, t) + ĪµĪ±.
One denes (Ī±, Īµ)-covering connections sets CG(Q, u) from Q to u sym-metrically. Thorup proves that there always exists an (Ī±, Īµ)-covering con-nections set of size O(Īµā1):
2. PRELIMINARIES 14
š¢
š®
šŗ0 šŗ1
šŗ10
šŗ11
š1
š
š0
š11 š10
šš¢
ā¦
š£š®
šŗ111
šŗ110 š111 š110
š£
šš£
ā¦
Figure 2.1: An illustration of (part of) the recursive decomposition of agraph G using cycle separators, and the corresponding decomposition treeTG. The graph G is decomposed using a cycle separator into G0, and G1.Similarly, G1 is decomposed into G10 and G11, and G11 is decomposed intoG110 and G111. The node r is the root of TG and is associated with Gr = G.Similarly, r1 is associated with G1, etc. The nodes ru and rv are the leafnodes that contain u and v, respectively. The node r1 is the root-most nodewhose separator is intersected by the shortest u-to-v path in G (indicatedin blue). Hence, this path is fully contained in Gr1 = G1.
Lemma 2. [Tho04, Lemma 3.4] Let G,Q, Īµ, Ī± and u be as in denition 5.There exists an (Ī±, Īµ)-covering connections set CG(u,Q) of size at mostd2Īµā1e. This set can be found in O(|Q|) if the distances from u to everyvertex on Q are given.
We will use the term Īµ-covering connections set whenever Ī± is obviousfrom the context. Thorup shows that (Ī±, Īµ)-covering connections sets canbe computed eciently.
Lemma 3. [Tho04, Lemma 3.15] Let H be an Ī±-layered graph. In O(Īµā2n log3 n)time and O(Īµā1n log n) space one can compute and store a decomposition THof H using shortest path separators, along with (Ī±, Īµ)-covering connections
2. PRELIMINARIES 15
sets CH(u,Q) and CH(Q, u) for every vertex u ā V (H), every ancestor noder of ru in TH , and every Q ā Sepr.
3 An Oracle for Undirected
Graphs With Faster Query
Let H be an undirected Ī±-layered graph,1 and let T be the associated span-ning tree of H. For any xed parameter Īµā² we set Īµ = Īµā²
3. We decompose
H using shortest path separators w.r.t. T . Let TH be the resulting decom-position tree. For every node r ā TH and every shortest path Q ā Sepr,we select a set CQ ā V (Q) of Īµā1 connections evenly spread intervals alongQ.2 Thus, for every vertex t ā V (Q) there is a vertex q ā CQ such thatĪ“H(t, q) ā¤ ĪµĪ±.
For each r ā TH , for each shortest path Q ā Sepr, for each q ā CQ,we compute in O(|Hr|) time a shortest path tree in Hr rooted at q us-ing [HKRS97]. This computes the connection lengths Ī“Hr(u, q), for allu ā V (Hr).
Lemma 4. Let u ā V (H). For every ancestor node r ā TH of ru, andevery Q ā Sepr, CQ is a 2Īµ-covering connections set from u to Q.
Proof. Let t ā Q. We need to show that there exist q ā CQ such thatĪ“Hr(u, t) ā¤ Ī“Hr(u, q) + Ī“Hr(q, t) ā¤ Ī“Hr(u, t) + Īµā²Ī±. Since t ā Q, there exists avertex q ā CQ such that Ī“H(q, t) ā¤ ĪµĪ±. Since H is undirected, the triangleinequality for shortest path lengths holds for any three vertices in V (H).
1 The discussion of Ī±-layered graphs in Section 2 refers to directed graphs, and hence
also applies to undirected graphs.2We assume that the endpoints of the intervals are vertices on Q, since otherwise
once can add articial vertices on Q without asymptotically changing the size of the
graph.
16
3. UNDIRECTED GRAPHS WITH FASTER QUERY 17
We start with the triangle inequality between u, t and q in H as follows.
Ī“Hr(u, q) ā¤ Ī“Hr(u, t) + Ī“Hr(t, q) (3.1)
Ī“Hr(u, q) + Ī“Hr(t, q) ā¤ Ī“Hr(u, t) + Ī“Hr(t, q) + Ī“Hr(t, q) (3.2)
Ī“Hr(u, q) + Ī“Hr(t, q) ā¤ Ī“Hr(u, t) + 2ĪµĪ± (3.3)
From the triangle inequality, Ī“Hr(u, t) ā¤ Ī“Hr(u, q) + Ī“Hr(q, t), and thelemma follows.
šš¼ šš¼
šš¼ šš¼
šš¼
š
š
š£
š”
Figure 3.1: Illustration of Lemma 4. Q is a shortest path in some separator,the connections of CQ are marked by triangles. The solid v-to-q path reectsthe shortest path from v to the connection q, and the dashed v-to-t pathreects the shortest path from v to t.
3.1 Warm Up: The Static Case
We start by describing our data structure for the static case with a singlexed label Ī» (i.e., each vertex either has label Ī» or no label at all). Forevery node r ā TH , let SĪ»r be the set of Ī»-labeled vertices in Hr. For everyseparator Q ā Sepr, every vertex q ā CQ, and every vertex v ā SĪ»r let
3. UNDIRECTED GRAPHS WITH FASTER QUERY 18
Ī“Hr(q, v) = kĪµĪ± where k is the smallest value such that Ī“Hr(q, v) ā¤ kĪµĪ±.Thus, Ī“Hr(q, v) ā¤ Ī“Hr(q, v) ā¤ Ī“Hr(q, v) + ĪµĪ±. Let Lr(q, Ī») be the list of thedistances Ī“Hr(q, v) for all v ā SĪ»r . We sort each list in ascending order.Thus, the rst element of Lr(q, Ī») denoted by first(Lr(q, Ī»)) is at most ĪµĪ±more than the distance from q to the closest Ī»-labeled vertex inHr. We notethat each vertex u ā V (H) may contribute its distance to O(Īµā1 log n) lists.Hence, we have O(Īµā1n log n) elements in total. Since H is an Ī±-layeredgraph, the length of each Q is bounded by Ī±. Hence, the universe of theselists can be regarded as non-negative integers bounded by Ī±
ĪµĪ±= Īµā1. Thus,
these lists can be sorted in total O(Īµā1n log n) time.
Query(u,Ī»)
Given u ā H. We wish to nd the closest Ī»-labeled vertex v to u in H. Foreach ancestor r of ru, for each Q ā Sepr, we perform the following search.We inspect for every q ā CQ, the distance Ī“Hr(u, q) + first(Lr(q, Ī»)). Wealso inspect the Ī»-labeled vertices inHru explicitly. We return the minimumdistance inspected. See Fig. 3.2 for an illustration.
Lemma 5. The query algorithm runs in O(Īµā1 log n) time, and returns adistance d such that Ī“H(u, Ī») ā¤ d ā¤ Ī“H(u, Ī») + 3ĪµĪ±.
Proof. Let v be the closest Ī»-labeled to u in H. It is trivial that if theshortest path P form u-to-v does not leave ru = rv the query algorithm iscorrect, since the distances in ru are computed explicitly. Otherwise, let rbe the root-most node in TH such that P intersects some Q ā Sepr. Thus,P is fully contained in Hr. Let t be a vertex in Qā©P . Since v is the closestĪ»-labeled vertex to u, it follows that it is also the closest Ī»-labeled vertexto t.
Since t ā Q, there exists q ā CQ such that Ī“Hr(v, q) + Ī“Hr(q, t) ā¤Ī“Hr(v, t) + Īµā²Ī±. By the triangle, Ī“Hr(v, q) ā¤ Ī“Hr(q, t) + Ī“Hr(v, t). Hence,first(Lr(q, Ī»)) ā¤ Ī“Hr(q, t) + Ī“Hr(v, t) ā¤ Ī“Hr(q, v) + ĪµĪ±.
first(Lr(q, Ī») ā¤ Ī“Hr(q, v) ā¤ Ī“Hr(q, v) + ĪµĪ± (3.4)
ā¤ Ī“Hr(q, t) + Ī“Hr(t, v) + ĪµĪ± (3.5)
ā¤ Ī“Hr(t, v) + 2ĪµĪ± (3.6)
Where inequality (3.4) follows from the denition of Lr(q, Ī»), (3.5) followsfrom the triangle inequality, and (3.6) follows from the fact that Ī“Hr(q, t) ā¤
3. UNDIRECTED GRAPHS WITH FASTER QUERY 19
š
š
š¢
š„
š£
š¦
š”
Figure 3.2: Illustration of the query algorithm. The solid quarter-circlesare shortest paths of separators in G. The vertices x, y and v have labelĪ», and v is the closest Ī»-labeled vertex to u. The path Q belongs to theroot-most node r whose separator is intersected by the shortest u-to-Ī» path(solid blue). The vertices q and t on Q are as in the proof of Lemma 5.The connection q minimizes Ī“H(u, q) + first(Lr(q, Ī»)). The distances inLr(q, Ī») are the lengths of the dashed paths.
ĪµĪ±.
Query(u, Ī») ā¤Ī“Hr(u, q) + first(Lr(q, Ī»)) (3.7)
ā¤Ī“Hr(u, q) + Ī“Hr(t, v) + 2ĪµĪ± (3.8)
ā¤Ī“Hr(u, t) + Ī“Hr(t, q) + Ī“Hr(t, v) + 2ĪµĪ± (3.9)
ā¤Ī“Hr(u, v) + 3ĪµĪ± (3.10)
ā¤Ī“H(u, Ī») + 3ĪµĪ± (3.11)
Here, inequality (3.9) follows from the triangle ineqaulity, and (3.11) followsfrom the fact that P is fully contained in Hr, and our assumption that v isthe closest Ī»-labeled vertex to v.
Since Ī“Hr(u, q) + first(Lr(q, Ī»)) underlines a real path in the Hr, fromour assumption that v is the closest Ī»-labeled vertex to u, it follows thatQuery(u, Ī») ā„ Ī“Hr(u, v), and the lemma follows.
3. UNDIRECTED GRAPHS WITH FASTER QUERY 20
To prove the query time, observe that the height of TH is O(log n). Atany level of the decomposition we inspect the rst element in O(Īµā1) lists,that is O(Īµā1 log n) time. We also inspect constant number of distances inru in constant time.
We now generalize to multiple labels. Let L be the set of labels in H.For r ā TH , let Lr be the restriction of L to labels that appear in Hr. Forevery label Ī» ā Lr, every Q ā Sepr and every q ā CQ, we store the listLr(q, Ī»). This does not aect the total size of our structure, since eachvertex has one label, so it still contributes its distances to O(Īµā1 log n) lists.The proof of Lemma 5 remains the same since each list contains distancesto a single label.
Naively, we could store for every node r, every vertex q, and every labelĪ» ā L the list Lr(q, Ī») in a xed array of size |L|. This allows O(1)-timeaccess to each list, but increases the space by a factor of |L| w.r.t. thesingle label case. Instead, we use hashing. Each vertex q holds a hash tableof the labels that contributed distances to q. For the static case, one canuse perfect hashing [FKS84] with expected construction time and constantquery time. In the dynamic case, we will use a dynamic hashing scheme,e.g., [PR01], which provides query and deletions in O(1) worst case, andinsertions in O(1) expected amortized time.
3.2 The Dynamic Case
We now turn our attention to the dynamic case. We wish to use the follow-ing method for updating our structure. When a node v changes its labelfrom Ī»1 to Ī»2, we would like to iterate over all ancestors r of rv in TH .For every Q ā Sepr and every q ā CQ, we wish to remove the value con-tributed by v from Lr(q, Ī»1), and insert it to Lr(q, Ī»2). We must maintainthe lists sorted, but do not wish to pay O(log n) time per insertion to doso. We will be able to pay O(log log Īµā1) per insertion/deletion by using asuccessor/predecessor data structure as follows.
For every r ā TH , Q ā Sepr, and q ā CQ, let Lr(q) be the list containingall distances from all vertices in V (Hr) to q sorted in ascending order. Wenote that since the distance for each specic vertex to q does not depend onits label, the list Lr(q, Ī») is a restriction of Lr(q) to the Ī»-labeled verticesin Hr.
3. UNDIRECTED GRAPHS WITH FASTER QUERY 21
During the construction of our structure we build Lr(q), and, for everyvertex v in Hr, we store for v its corresponding index in Lr(q). We denotethis index as IDq(v). We also store for q a single lookup table from theIDs to the corresponding distances. We note that v has O(Īµā1 log n) suchidentiers, and in total we need O(Īµā1n log n) space to store them.
Now, instead of using linked list as before, we implement Lr(q, Ī») using asuccessor/predecessor structure over the universe [1, ..., |V (Hr)|] of the IDs.For example, we can use y-fast tries [Wil83] that support operations inO(log log Īµā1) expected amortized time and minimum query in O(1) worstcase.
Query(u, Ī»)
The query algorithm remains the same as in the static case. For everyancestor r of ru in TH , every Q ā Sepr, and every connection q ā CQ, weretrieve the minimal ID from Lr(q, Ī») , and use the lookup table to get theactual distance between q and the vertex with that ID.
Update
Assume that the vertex v changes its label from Ī»1 to Ī»2. For every ancestorr of rv in TH , every Q ā Sepr, and every q ā CQ, we remove IDq(v) fromLr(q, Ī»1) and insert it to Lr(q, Ī»2).
Lemma 6. The update time is O(Īµā1 log n Ā· log log Īµā1) expected amortized.
Proof. In each one of the O(log n) levels in TH , we perform O(Īµā1) inser-tions and deletions from successor/predecessor structures in O(log log Īµā1)expected amortized time per operation. Therefore the total update timeis O(Īµā1 log n log log n). If the set Lr changes for some r ā TH as a resultof the update, we must also update the hash table that handles the labels.This might cost an additional O(1) expected amortized time per node, andis bounded by O(log n) expected amortized time in total.
Lemma 7. The data structure can be constructed in O(Īµā1n log nĀ·log log Īµā1)expected amortized time, and stored using O(Īµā1n log n) space.
Proof. We decompose H into TH , and compute the connection length inO(Īµā1n log n) time. We than build the lists Lr(q) for every node r ā TH
3. UNDIRECTED GRAPHS WITH FASTER QUERY 22
and q on any q ā Sepr. These lists contains O(Īµā1n log n) elements in therange [1, ..., Īµā1] that is independent of both n and Ī±. Hence we sort the listsin O(Īµā1n log n) time. We than use our update process on each v ā V (H)and each ancestor r of rv in O(Īµā1 log n Ā· log log Īµā1) expected amortizedtime for v. Hence, our construction time is O(Īµā1n lg n log log Īµā1) expectedamortized. To see our space bound, we note that every v contributes a dis-tance O(Īµā1) lists at every ancestor r of rv. Hence, there are O(Īµā1n log n)elements in total. Our successor/predecessor structures, and the hash ta-bles has linear space in the number of elements stored. Thus, O(Īµā1n log n)space.
We plug in this structure to Lemma 1 and obtain the following theorem:3
Theorem 1. Let G be an undirected planar graph. There exists a stretch-(1 + Īµ) Approximate Dynamic Vertex-Labeled Distance Oracle that supportsquery in O(Īµā1 log n log log nN) worst case and updates in O(Īµā1 log n Ā·log log Īµā1 log nN) expected amortized. The construction time of that or-acle isO(Īµā1n log nĀ·log log Īµā1 log nN) and it can be stored in O(Īµā1n log n log nN)space.
3Formally, one needs to show that Lemma 1 holds for vertex-labeled oracles as well.
See Appendix A
4 Oracle for Directed Graphs
For simplicity we only describe an oracle that supports queries from a givenlabel to a vertex. Vertex to label queries can be handled symmetrically. Todescribe our data structure for directed graphs, we rst need to introducethe concept of Īµ-covering set from a set of vertices to a directed shortestpath.
Denition 6. Let S be a set of vertices in a directed graph H. Let Q bea shortest path in H of length at most Ī±. CH(S,Q) ā V (Q) Ć R+ is anĪµ-covering set from S to Q in H if for every t ā Q s.t. Ī“H(S, t) ā¤ Ī±, thereexists (q, `) ā CH(S,Q) s.t. `+ Ī“(q, t) ā¤ Ī“H(S, t) + ĪµĪ±, and ` ā„ Ī“H(S, q).
In the denition above we use ` instead of Ī“(S, q) (compare to Deni-tion 5) because we cannot aord to recompute exact distances as S changes.Instead, we store and use approximate distances `.
Lemma 8. Let H be a directed planar graph. Let Q be a shortest path inH of length at most Ī±. For every set of vertices S ā V (H) there is anĪµ-covering set CH(S,Q) of size O(Īµā1).
Proof. We introduce a new apex vertex in H denoted by x. For every vertexv in S, we add an arc xv with length 0. Since the indegree of x is 0, Qremains a shortest path, with length bounded by Ī±. We apply Lemma 2 onx w.r.t Q, to get an Īµ-cover set CH(x,Q) of size O(Īµā1). Clearly, CH(x,Q)is an Īµ-covering set from S to Q, and the Lemma follows.
Our construction relies on the following lemma.
Lemma 9 (Thinning Lemma). Let H, S and Q be as in Lemma 8. LetSiki=1 be sets such that S =
āki=1 Si. For 1 ā¤ i ā¤ k, let DH(Si, Q) be
an Īµā²-covering set from Si to Q, ordered by the order of the vertices on Q.
23
4. DIRECTED GRAPHS 24
Then for every Īµ > 0, an (Īµ+ Īµā²)-covering set CH(S,Q) from S to Q of sized2Īµā1e can be found in O(Īµā1 + |
āki=1DH(Si, Q)|) time.
Proof. Let q0 be the rst vertex on Q. Let Q be the reduction of Q to thevertices in
āki=1DQ(Si) and q0. Let H be the auxiliary graph consisting
of Q and an apex vertex x connected to every q ā Q with an arc xq oflength Ī“H(Si, q), where Si is the set originally containing q. Note thatĪ“H(Si, q) ā„ Ī“H(S, q). Also note that H is planar, with diameter boundedby Ī±, and since the indegree of x is 0, Q is a shortest path in H. Letm = |
āki=1DH(Si, Q)|. We compute the shortest distance from x to every
other q in H explicitly by relaxing all arcs adjacent to x, and than relaxingthe arcs of Q by order. Constructing H and computing these distances canbe done in O(m) time, since |V (H)| = |E(H)| = O(m).
We apply Lemma 2 to x with Īµ and get an Īµ-covering set CH(x,Q) of size
d2Īµā1e from x to Q. It remains to prove that CH(x,Q) is an (Īµ+Īµā²)-coveringset CH(S,Q) set from S to Q in H.
Let t ā Q. We show that there exists (q, `) ā CH(x,Q) such that` + Ī“H(q, t) ā¤ Ī“H(S, t) + (Īµā² + Īµ)Ī±. We assume without loss of generality,that Ī“H(S, t) = Ī“H(S1, t). Since DQ(S1) is an Īµ
ā²-covering set from S1 to Qin H, there exists (qā², `ā²) ā DQ(S1) such that:
`ā² + Ī“H(qā², t) ā¤ Ī“H(S1, t) + Īµā²Ī± (4.1)
Also, since qā² ā DQ(S1), it is also on Q. Therefore there exists (q, `) āCH(x,Q) such that:
`+ Ī“H(q, qā²) ā¤ Ī“H(x, qā²) + ĪµĪ± ā¤ `ā² + ĪµĪ± (4.2)
Where the last inequality follows the fact that for every (qā, `ā) ā DQ(S1),Ī“H(x, qā) ā¤ `ā, and hence, Ī“H(x, qā²) is at most `ā².
Ī“H(S1 āŖ S2, t) + Īµā²Ī± + ĪµĪ± = Ī“H(S1, t) + Īµā²Ī± + ĪµĪ± (4.3)
ā„ `ā² + Ī“H(qā², t) + ĪµĪ± (4.4)
ā„ `+ Ī“H(q, qā²) + Ī“H(qā², t) (4.5)
= `+ Ī“H(q, qā²) + Ī“H(qā², t) (4.6)
= `+ Ī“H(q, t) (4.7)
Here, (4.4) follows from inequality (4.1), (4.5) follows from inequality (4.2).
4. DIRECTED GRAPHS 25
š
š
šā²
š„
š”
Figure 4.1: Illustration of he auxiliary graph H in the proof of Lemma 9,when applied to the sets S1 = u and S2 = v (I.e. k = 2). The connectionsets of S1 and S2 are indicated by the triangles and squares, respectively.The connections in the output set are indicated by a solid ll. The vertex tis a vertex on Q (not on Q) that is closer to v than it is to u. Although t iscovered by both q and qā², its distance from x is better approximated via qā².The vertex q Īµ-covers qā² w.r.t. the distances in H hence qā² is not includedin the output set. Since q Īµ-covers qā², and qā² Īµā²-covers t, it follows that t is(Īµ+ Īµā²)-covered by q.
Let H be a directed planar Ī±-layered graph, equipped with a spanningtree T . For every xed parameter Īµ, let Īµ = Īµ
8 logn, and Īµā = Īµ
2. We apply
Lemma 3 with Īµ to H and obtain a decomposition tree TH , and Īµ-coveringsets CHr(v,Q) and CHr(Q, v) for every v ā V (H), every ancestor r of rv inTH and every Q ā Sepr. For every 1 ā¤ i ā¤ log n, let Īµi = Īµ lognāi+1
4 logn.
For every r ā TH , for every Ī» ā Lr, and for every Q ā Sepr, we applyLemma 9 to the Īµ-covering connections sets CHr(v,Q) for all v ā SĪ»r , withĪµā² = Īµ and Īµ set to Īµ
4. Thus, we obtain an Īµā-covering set CāHr(S
Ī»r , Q). Let
i be the level of r in TH , we also store for r a set of Īµi-covering sets asfollows. For every ancestor node t of r in TH and every Q ā Sept, we storeCHt(S
Ī»r , Q). We assume for the moment that these sets are given. We defer
4. DIRECTED GRAPHS 26
š1
š
šš¢ šš£
Update connections šŗš-covering sets
Query connections šŗā-covering sets
Vertex connections š -covering sets
From ššŗš to š ā šššš
From ššŗš to
š ā šššš š/š“ š«
From šš1š = ššš¢ āŖ ššš£ to
š ā šššš1, šššš From šš1
š = ššš¢āŖ ššš£ to š ā šššš1
š/š“ š«š
From ššš¢š = š¢ to
š ā ššššš¢, šššš1, šššš From ššš¢
š = š¢ to š ā ššššš¢
š/š“ š«š®
From ššš£š = š£ to
š ā ššššš£, šššš1, šššš From ššš£
š = š£ to š ā ššššš£
š/š“ š«šÆ
š/š“ š/š“ From u to every
š ā ššššš¢, šššš1, šššš , and from every such Q to u.
u
š/š“ š/š“ From v to every
š ā ššššš£, šššš1, šššš , and from every such Q to v.
v
š¢ š£
Figure 4.2: A summary of the connections-sets stored by the directedoracle. On the left, part of a decomposition tree of a graph is shown. Thevertices u and v are the only Ī» labeled vertices. On the right, a table listingall the covering sets that are stored for the label Ī».
the description of their construction (see the update procedure and the proofof Lemma 12). We will use the Īµā-covering sets for ecient queries, and themore accurate Īµi-covering sets to be able to perform ecient updates. SeeFig. 4.2.
4.1 Query(Ī», u)
The query algorithm is straightforward. For every ancestor r of ru wend (q, `) ā CāHr(S
Ī»r , Q) and t ā CHr(Q, u) that minimize the distance
`+Ī“Hr(q, t)+Ī“Hr(t, u). We also inspect the distance to the Ī»-labeled verticesin ru explicitly. We return the minimum distance inspected. To see that thequery time is O(Īµā1 log n), we note that for every one of the O(log n) an-cestors of ru we inspect O(Īµā1) distances on constant number of separators.Inspecting the distances in ru itself takes constant time.
4. DIRECTED GRAPHS 27
š
š
š
š£ š¢
Figure 4.3: The solid quarter-circles are shortest paths of separators in G.The vertex v is the closest Ī»-labeled vertex to u. The path Q belongs to theroot-most node r whose separator is intersected by the shortest Ī»-to-u path(solid blue). The connections of SĪ»r on Q are indicated by black triangles,the connections of u are indicated by black squares. The vertices q and ton Q are as in the proof of Lemma 10. The blue and black dashed lines arethe shortest paths from v to q, and from t to u, respectively. These pathsare used to generate the distance reported by the query algorithm.
Lemma 10. Query(Ī», u) ā¤ Ī“H(Ī», u) + ĪµĪ±.
Proof. Let r be the root-most node in TH such that the shortest Ī»-to-u pathP in H intersects some Q ā Sepr. Let k be a vertex in Q ā© P . By thedenition of the connection set CāHr(S
Ī»r , Q), there exists (q, `) such that
l + Ī“Hr(q, k) ā¤ Ī“Hr(SĪ»r , k) + ĪµāĪ± (4.8)
Also there exists t ā CHr(Q, u) such that
Ī“Hr(k, t) + Ī“Hr(t, u) ā¤ Ī“Hr(k, u) + ĪµĪ± ā¤ Ī“Hr(k, u) + ĪµāĪ± (4.9)
4. DIRECTED GRAPHS 28
We add the two to get
l + Ī“Hr(q, k)Ī“H(k, t) + Ī“Hr(t, u) ā¤ Ī“Hr(SĪ»r , k) + Ī“Hr(k, u) + ĪµāĪ± + ĪµāĪ±
(4.10)
l + Ī“Hr(q, t) + Ī“H(t, u) ā¤ Ī“Hr(SĪ»r , k) + Ī“Hr(k, u) + 2ĪµāĪ± (4.11)
l + Ī“Hr(q, t) + Ī“Hr(t, u) ā¤ Ī“Hr(SĪ»r , u) + ĪµĪ± (4.12)
Clearly, l + Ī“H(q, t) + Ī“H(t, u) ā„ Ī“H(SĪ»r , u). And since P is fully containedin Hr, Ī“Hr(S
Ī»r , u) = Ī“H(SĪ»r , u), and the Lemma follows.
4.2 Update
Assume that some vertex u changes its label from Ī»1 to Ī»2. For everyancestor r of ru and everyQ ā Sepr, we would like to remove CHr(u,Q) fromCHr(S
Ī»1r , Q), and combine CHr(u,Q) into CHr(S
Ī»2r , Q). While the latter is
straightforward using Lemma 9, removing CHr(u,Q) from CHr(SĪ»1r , Q) is
more dicult. For example, if u was the closest Ī»1 labeled vertex to everyvertex on Q, it is possible that CHr(u,Q) = CHr(S
Ī»1r , Q). In that case,
we will have to rebuild CHr(SĪ»1r , Q) from the other O(|V (Hr)|) vertices of
SĪ»1r . Instead of removing the connections of u, we will rebuild CHr(SĪ»1r , Q)
bottom-up starting from the leaf node ru.We therefore start by describing how to update ru. There is a constant
number of vertices in ru, and hence |SĪ»1ru | = O(1). Let v1, v2,...vk be thevertices in SĪ»1ru . We stress that for every 1 ā¤ j ā¤ k, vj has an Īµ-covering setCHt(vj, Q) of size O(Īµā1) from vj to Q, for every ancestor t of ru in TH , andfor every Q ā Sept. We apply the Thinning Lemma (Lemma 9) for eachsuch t and Q on CHt(vj, Q)kj=1 with Īµ
ā² = Īµ and Īµ set to Īµ. Lemma 9 yieldsa 2Īµ-covering set CHt(S
Ī»ru , Q).
We next handle the ancestors r of ru in TH in bottom up order. Let xand y be the children of r ā TH . We rst note that Hr = HxāŖHy and hence,SĪ»1r = SĪ»1x āŖSĪ»1y . Therefore, by Lemma 9, for every ancestor t of r, and everyQ ā Sept, CHt(SĪ»1r , Q) can be obtained from CHt(S
Ī»1x , Q)āŖCHt(SĪ»1y , Q). Let
i by the level of r in TH , and hence the level of x and y is i+1. Since t is anancestor of r, it is also an ancestor of x and y. Hence, x (y) stores an Īµi+1-covering set CHt(S
Ī»1x , Q) (CHt(S
Ī»1y , Q)). We apply Lemma 9 on CHt(S
Ī»1x , Q)
and CHt(SĪ»1y , Q) with Īµā² = Īµi+1 and Īµ = 2Īµ to get an (Īµi+1 + 2Īµ)-covering set
CHt(SĪ»1r , Q). The following lemma shows that CHt(S
Ī»1r , Q) is an Īµi-covering
set.
4. DIRECTED GRAPHS 29
Lemma 11. Let r be a node in level i in TH . For every ancestor t of r,and every Q ā Sept, CHt(SĪ»1r , Q) is an Īµi-covering set from SĪ»1r to Q.
Proof. We rst recall that Īµi = Īµ lognāi+14 logn
for every 1 ā¤ i ā¤ log n. We provethe lemma by induction on the level of r in TH . The base case is i = log n,so r is a leaf. The connection sets of the leaf nodes are computed explicitlyusing Lemma 9, with Īµ and Īµā² set to Īµ. Hence the product of the lemma is2Īµ-covering sets.
2Īµ = 2Īµ
8 log n=
Īµ
4 log n= Īµlogn (4.13)
For the inductive step, if r is a leaf, then the arguments from the basecase applies. Otherwise, let x and y be the children of r. By the inductionhypothesis, both x and y have Īµi+1-covering set from SĪ»1x and SĪ»1y to Q,respectively. The update procedure applies Lemma 9 on CHx(S
Ī»1x , Q) and
CHy(SĪ»1y , Q) with Īµā² = Īµi+1 and Īµ = 2Īµ, so we get an (Īµi+1 + 2Īµ)-covering set
CHt(SĪ»1r , Q).
Īµi+1 + 2Īµ = Īµlog nā (i+ 1) + 1
4 log n+ Īµ
2
8 log n= Īµ
log nā i+ 1
4 log n= Īµi (4.14)
To nish the update process, we need to update the Īµā-covering setsthat we use for queries. Let r be an ancestor node of ru in level i on TH .By Lemma 11, for every Q ā Sepr, we have an Īµi-covering set CHr(SĪ»1r , Q).Since Īµi < Īµā , CHr(S
Ī»1r , Q) is also an Īµā-covering set. However, it is too
large. We apply Lemma 9 on CHr(SĪ»1r , Q) with Īµā² = Īµi, and Īµ set to
Īµ4to
get (Īµi + Īµ4)-covering set. We note that since Īµi ā¤ Īµ
4for every 1 ā¤ i ā¤ log n,
we get that Īµi + Īµ4ā¤ 2 Īµ
4ā¤ Īµ
2= Īµā. Hence the output of Lemma 9 is the
desired Īµā-covering set CāHr(SĪ»1r , Q). We repeat the entire process for Ī»2.
Lemma 12. There exists a scale-(Ī±, Īµ) distance oracle for directed Ī±-layeredplanar graph, with query time O(Īµā1 log n) worst case, and update time ofO(Īµā1 log3 n) expected amortized. The oracle can be constructed in O(Īµā2n log5 n)time and stored using O(Īµā1n log3 n) space.
Proof. Since our update process only uses Lemma 9, we bound the up-date time by the running time of that Lemma. Since the running time ofLemma 9 is linear in sizes of the input connection sets we get the bound
4. DIRECTED GRAPHS 30
by the number of connection stored for ru and its ancestors. We store forru
Īµ4 logn
-connection set for constant number of separators for every one of
the O(log n) ancestors of ru. Hence, the number of connections stores forru is O(log n( Īµ
4 logn)ā1) = O(Īµā1 log2 n). Since the number of connections
stored for ru dominates the number of connection stored for any other strictancestor of ru, we get the total number of connections stored of O(log3 n).
We note that the connections of the vertices in ru are only used whenupdating ru, and for any other non-leaf node r, we only use the connection ofits children. Thus, any connection is used at most twice. Once for updatinga connection set of its parent, and the second time, is when updating theĪµā-covering sets of r (ru). Hence the total input size of Lemma 9 is at mosttwice the number of the connections stored for the ancestors of ru, that isO(log3 n), and the update time follows.
Since we store for every r ā TH and every Q ā Sepr a connection set forevery Ī» ā Lr, we use dynamic hashing as in Section 3. Hence, our updatetime is expected amortized.
Our query time is trivial and follows from the fact that we processO(log n) levels in TH , and in each we inspect O(Īµāā1) connections. That isO(Īµā1 log n) time worst case.
By Lemma 3 with Īµ set to Īµ, all connection sets for all leaves of THcan be computed in O(Īµā2n log5 n) and it requires O(Īµā1n log2 n) space.We construct the connection sets CHr(S
Ī»r , Q) for all r ā TH , Q ā Sepr and
Ī» ā Hr by applying the update process for each vertex v ā V (H). This takesO(Īµā1 log3 n) expected amortized time per operation, and O(Īµā1n log3 n)expected amortized time in total. This is dominated by the construction ofThorup's oracle.
To get the space requirements of our data structure, we need to countthe number of connections stored. If every vertex u ā V (H) has uniquelabel, it follows that the connection sets stored for u are not useful forany other vertex. We therefore count the number of u's connections andmultiple by O(n). Let Ī» be the label of u. To support queries and updatesfor Ī», we store for every ancestor r of ru connection sets from SĪ»r to O(log n)separators for the ancestors of r. Since the size of these connection sets isonly bounded by O(Īµā1), we get that r requires O(Īµā1 log2 n) connections.Since ru has O(log n) ancestors, we store for u (and by that for Ī») O(log3 n)connections. Thus, the total space required is O(n log3 n).
We can now apply Lemma 1 to get the following theorem:
4. DIRECTED GRAPHS 31
Theorem 2. For any directed planar graph and xed parameter Īµ, there ex-ists a (1+Īµ) approximate vertex-labeled distance oracle that support queriesin O(Īµā1 log n log log nN) worst case and updates in O(Īµā1 log3 n log nN) ex-pected amortized time. This oracle can be constructed in O(Īµā2n log5 n log nN)expected amortized time, and stored using O(Īµā1n log3 n log nN) space.
5 Oracle for Undirected Graphs
with Faster Update
Both Thorup [Tho04, Lemma 3.19] and Klein [Kle02] independently pre-sented ecient vertex-vertex distance oracles for undirected planar graphthat use connections sets. Klein later improved the construction time [Kle05].They show that, in undirected planar graph, one can avoid the scaling ap-proach that uses Ī±-layered graphs. Instead, there exist connections setsthat approximate distance with (1 + Īµ) multiplicative factor rather than ĪµĪ±additive factor. We use the term portals [Kle05] to distinguish this type ofconnections from the previous one.
Denition 7. Let G be an undirected planar graph, and let Q be a shortestpath in G. For every vertex v ā V (G) we say that a set CG(v,Q) is anĪµ-covering set of portals if and only if, for every vertex t on Q there exista vertex q on Q such that: Ī“G(v, q) + Ī“G(q, t) ā¤ (1 + Īµ)Ī“G(v, t)
We use a recursive decomposition TG with shortest path separators, anduse Klein's algorithm [Kle05] to select all the portal sets CGr(u,Q) e-ciently.We cannot use the lists of Section 3 because there may be too manyportals, and we cannot use the thinning lemma (Lemma 9) of Section 4 be-cause its proof uses a directed construction, and hence, cannot be appliedin undirected graphs. Instead, we take the approach used by Li, Ma andNing for the static vertex-labeled case [LMN13]. We work with all portals ofvertices with the appropriate label, and nd the closest one using dynamicPrex/Sux Minimum Queries.
Denition 8 (Dynamic Prex Minimum Data Structure). A Dynamic Pre-x Minimum Data Structure is a data structure that maintains a set A of npairs in [1, n]ĆR, under insertions, deletions, and Prex Minimum Queries
32
5. UNDIRECTED GRAPHS WITH FASTER UPDATE 33
š¤ š„ š¦
š£0 š£2
š£1
š¤ š„š£0 š¦
š£0 š£2
š£1
š„š£2 š„š£1 0 0 š¾ š½
š
š š¾ š½
Figure 5.1: Illustration of the reduction to unique portals. Above, the pathQ with the portal x that is used by v0, v1, and v2. Below, x was replaced byxv0, xv1, and xv2, inner connected with zero length edges. Here, xv0, xv1,xv2 are the portals of v0, v1, and v2 respectively. Note that this reductiondoes not introduce new paths in the graph, nor changes the distance alongQ.
(PMQ) of the following form: given l ā [1, n] return a pair (x, y) ā A s.t.x ā [1, l], and for every other pair (xā², yā²) with xā² ā [1, l], y ā¤ yā².
Sux minimum queries (SMQ) are dened analogously. Let PMQ(A, l)and SMQ(A, l) denote the result of the corresponding queries on the set Aand l.
We assume that for every u, v ā V (Gr), CGr(u,Q) ā© CGr(v,Q) = ā .This is without loss of generality, since if x is a portal of a set of verticesv0, ..., vk, we can split x to k copies. This does not increase |G| by morethan a factor of Īµā1. See Fig. 5.1. (see gure 5.1).
To describe our data structure, we rst need the following denitions.Let Q ā Sepr for some r ā TG. Let q0, ..., qk be the vertices on Q bytheir order along Q. G is undirected, hence the direction of Q is chosenarbitrarily. For every 0 ā¤ j ā¤ k, let h(qj) denote the distance from q0 to qjon Q. We note that since Q is a shortest path in G, h(qi) = Ī“G(q0, qj). For
5. UNDIRECTED GRAPHS WITH FASTER UPDATE 34
every Ī» ā Lr we maintain a dynamic prex minimum data structure PreQ,Ī»over (j,āh(qj) + Ī“Gr(qj, Ī»))kj=0. We similarly maintain a a dynamic suxminimum data structure SufQ,Ī» over (j, h(qj) + Ī“Gr(qj, Ī»))kj=0.
Query(u, Ī»)
For every ancestor r of ru in TG, every Q ā Sepr, and every qj ā CGr(u,Q)we wish to nd the index i that minimizes Ī“Gr(u, qj)+Ī“Gr(qj, qi)+Ī“Gr(qi, Ī»).Observe that for i ā¤ j, Ī“Gr(qj, qi) = h(j)āh(i), while for i ā„ j, Ī“Gr(qj, qi) =h(i) ā h(j). We therefore nd the optimal i ā¤ j and i ā„ j separately.Note that miniā¤j(Ī“Gr(u, qj) + Ī“Gr(qj, qi) + Ī“Gr(qi, Ī»)) = Ī“Gr(u, qj) + h(j) +PMQ(PreQ,Ī», j). Similarly, we handle the case where i ā„ j using SMQ(SufQ,Ī», j).Thus, we have two queries for each portal of u. We also compute the dis-tance from u to Ī» in ru explicitly. We return the minimum distance com-puted.
Lemma 13. The query algorithm returns a distance d such that Ī“G(u, Ī») ā¤d ā¤ (1 + Īµ)Ī“G(u, Ī»)
Proof. The proof of correctness of our algorithm is essentially the sameas in [LMN13, Lemma 1]. We adapt it to t our construction. Let vbe the closest Ī»-labeled vertex to u in G. If the shortest u-to-v path Pdoes not leave ru = rv the algorithm is correct, since the distance in ru iscomputed expilicitly. Otherwise, let r be the root-most node in TG suchthat P intersects some Q ā Sepr. Let t be a vertex on P ā©Q. There existsqj ā CGr(u,Q) and qi ā CGr(v,Q) such that:
Ī“Gr(u, qj) + Ī“Gr(qj, t) ā¤ (1 + Īµ)(Ī“Gr(u, t)) (5.1)
Ī“Gr(v, qi) + Ī“Gr(qi, t) ā¤ (1 + Īµ)(Ī“Gr(v, t)) (5.2)
We add the two inequalities to get the following:
Ī“Gr(u, qj) + Ī“Gr(qj, qi) + Ī“Gr(v, qi) ā¤ (1 + Īµ)(Ī“Gr(u, v)) (5.3)
If i ā¤ j, then PMQ(PrefQ,Ī», j) ā¤ Ī“Gr(qi, Ī»)ā h(qi) ā¤ Ī“Gr(v, qi)ā h(qi).Thus,
Query(u, Ī») ā¤ Ī“Gr(v, qi)ā h(qi) + h(j) + Ī“Gr(u, qj) (5.4)
= Ī“Gr(v, qi) + Ī“Gr(qi, qj) + Ī“Gr(u, qj) (5.5)
ā¤ (1 + Īµ)(Ī“Gr(u, v)) (5.6)
ā¤ (1 + Īµ)(Ī“G(u, Ī»)) (5.7)
5. UNDIRECTED GRAPHS WITH FASTER UPDATE 35
Here, inequality (5.6) follows from (5.3), and (5.7) follows from that factthat P is fully contained in r, and our assumption that v is the closestĪ»-labeled vertex to u.
The proof for the case that i ā„ j is similar.
Update
Assume that the label of u changes from Ī»1 to Ī»2. For every ancestorr of ru ā TG, and Q ā Sepr, and for qi ā CGr(u, q), we remove fromPreQ,Ī»1 and SufQ,Ī»1 the element (x, y) with x = i, and insert the element(i,āh(i) + Ī“Gr(u, qi)) into PreQ,Ī»2 , and (i, h(i) + Ī“Gr(u, qi)) into SufQ,Ī»2 .We note that since we assume that every vertex qi is a portal of at mostone vertex, the removals are well dened, and the insertions are safe.
The time and space bounds for the oracle described above are given inthe following lemma.
Lemma 14. Assume there exists a dynamic prex/sux minimum datastructure in the word RAM model, that for a set of sizem, supports PMQ/SMQin O(TQ(m)) time, and updates in O(TU(m)) time, can be constructed inO(TC(m)) time, where TC(m) ā„ m, and can be stored in O(S(m)) space.Then there exist a dynamic vertex-labeled stretch-(1 + Īµ) distance oraclefor planar graphs with worst case query time O(Īµā1 log(n)TQ(Īµā1n)), andexpected amortized update time O(Īµā1 log(n)TU(Īµā1n)). The oracle can beconstructed using O(Īµā1n log2 n+ log(n)Tc(Īµ
ā1n)) expected amortized time,and stored in O(log(n)S(Īµā1n)) space.
Proof. Let G be an undirected planar graph. We rst decompose G to ob-tain TG, and compute all the portals and the distances to portals. Klein [Kle05]shows that this can be done using O(n log(n)(Īµā1 + log n)) time. Then, forevery r ā TG, for every Q ā Sepr and every Ī» ā Lr, we construct a pre-x/sux minimum query data structures for PreQ,Ī» and SufQ,Ī».
Recall that PreQ,Ī» is dened over the set of pairs (j,āh(qj)+Ī“Gr(qj, Ī»))kj=0,where qj is the j'th portal on Q. For each element (x, y) in PreQ,Ī», the rstcoordinate is specied by the order of the corresponding portal onQ. Hence,x ā¤ Īµā1n is an integer that ts in a single word. The second coordinate canbe treated similarly; We sort the list āh(qj) + Ī“Gr(qj, Ī»)j for all portalsqj on Q. Then, we can specify y by its ordinal number in the sorted list.The same argument holds for SufQ,Ī».
5. UNDIRECTED GRAPHS WITH FASTER UPDATE 36
Constructing PreQ,Ī» and SufQ,Ī» takesO(log n(Īµā1n log(Īµā1n)+TC(Īµā1n))time, since at every level of TG the total number of portals is O(Īµā1n), andsince TC(Ā·) is superlinear. The number of portals we store is O(Īµā1n log n)since every vertex v has O(Īµā1) portals for every one of its O(log n) ances-tors in TG. Hence our space is O(log(n)S(Īµā1n)), and the construction timeis O(Īµā1n log2 n+ log(n)Tc(Īµ
ā1n)).To analyze the query and update time, we note that we process O(log n)
nodes in TG and in each we perform O(Īµā1) queries or updates to the pre-x/sux minimum query structures. The size of our prex/sux struc-tures is bounded by the size of V (Q) which is O(Īµā1n). The Īµā1 fac-tor is due to the assumption of distinct portals. Thus, the query timeis O(Īµā1 log(n)TQ(Īµā1n)) and the update time is O(Īµā1 log(n)TU(Īµā1n)).
Since every Q ā Sepr holds a prex/sux minimum data structure forevery label Ī» ā Lr, we use dynamic hashing to avoid space dependencyin |L|, as in Section 5. Hence, our construction time and update time areexpected amortized.
It remains to describe a fast prex/sux minimum query structure.We use a result due to Wilkinson [Wil14] for solving the 2-sided reportingproblem in R2 in the word RAM model. In this problem, we maintain a setA of n points in R2 under an online sequence of insertions, deletions andqueries of the following form. Given a rectangle B = [l1, h1] Ć [l2, h2] suchthat exactly one of l1, l2 and one of h1, h2 is ā or āā, we report A ā© B.Here, [l1, h1] Ć [l2, h2] represents the rectangle (x, y) : l1 ā¤ x ā¤ l2, h1 ā¤y ā¤ h2. Since Wilkinson assumes the word RAM model, it is assumedthat the coordinates of the points in A are integers that t in a single word.Wilkinson's data structure is captured by the following theorem.
Theorem 3. [Wil14, Theorem 5] For any f ā [2, log n/ log log n], there ex-ists a data structure for 2-sided reporting with update time O((f log n log log n)1/2),query time O((f log n log log n)1/2 + logf (n) + k) where k is the number ofpoints reported. The structure requires linear space.
In fact, Wilkinson's structure rst nds the point with the minimumy-coordinate in the query region, and then reports the other points. Usingthis fact, and setting f = logĪ³ n for some arbitrary small constant Ī³. Weget the following lemma, in which we also state Wilkinson's constructiontime explicitly.
5. UNDIRECTED GRAPHS WITH FASTER UPDATE 37
Lemma 15. There exists a linear space data structure for 2-sided reportingon n points, with update time O(log1/2+Ī³ n) and query time O( logn
log logn). This
data structure can be constructed in O(n log1/2+Ī³ n) time. Moreover, uponquery the data structure returns the minimum y-coordinate of a point in thequery region.
The prex/sux queries required by Lemma 16 correspond to one-sidedrange reporting in the plane, which can be solved using 2-sided queries, bysetting the upper limit of the query rectangle to nN .
Lemma 16. For any constant Ī³ > 0, there exists a linear space dynamicprex/sux minimum data structure over n elements with update timeO(log1/2+Ī³ n), and query time O( logn
log logn). This data structure can be con-
structed inO(n log1/2+Ī³ n) time.
Proof. We use Wilkinson's structure. A prex minimum query for i cor-responds to nding the point with minimum y-coordinate in the rectangle(āā,āā, i,ā). This is 1-sided rectangle. To be able to specify a boundryfor the y-axis, we maintain an upper bound ymax on the y-coordinates ofpoints in A. The bound can be easily updated in constant time when aninsertion occurs. (There is no need to update the bound when a dele-tion occurs). We replace the 1-sided rectangle with the 2-sided rectan-gle (āā,āā, i, ymax). Similarly, our sux minimum query is the 1-sidedrectangle (i,āā,ā,ā) or the 2-sided (i,āā,ā, ymax). The lemma nowfollows by applying Lemma 15.
We therefore obtain the following theorem.
Theorem 4. For any undirected planar graph and xed parameters Īµ, Ī³,there exists a stretch-(1+Īµ) vertex-labeled distance oracle that approximates
distances in O(Īµā1 logn log(Īµā1n)log log (Īµā1n)
) time worst case, and supports updates in
O(Īµā1 log n log12+Ī³(Īµā1n)) expected amortized time. This data structure can
be constructed using O(n log2 n + Īµā1n log n log12+Ī³ (Īµā1n)) expected amor-
tized time and stored using O(Īµā1n log n) space.
6 Concluding remarks
In this work we presented approximate vertex-labeled distance oracles fordirected and undirected, planar graphs with polylogarithmic query andupdate times and nearly linear space. All of our oracles have Ī©(log n)query and updates, since we handle root-to-leaf paths in the decomposi-tion tree. The logarithmic factor can be avoided in the vertex-to-vertexcase where approximate distance oracles with faster query times exist (seee.g., [Tho04, Wul16, GX15] and references therein). This is also the casefor the static vertex-to-label case. For example, Mozes and Skop [MS15]presented an oracle with constant query time. Their oracle uses label con-nections that store the shortest distance to a labeled vertex in the entiregraph. This is in contrast to our connections that only consider labeledvertices in a subgraph. Hence, their query algorithm only accesses a singlenode in the decomposition tree. The downside of storing distances in theentire graph is that labels changes are less contained (may aect O(n) sep-arators). It would be interesting to study whether an approximate distanceoracle with logarithmic update time and o(log n) query time exists.
Another bottleneck for our directed data structure is the use of O(log n)connection sets in every node of the decomposition tree. Those sets areonly used by our bottom-up update approach, which is mainly needed forremoval of labeled vertices. We tried to avoid storing these sets, with nosuccess. It remains an open question whether this costly update procedurecan be avoided.
For our undirected oracle with the faster update (Section 5), we useWilkinson's 2-sided reporting [Wil14] as a dynamic prex/sux minimumdata structure. During our research, we tried to develop a faster dynamicprex minimum data structure but with no success. Another interestingquestion that arises is whether other approaches may be used to obtain afaster prex/sux minimum data structure, that will lower the time bounds
38
6. CONCLUDING REMARKS 39
of our oracle.
Bibliography
[ACD+16] Ittai Abraham, Shiri Chechik, Daniel Delling, Andrew V. Gold-berg, and Renato F. Werneck. On dynamic approximate short-est paths for planar graphs with worst-case costs. In SODA,pages 740753. SIAM, 2016.
[ACG12] Ittai Abraham, Shiri Chechik, and Cyril Gavoille. Fully dynamicapproximate distance oracles for planar graphs via forbidden-setdistance labels. In STOC, pages 11991218. ACM, 2012.
[aOP+15] Jakub acki, Jakub Ocwieja, Marcin Pilipczuk, PiotrSankowski, and Anna Zych. The power of dynamic distanceoracles: Ecient dynamic algorithms for the steiner tree. InSTOC, pages 1120, 2015.
[Che12] Shiri Chechik. Improved distance oracles and spanners forvertex-labeled graphs. In ESA, volume 7501 of Lecture Notesin Computer Science, pages 325336. Springer, 2012.
[FKS84] Michael L. Fredman, JĆ”nos KomlĆ³s, and Endre SzemerĆ©di. Stor-ing a sparse table with O(1) worst case access time. J. ACM,31(3):538544, 1984.
[GX15] Qian-Ping Gu and Gengchun Xu. Constant query time (1 + Īµ)-approximate distance oracle for planar graphs. In ISAAC, pages625636, 2015.
[HKRS97] Monika Rauch Henzinger, Philip N. Klein, Satish Rao, andSairam Subramanian. Faster shortest-path algorithms for pla-nar graphs. J. Comput. Syst. Sci., 55(1):323, 1997.
40
BIBLIOGRAPHY 41
[HLWY11] Danny Hermelin, Avivit Levy, Oren Weimann, and RaphaelYuster. Distance oracles for vertex-labeled graphs. In ICALP(2), volume 6756 of Lecture Notes in Computer Science, pages490501. Springer, 2011.
[KKS11] Ken-ichi Kawarabayashi, Philip N. Klein, and Christian Som-mer. Linear-space approximate distance oracles for planar,bounded-genus and minor-free graphs. In ICALP (1), volume6755 of Lecture Notes in Computer Science, pages 135146.Springer, 2011.
[Kle02] Philip N. Klein. Preprocessing an undirected planar networkto enable fast approximate distance queries. In SODA, pages820827, 2002.
[Kle05] Philip N. Klein. Multiple-source shortest paths in planar graphs.In SODA, pages 146155, 2005.
[KST13] Ken-ichi Kawarabayashi, Christian Sommer, and Mikkel Tho-rup. More compact oracles for approximate distances in undi-rected planar graphs. In SODA, pages 550563. SIAM, 2013.
[LMN13] Mingfei Li, Chu Chung Christopher Ma, and Li Ning. (1 +Īµ)-distance oracles for vertex-labeled planar graphs. In TAMC,pages 4251, 2013.
[LT79] Richard J Lipton and Robert Endre Tarjan. A separator theo-rem for planar graphs. SIAM Journal on Applied Mathematics,36(2):177189, 1979.
[MS15] Shay Mozes and Eyal E. Skop. Ecient vertex-label distanceoracles for planar graphs. In WAOA, pages 97109, 2015.
[PR01] Rasmus Pagh and Flemming Friche Rodler. Cuckoo hashing.In ESA, pages 121133, 2001.
[Som14] Christian Sommer. Shortest-path queries in static networks.ACM Comput. Surv., 46(4):45:145:31, 2014.
[Tho04] Mikkel Thorup. Compact oracles for reachability and approx-imate distances in planar digraphs. J. ACM, 51(6):9931024,2004.
BIBLIOGRAPHY 42
[TZ01] Mikkel Thorup and Uri Zwick. Approximate distance oracles.In STOC, pages 183192. ACM, 2001.
[Wil83] Dan E. Willard. Log-logarithmic worst-case range queries arepossible in space theta(n). Inf. Process. Lett., 17(2):8184, 1983.
[Wil14] Bryan T. Wilkinson. Amortized bounds for dynamic orthogonalrange reporting. In ESA, pages 842856, 2014.
[Wul12] Christian Wul-Nilsen. Approximate distance oracles with im-proved preprocessing time. In SODA, pages 202208. SIAM,2012.
[Wul16] Christian Wul-Nilsen. Approximate distance oracles for pla-nar graphs with improved query time-space tradeo. In SODA,pages 351362, 2016.
Appendix
43
A Reduction from stretch-(1 + Īµ)vertex-labeled distance oracle to
scale-(Ī±, Īµ) distance oracle.
We now describe how to use a scale-(Īµ, Ī±) vertex-labeled distance oracle toobtain a stretch-(1 + Īµ) distance oracle. For vertex-vertex distance oracles,this reduction was proven by Thorup as captured in Lemma 1.
For the static vertex-labeled case, a similar reduction was presented byMozes and Skop, and is as follows: The proof of Lemma 1 relies on tworeductions [Tho04, Lemmas 3.2,3.8]. The rst shows that from any graphG and for any Ī± > 0, one can construct a family of Ī±-layered graphs GĪ±
i iwhose total size is linear in the size of G, and such that:
1. Ī£|GĪ±i | = O(|G|), where |G| = |V (G)|+ |E(G)|.
2. Each v ā V (G) has an index j(v) s.t. any w ā V (G) has d =Ī“G(v, w) ā¤ Ī± i d = minĪ“GĪ±
j(v)ā2(v, w), Ī“GĪ±
j(v)ā1(v, w), Ī“GĪ±
j(v)(v, w).
3. EachGĪ±i is a minor ofG. I.e., it can be obtained fromG by contraction
ad deletion of arcs and vertices. In particular, if G is planar, so is GĪ±i .
Item (2.) means that any shortest path of length at most Ī± in G is repre-sented in at least one of three xed graphsGĪ±
i . Thus, one can use scale-(Ī±, Īµ)distance oracles for the Ī±-layered graphs GĪ±
i to implement a scale-(Ī±, Īµ)oracle of G.
The second reduction [Tho04, Lemmas 3.8] is a scaling argument thatshows how to construct a stretch-(1 + Īµ) distance oracle for G using scale-(Ī±, Īµā²) distance oracles for Ī± ā 2iiā[1,dlog(nNe]. The reduction does notrely on planarity. Now consider the vertex-labeled case. Let Gā be the
44
A. REDUCTION FROM STRETCH-(1 + Īµ) TO SCALE-(Ī±, Īµ)DISTANCE ORACLE 45
graph obtained from G by adding apices representing the labels. A vertex-to-vertex distance oracle for Gā is a vertex-labeled distance oracle for G,and vice versa. By Thorup's second reduction, it suces to show howto construct a scale-(Ī±, Īµ) vertex-vertex distance oracle for Gā for any Ī±,Īµ, or, equivalently a vertex-labeled scale-(Ī±, Īµ) distance oracle for G andevery Ī±, Īµ. Let Ī± ā R+. Given u ā V (G) and Ī» ā L with Ī“G(u, Ī») ā¤ Ī±,let w ā V (G) be the closest Ī» labeled vertex to u. By the properties ofThorup's rst reduction, there is a graph GĪ±
i in whitch the u-to-w distanceis Ī“G(u,w). Thus, a vertex-labeled distance oracle for GĪ±
i will report adistance of at most Ī“G(u, Ī») + ĪµĪ±. Therefore we have the following Lemma:
Lemma 17. For any planar graph G and xed parameter Īµ, a stretch-(1 + Īµ) vertex-labeled distance oracle can be constructed using O(log nN)scale-(Ī±, Īµā²) vertex-labeled distance oracles where Ī± = 2i, i = 0, ...dlog nNeand Īµā² ā 1/2, Īµ/4. Assume that the scale-(Ī±, Īµ) vertex-labeled distance oraclesupports queries in O(TQ(n, Īµ)) and updates in O(TU(n, Īµ)) time, and it canbe constructed in O(TC(n, Īµ)) time and uses O(S(n, Īµ)) space. There existsa S(n, Īµ) log nN space stretch-(1 + Īµ) vertex-labeled distance oracle that an-swers queries in O(TQ(n, Īµ) log log (nN)) and updated in O(TU(n, Īµ) log nN)time can be constructed in O(TC(n, Īµ) log nN) time.
Proof. Given a planar graph G, we decompose G to O(log nN) Ī±-layeredgraphs, and for each we construct a scale-(Ī±, Īµ) distance oracle. We get thespace requirements, and the construction and query times by using Lemma1. Since we must keep all O(log nN) scale oracles up to date, we performeach update operation O(log nN) times, and the lemma follows.
×Ŗקצ××Ø
×××, ××× ××× × ××ק×××¢× ×¦×××¢×Ŗ ק×××Ø×£ ××× ××Ø×ק×× ×ק××Ø×. צ××¢××¢× ××× ××ק××ש×Ø ×× ××× ×ק××Ø×£ G×××
1), ×××××Ø Ī»×צ××¢ š£ ××ק××× ×Ŗ×× ××, ×ש×Ø ×××× ×Ŗ× ×§ + š)-ק××Ø×× ×××Ø×ק ××× š£ × ×ק×Ø×× ××××Ŗ×Ø ×צ×××¢ ××ק××ק
×××.××ק××× ×× ××”×£ ××× ×Ŗ××× ×ש×× ×× ×¦×××¢×Ŗ ×ק ××× ×××××× ×× "× ××ק×Ø× .G ×××Ø×£ Ī»×צ××¢
×××, ×××× ××¢×× ××× ××ק×ק××× ×××× ×××Ø×£ ××ש××Ø× ××¢× ×¦×××¢×Ŗ ×ק××Ø××× ××Ø×ק×× ×× × ×¦×× ×©×××©× ×××× ×ק×Ø××
××× ××× ×××Ø×ק×× ××ק××Ø× ×××× ××× ××Ø×ש×× ×ק×× ×§×Ø×× ×××× ××Ø×.××Ø×ש××Ŗ ××Ŗ× ××¢×××× ×¤×××××××Ø××Ŗ×××, ×ש××
××× ××Ø×××.-×Ŗ×Ŗש×× ×× ×ש××××Ŗ×××× ××× ×¢×××× × ×× ××××ש×Ø
×××Ø×× ×××× ×Ŗ×××× ×××Øצ×××הפ×Ø ××¤× ××Ø×× ××××¢× ×××ש×-×××Ŗ
××ק×Ø×××”××× - (.M.Sc××Ŗ×× ××Ŗ ××Ŗ×××Ø ×©× × )
××× ××× ×××Ø×£ ×ק××Ø× ××× ××Ø×ק××
×××××ק×××ש××Ø× ××¢× ×¦×××¢×Ŗ ק
.M.Scק ××××Ø×ש××Ŗ ××©× ×§×××Ŗ ×Ŗ×××Ø ×××”×× ××× ×× ××××ש×Ŗ×¢××××Ŗ ×Ŗ
××Øצ××× ×× ××××¢× ×××ש×, ×××Ø×× ×××× ×Ŗ×××××××”××× ×××ק×Ø× ××××Ŗ הפ×Ø ××¤× ××Ø
×××Ŗ× ××ש×××ש ×¢× ×××
××× ××××Ŗ ×"×Ø ×©× ××××”.
2017 ×”×××××