6.889 — Lecture 4: SingleSource Shortest Paths
Christian Sommer
[email protected]
September 19 and 26, 2011
SingleSource Shortest Path (SSSP) Problem
: given a graph
G
= (
V,E
)
and a
source
vertex
s
∈
V
, compute
shortestpath distance
d
G
(
s,v
)
for each
v
∈
V
(and encode shortestpath tree)
Assumption (all of Lecture 4)
nonnegative edge lengths
‘
:
E
→
R
+
General Graphs
fastest: Dijkstra’s algorithm
O
(
m
+
n
log
n
)
Planar Graphs?
can we use
r
–division? recall that
r
–division of
G
is decomposition into
•
O
(
n/r
)
edgedisjoint
pieces
,
•
each with
6
r
vertices and
•
O
(
√
r
)
boundary
vertices.
⇐
vertices with edges to at least two pieces
assume (temporarily) we can compute
r
–division in
O
(
n
)
.
(Simple) Algorithm
note that Dijkstra running time not “balanced,” nodes are bottleneck. idea:
densify
•
r
–division with
r
:= log
n/
log log
n
(wlog assume
s
is on boundary)
•
FOR EACH piece
P
, FOR EACH boundary node
p
∈
∂P
compute SSSP (Dijkstra) in
P
, store in
∂P
×
∂P
distance matrix (complete graph on
∂P
)
time required:
O
n
log log
n
log
n
s
log
n
log log
n
!
·
O
±
log
n
log log
n
log
±
log
n
log log
n
²²
=
O
³
n
p
log
n
log log
n
´
let
G
0
denote graph with each piece
P
replaced by complete graph on
∂P
•
compute SSSP (Dijkstra) in
G
0
time required:
n
0
:=

V
(
G
0
)

=
O
(
n
p
log log
n/
log
n
)
and
m
0
:=

E
(
G
0
)

=
O
(
n
)
, therefore
O
(
n
0
log
n
0
+
m
0
) =
O
³
n
p
log
n
log log
n
´
•
FOR EACH piece
P
, FOR EACH boundary node
p
∈
∂P
compute SSSP in
P
starting with
d
[
p
] :=
d
G
(
s,p
)
(which computes, for every
p
0
∈
P
, the distance
d
G
(
s,p
0
)
and the
last
boundary node
p
∈
∂P
on the
shortest path from
s
to
p
0
)
note that output
not
necessarily in sorted order
let’s try recursion? issues:
√
r
instances of SSSP per piece,
G
0
is
nonplanar
graph
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document1 Fast
r
–division
need
r
–division in many algorithms. ﬁrst step of SSSP algorithm. want to improve upon
O
(
n
log
n
)
for SSSP
need fast
r
–division
Lemma.
For planar
G
, we can compute an
r
–division in time
O
(
n
log
r
)
.
improvement over
O
(
n
log
n
)
Idea
do ﬁrst
O
(log
n
)
recursion levels on smaller graph, then
O
(log
r
)
levels on original graph
Def.
A
ρ
–clustering
of
G
is a decomposition into
•
O
(
n/ρ
)
vertexdisjoint
connected pieces
,
•
each with
Θ(
ρ
)
vertices.
Lemma.
A
ρ
–clustering can be found in linear time (assuming
G
has bounded degree).
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '11
 ErikDemaine
 Algorithms, Graph Theory, Shortest path problem, log log, WYBE DIJKSTRA

Click to edit the document details