Approximating Distances in Graphs - PowerPoint PPT Presentation

About This Presentation
Title:

Approximating Distances in Graphs

Description:

The girth of a graph is the size of the shortest cycle in the graph. ... Girth Conjecture (Erd s and others) ... resulting graph has girth 2k. Hence, number ... – PowerPoint PPT presentation

Number of Views:57
Avg rating:3.0/5.0
Slides: 60
Provided by: uri74
Category:

less

Transcript and Presenter's Notes

Title: Approximating Distances in Graphs


1
Approximating Distances in Graphs
Otwarte wyklady dla doktorantów
informatykiInstytut InformatykiUniwersytetu
Warszawskiego Kwietnia 27-28, 2007
2
All-Pairs Shortest Paths
APSPalgorithm
n by ndistancematrix
mn time
n2 space
Input A weighted undirected graph G(V,E), where
Em and Vn.
Output An n ? n distance matrix.
3
An estimated distance ?(u,v) is of stretch t
iff ?(u,v) ? ?(u,v) ? t ?(u,v)
Approximate Shortest Paths
Let ?(u,v) be the distance from u to v.
Multiplicativeerror
Additiveerror
An estimated distance ?(u,v) is of surplus t
iff ?(u,v) ? ?(u,v) ? ?(u,v) t
4
Multiplicative and additive spanners
Let G(V, E) be a weighted undirected graph on n
vertices. A subgraph G(V, E) is a t-spanner
of G iff for every u,v?V we have ?G(u,v) t
?G(u,v).
Let G(V, E) be a unweighted undirected graph on
n vertices. A subgraph G(V, E) is an additive
t-spanner of G iff for every u,v?V we have
?G(u,v) ?G(u,v) t.
5
Approximate Distance Oracles
n by ndistancematrix
APSPalgorithm
mn timen2 space
Compact datastructure
Weightedundirected graph
mn1/k timen11/k space
Stretch-Space tradeoff is essentially optimal!
u,v
d(u,v(
O(1) query time stretch 2k?1
6
  • All-pairs almost shortest paths (unweighted)
  • An O(n5/2)-time surplus-2 algorithm (ACIM96)
  • Additive 2-spanners with O(n3/2) edges.
  • An O(n3/2m1/2)-time surplus-2 algorithm (DHZ96)
  • Multiplicative spanners (weighted graphs)
  • (2k?1)-spanners with n11/k edges (ADDJS93)
  • Linear time construction (BS03)
  • Approximate distance oracles (weighted graphs)
  • Stretch2k?1 query timeO(1) spaceO(kn11/k)
    (TZ01)
  • Spanners with sublinear distance errors
    (unweighted)
  • Additive error O(d1/(k?1)) with O(kn11/k) edges
    (TZ05)

7
All-Pairs Almost Shortest Pathsunweighted,
undirected graphs
8
O(n5/2)-time surplus-2 algorithmunweighted,
undirected graphs
  • Add each vertex v to A, independently, with
    probability n?1/2. (Elements of A are centers.)
  • From every center v?A, find a tree of shortest
    paths from v and add its edges to E.
  • For every non-center?v?A
  • If v has a neighbor u?A, then add the single
    edge (u,v) to E.
  • Otherwise, add all the edges incident to v to
    E.
  • Solve the APSP problem on the subgraph G(V,
    E).

O(n)
O(mA) O(n5/2)
O(m)
O(nE) O(n5/2)
9
Number of edges in E
  • The expected of edges added to E in 2) is
    O(n3/2).
  • The expected of edges added to E in 3) is also
    O(n3/2).

