KEMBAR78
Dynamic DFS in Undirected Graph using Segment Tree | PPTX
CMSC 641 – Research Project (Team 10)
Original Paper: Dynamic DFS in Undirected Graphs: breaking the O(m) barrier (SODA’16 Page: 730-739)
Authors: Baswana, Surender ; Chaudhury, Shreejit ; Choudhary, Keerti ; Khan, Shahbaz
m : Number of Edges
n : Number of Vertices
DB
A
C
E
Graph G
DB
A
C
E
DFS tree T
5
2 5
1 2 5 6
0 1 2 3 4 5
18 17 13 19 15 11 20
[0,6]
[4,6]
[4,5]
[6,6]
[0,0] [1,1] [2,2] [3,3] [4,4] [5,5]
[0,3]
[0,1] [2,3]
0 1 2 3 4 5 6
Array
r
w
v
T*
e1’
e1
e2’
e2
C1
C2
C1 & C2 - Connected Components
r
ma
b
f
c
d
e
g
k
l
h
i j
r
ma
b
f
c
d
e
g
k
l
h
i j
Failure of edge (b, f). Partial DFS tree T with unvisited graph T(f), components
property allows us to neglect (a, l).
r
m
a
b
k
c
d
e g
f
lh
i j
r
m
a
b
k
c
d
e g
f
lh
i j
Augmented path(k, f) to T, components property allows us
to neglect (l, k).
Final DFS tree of G{(b, f)}.
DFS Tree
x
u
v
z
y
w
s t
x z w s t y u v List L
x z w s t y u v
(x,s) (z,w) (w,s) (s,w) (t,w)
(z,t) (w,t)
Segment Tree TB
x z w s t y u v
Segment Tree TB
[w-s]
(s,w)
(t,w)(w,s)
(z,w)
(x,s)
BST stored at segment tree node [w-s]
(x,s) (z,w) (w,s) (s,w) (t,w)
Edge-list sorted according to List L
x z w s t y u v List L
Overall Complexity: O(log3n)
x
u
v
z
yw
s
t
Path Vector
Tree Vector
x z w s t y u v List L
Query (T (w), x, y)
Time Complexity : O(log m * log n)
BUIDLING DATA STRUCTURE
QUERY OPERATION
m : Number of Edges
n : Number of Vertices
https://github.com/simemon/DAA
THANK YOU

Dynamic DFS in Undirected Graph using Segment Tree