6.889 — Lecture 12: Exact Distance Oracles
(a.k.a. ShortestPath
Queries
)
Christian Sommer
[email protected]
(figures extracted from [
Dji96
,
FR06
])
October 24, 2011
Distance Oracle
: given a graph
G
= (
V, E
)
, preprocess it into a data structure such that we can compute
shortestpath distances
d
G
(
v, w
)
(
distance queries
) efficiently (and output path if desired).
two algorithms: one algorithm to
preprocess
the graph, one algorithm to
query
the data structure.
Assumption (all of Lecture 12)
planar
G
, nonnegative edge lengths
‘
:
E
→
R
+
Lazy strategy
run SSSP algorithm for every query
d
G
(
v, w
)
preprocessing time 0, space
O
(
n
)
(store the graph), query time
O
(
n
)
Eager strategy
precompute APSP, complete distance matrix, one table lookup to answer query
d
G
(
v, w
)
preprocessing time and space
O
(
n
2
)
, query time
O
(1)
Oracle
something “between” SSSP and APSP? applications: route planning, traffic simulations, etc.
main concern:
preprocessing time
(running time of the first algorithm),
space
consumption of the data struc
ture (size of the output of the first algorithm), and
query time
(running time of the second algorithm) — in
particular,
tradeoffs
between these quantities
Recall: MSSP data structure
preprocessing time and space
O
(
n
log
n
)
, query time
O
(log
n
)
(queries how
ever restricted to source on single face)
r
–division approach
pieces of size
O
(
r
)
with boundary
O
(
√
r
)
per piece (total boundary
O
(
n/
√
r
)
)
precompute APSP for all nodes on the boundary, space
O
(
n
2
/r
)
; at query time, explore piece of
v
(say
P
v
)
and piece of
w
(
P
w
) and find best connection pair
∂P
v
×
∂P
w
, piece sizes
O
(
r
)
and
O
(
√
r
)
2
connection pairs,
total query time
O
(
r
)
smoothly interpolates between SSSP and APSP (only separators used, extends to
minorfree graphs). can we do better?
Connections between pieces
O
(
√
r
)
2
connection pairs in
∂P
v
×
∂P
w
, not independent!
(assume boundary
∂P
on
O
(1)
cycles,
r
–division with
O
(1)
holes
per piece
P
)
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Noncrossing property and bipartite Monge search
Main idea
store
distance from
v
to all nodes in
∂P
v
with respect to
G
(not just
P
v
). space
O
(
n
√
r
)
.
between boundary nodes, precompute distance in
G
\
(
P
v
∪
P
w
)
. space
O
(
n
2
/r
)
.
at query time,
divide and conquer
for the best pair in
∂P
v
×
∂P
w
. F
OR
E
ACH
boundary node
y
∈
∂P
w
,
•
find the
best
boundary node
x
∈
∂P
v
, minimizing
min
x
∈
∂P
v
d
G
(
v, x
) +
d
G
\
(
P
v
∪
P
w
)
(
x, y
)
if query algo already found pairs
(
x
1
, y
2
)
,
(
x
2
, y
2
)
, the
min
for
y
is restricted to all
x
between
x
1
and
x
2
Figure 1: Noncrossing property
also known as the
Monge
property:
∀
u
6
v
∀
x
6
y
:
d
(
u, x
) +
d
(
v, y
)
6
d
(
u, y
) +
d
(
v, x
)
Figure 2: Noncrossing and Monge properties:
d
(
u, x
) +
d
(
v, y
)
6
d
(
u, y
) +
d
(
v, x
)
.
Monge property is
satisfied for pairwise distances between nodes on a single face of a planar graph (paths cross at node
w
).
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '11
 ErikDemaine
 Algorithms, Graph Theory, Monge, ddG, dense distance graph, bipartite Monge, ∂Pv

Click to edit the document details