Consider a vertex v of degree d
If one of the neighbors of v is placed in A, then
E will contain only one edge incident on v.
v
Hence, the expected number of edgesincident to v
added to E is at most
Exercise 0 Check it!
d(1?n?1/2)d 1 n1/2
10
The surplus-2 algorithmCorrectness Case 1
Case 1 No vertex on a shortest path from u to v
has a neighboring center.
u
v
All the edges on the path are in E.
We find a shortest path from u to v.
11
The surplus-2 algorithmCorrectness Case 2
Case 2 At least one vertex on a shortest path
from u to v has a neighboring center.
w
??(w,v)1
??(u,w)1
w
u
v
We find a path from u to v of surplus at most 2
12
Additive 2-spanners ACIM96 DHZ96
Every unweighted undirected graph G(V, E) on n
vertices has a subgraph G(V, E) with O(n3/2)
edges such that for every u,v?V we have ?G(u,v)
?G(u,v) 2.
Additive 6-spanners BKMP 04
Every unweighted undirected graph G(V, E) on n
vertices has a subgraph G(V, E) with O(n4/3)
edges such that for every u,v?V we have ?G(u,v)
?G(u,v) 6.
Major open problem Are there additive spanners
with o(n4/3) edges?
13
Exercise 1 Show that with high probability, all
distances larger than 2n1/2ln n are correctly
computed by the O(n5/2) time surplus 2 algorithm.
14
O(n3/2m1/2)-time surplus-2 algorithmunweighted,
undirected graphs
  • Add each vertex v to A, independently, with
    probability (n/m)1/2. (Elements of A are
    centers.)
  • From every center v?A, find distances to all
    othervertices in the graph. (Do not add edges to
    E.)
  • For every non-center?v?A
  • If v has a neighbor u?A, then add the single
    edge (u,v) to E.
  • Otherwise, add all the edges incident to v to E.
  • For every non-center vertex v?A
  • Construct a set F(v) (v,w) w?A of weighted
    edges. The weight of an edge (v,w) is ?(w,v).
  • Find distances from v to all other vertices in
    the weighted graph G(v)(V, E??F(v)).

15
O(n3/2m1/2)-time surplus-2 algorithmCorrectness
Case 2
Case 2 At least one vertex on a shortest path
from u to v has a neighboring center.
w
??(u,w)1
u
v
w
Consider the last vertex with a neighboring
center.
We find a path from u to v of surplus at most 2
16
All-Pairs Almost Shortest Pathsweighted
undirected graphs
Some log factors ignores
17
Spanners
Given an arbitrary dense graph, can we always
find a relatively sparse subgraph that
approximates all distances fairly well?
18
Spanners PU89,PS89
Let G(V,E) be a weighted undirected graph.
A subgraph G(V,E) of G is said to be a
t-spannerof G iff dG (u,v) t dG (u,v) for
every u,v ?V.
Theorem Every weighted undirected graph has a
(2k?1) -spanner of size O(n11/k). ADDJS93
Furthermore, such spanners can be constructed
deterministically in linear time. BS03
RTZ05
The size-stretch trade-off is optimal if there
are graphswith ?(n11/k) edges and girth 2k2,
as conjectured by Erdös and others.
19
Exercise 2 Show that the following simple
algorithm constructs, in O(m) time, a
(2k?1)-spanner with at most n11/k edges of any
undirected unweighted graph. While the graph is
not empty, choose a vertex v?V. Let Ni(v) be the
set of vertices of distance at most i from v. Let
j be the smallest integer for which Nj(v)
n1/k Nj?1(v). Add to the spanner a tree of
shortest path from v to all vertices of Nj(v) and
delete the vertices of Nj?1(v) and all the edges
adjacent to them from the graph.
20
Exercise 3 The girth of a graph is the size of
the shortest cycle in the graph. Use the
construction of the previous exercise to show
that the girth of any graph with at least n11/k
edges is at most 2k.
Girth Conjecture (Erdös and others) There are
n-vertex graphs with O(n11/k) edges that have
girth gt 2k .
Known for k1,2,3,5.
21
A simple spanner construction algorithmAlthöfer,
Das, Dobkin, Joseph, Soares 93
  • Consider the edges of the graph in
    non-decreasing order of weight.
  • Add each edge to the spanner if it does not
    close a cycle of size at most 2k.
  • The resulting graph is a (2k?1)-spanner.
  • The resulting graph has girth ?gt 2k.
  • Hence, number of edges in it is at most n11/k.

22
If cycle?2k, then red edge can be removed.
23
Exercise 4 Let mg(n) be the maximum number of
edges in an n-vertex graph of girth ? g. Show
that every n-vertex graph has a t-spanner with
at most mt2(n) edges and that this result is
best possible.
24
Linear time spanner constructionBaswana-Sen 03
  • The algorithm is composed of k iterations.
  • At each iteration some edges are added to the
    spanner and some edges and vertices are removed
    from the graph.
  • At the end of the i-th iteration we have a
    collection of about n1?i/k trees of depth at most
    i that contain all the surviving vertices of the
    graph.

25
Tree properties
  • The edges of the trees are spanner edges.
  • The weights of the edges along every leaf-root
    path are non-increasing.
  • For every surviving edge (u,v) we have w(u,v) ?
    w(u,p(u)), where p(u) is the parent of u.

w3
w2
i
w4
w1
w1 ? w2 ? w3
w4 ? w2
26
Notation
Ai roots of trees of the i-th iterationT(v)
the tree rooted at v
v
T(v)
E(u,T(v)) the edges connecting u and
T(v).e(u,T(v)) the lightest edge from
E(u,T(v)).w(u,T(v)) the weight of e(u,T(v))
(or ??).
u
27
The i-th iteration
Each vertex v?Ai-1 is added to Ai with
probability n?1/k.In the last iteration Ak????.
v1
v2
vr?Ai
u
Let v1,v2, be the vertices of Ai-1 such
thatw(u,T(v1)) w(u,T(v2))
Let rr(u) be the minimal index for which
vr?Ai.If there is no such index, let
r(u)?Ai?1.
28
The i-th iteration (cont.)
v1
v2
vr?Ai
u
For every vertex u that belongs to a tree whose
root is in Ai-1?Ai
Remove edges that connect vertices in the same
tree.
For every 1 j r Add e(u,T(vi)) to the
spanner.Remove E(u,T(vi)) from the graph
Remove vertices that have no remaining edges.
29
How many edges are added to the spanner?
v1
v2
vr?Ai
u
Er(u) n1/k
Hence, the expected number of edges added to the
spanner in each iteration is at most n11/k.
30
What is the stretch?
Let e be an edge deleted in the i-th iteration.
The spanner contains a path of at most 2(i?1)1
edges between the endpoints of e.
i?1
The edges of the path are not heavier than e
e
Hence, stretch 2k?1
31
Exercise 4 Complete the proof that the
algorithm of Baswana-Sen algorithm produces a
(2k?1)-spanner with at most O(kn11/k) edges.
Show that it can be implemented to run in O(km)
time.
Note that a factor of k is lost in the number of
edges.
Exercise 5 Prove the correctness of the
following variant of the Baswana-Sen algorithm
Perform only the first (k?1)/2 iterations of the
original algorithm. (Assume that k is odd.) For
every pair of trees produced in the last
iteration, find the lightest surviving edge that
connects them and add it to the spanner.
32
  • All-pairs almost shortest paths (unweighted)
  • An O(n5/2)-time surplus-2 algorithm (ACIM96)
  • Additive 2-spanners with O(n3/2) edges.
  • An O(n3/2m1/2)-time surplus-2 algorithm (DHZ96)
  • Multiplicative spanners (weighted graphs)
  • (2k?1)-spanners with n11/k edges (ADDJS93)
  • Linear time construction (BS03)
  • Approximate distance oracles (weighted graphs)
  • Stretch2k?1 query timeO(1) spaceO(kn11/k)
    (TZ01)
  • Spanners with sublinear distance errors
    (unweighted)
  • Additive error O(d1/(k?1)) with O(kn11/k) edges
    (TZ05)

33
Approximate Distance Oracles (TZ01)
n by ndistancematrix
APSPalgorithm
mn timen2 space
Compact datastructure
Weightedundirected graph
mn1/k timen11/k space
Stretch-Space tradeoff is essentially optimal!
u,v
d(u,v(
O(1) query time stretch 2k?1
34
Approximate Distance Oracles TZ01A hierarchy
of centers
A0?V Ak ?? Ai ?sample(Ai?1,n?1/k)
35
Bunches
A0 A1 A2
p2(v)
v
p1(v)
36
Lemma EB(v) kn1/k
Proof B(v)?Ai is stochastically dominated by a
geometric random variable with parameter pn?1/k.
37
The data structure
  • Keep for every vertex v?V
  • The centers p1(v), p2(v),, pk-1(v)
  • A hash table holding B(v)

For every w?V, we can check, inconstant time,
whether w?B(v), and if so, what is ?(v,w).
38
Query answering algorithm
Algorithm distk(u,v) w?u , i?0 while
w?B(v) i ?i1 (u,v) ?(v,u) w
?pi(u) return ?(u,w) ?(w,v)
39
Query answering algorithm
w3p3(v)?A3
w2p2(u)?A2
w1p1(v)?A1
w0 u
v
40
Analysis
wipi(u)?Ai
Claim 1 d(u,wi) i? , i evend(v,wi) i? , i
odd
wi?1pi?1(v)?Ai?1
(i1)?
i?
i?
Claim 2 d(u,wi) d(wi,v) (2i1)?
(i?1)?
(2k?1)?
u
v
?
41
Exercise 6 What is the stretch of a query
answering algorithm that does not swap u and v in
each iteration, i.e., finds the smallest i for
which wpi(u)?B(v) and returns ?(u,w) ?(w,v) ?
42
Where are the spanners?
Define clusters, the duals of bunches.
For every u?V, put in the spanner a tree of
shortest paths from u to all the vertices in the
cluster of u.
43
Bunches and Clusters
44
Clusters
w
45
Computing Clusters
Lemma If v?C(w) and u lies on a shortest path
from w to v, then u?C(w).
Using this fact, each cluster can be computed by
a modified version of Dijkstras algorithm that
only examines edges that touch vertices of the
cluster.
46
Exercise 7 Show that the subgraph composed of
the shortest path trees of the clusters is a
(2k?1)-spanner with an expected number of
O(kn11/k) edges.
47
Approximate distance oracles - summary
Preproceesing time O(kmn11/k)
Space O(n11/k)
Query time O(k)
Stretch 2k?1
The space/stretch tradeoff is essentially optimal
(modulo the girth conjecture)
Can the query time be reduced to O(1)?
Manor and Naor (2006) recently gave a solution
with space O(n11/k) , stretch O(k) , query
time O(1)
48
Exercise 8 Show that the subgraph composed of
the shortest path trees of the clusters is a
(2k?1)-spanner with an expected number of
O(kn11/k) edges.
49
Additive Spanners
Let G(V,E) be a unweighted undirected graph.
A subgraph G(V, E) of G is said to be an
additive t-spanner of G iff dG (u,v) dG
(u,v) t for every u,v ?V.
Theorem Every unweighted undirected graph has
an additive 2-spanner of size O(n3/2). ACIM
96 DHZ 96
Theorem Every unweighted undirected graph has
an additive 6-spanner of size O(n4/3). BKMP 04
Major open problem Do all graphs have additive
spanners with only O(n1e) edges, for every egt0 ?
50
Spanners with sublinear surplus
Theorem For every k gt 1, every undirected graph
G(V,E) on n vertices has a subgraph G(V,E)
with O(n11/k) edges such that for every u,v?V,
if dG(u,v)d, then dG(u,v)dO(d1?1/(k?1)).
d
d O(d1?1/(k?1))
Extends and simplifies a result of Elkin and
Peleg (2001)Improved recently by Pettie (2007)
51
All sorts of spanners
A subgraph G(V,E) of G is said to be a
functionalf-spanner if G iff dG (u,v) f(dG
(u,v)) for every u,v ?V.
52
The construction of the approximate distance
oracles, when applied to unweighted graphs,
produces spanners with sublinear surplus!
We present a slightly modified construction with
a slightly simpler analysis.
53
Balls
p2(u)
u
p1(u)
54
Spanners with sublinear surplus
Select a hierarchy of centers A0??A1??Ak?1.
For every u?V, add to the spannera shortest
paths tree of Ballu.
55
The path-finding strategy
Suppose we are at u?Ai and want to go to v.
Let ? be an integer parameter.
If the first xi ?i??i?1 edges of a shortest
path from u to v are in the spanner, then use
them.
Otherwise, head for the (i1)-center ui1 nearest
to u.
? The distance to ui1 is at most xi. (As
u?Ball(u).)
ui1?Ai1
u?Ai
u
v
xi
xi
56
The path-finding strategy
We either reach v, or at least make xi ?i??i?1
steps in the right direction.
Or, make at most xi ?i??i?1 steps, possibly in
a wrong direction, but reach a center of level
i1.
If ik?1, we will be able to reach v.
57
The path-finding strategy
After at most ?i steps
ui
we reach v
or
xi?1
distance to v decreased by ?i ?2?i?1
xi ?i??i?1
xi?2
?i?1
u
x1
x0
u0
v
58
The path-finding strategy
After at most ?i steps
Surplus 2?i?1
we reach v
distance to v decreased by ?i ?2?i?1
Stretch
The surplus is incurred only once!
59
Sublinear surplus
This holds for any ? !? is part of the analysis,
not the construction.
60
Improved spanners with additive error
Pettie (2007) has recently obtained improved
spanners with additive errors.
61
Main open problems
  • Additive spanners?
  • Approximate distance oracleswith additive errors?
Write a Comment
User Comments (0)
About PowerShow.com