Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dynamic Graph Algorithms

Similar presentations


Presentation on theme: "Dynamic Graph Algorithms"— Presentation transcript:

1 Dynamic Graph Algorithms
III Surender Baswana Visiting Professor till 31st May 2020 Heinz Nixdorf Institute & Department of Computer Science (Algorithms and Complexity Group)

2 Dynamic DFS tree problem

3 Revisiting DFS traversal
Part I Revisiting DFS traversal

4 DFS traversal A recursive way to traverse the graph
DFS(v) { Visited(v) ← true; For each neighbor w of v { { DFS(w) ; } DFS-traversal(G) { For each vertex vϵ V Visited(v)← false; For each vertex v ϵ V If (Visited(v ) = false) DFS(v); v z y c d b f g h u w r s if (Visited(w) = false) ……..; ……..; A DFS tree rooted at v

5 DFS traversal Applications: Connected components of a graph.
a milestone in the area of graph algorithms Applications: Connected components of a graph. Finding articulation points in a graph. Finding bridges in a graph. Planarity testing of a graph Strongly connected components of a directed graph. O(𝑚+𝑛) time

6 How will an edge appear in DFS traversal ?

7 How will an edge appear in DFS traversal ?
It can never happen u x y

8 DFS traversal from a non-root vertex?
y f b h v w d g x y z s c

9 Flexibility versus restriction
h v w d g x y z s c

10 Problem: Dynamic DFS tree
Part II Problem: Dynamic DFS tree

11 Dynamic DFS tree Problem: Preprocess a given graph 𝐺=(𝑉,𝐸) to build a data structure s.t. for any online sequence of edge insertion/deletion a DFS tree can be maintained efficiently.

12 Partially dynamic algorithms
Directed Acyclic Graph (DAG): Undirected Graphs: Problem Total Update time Reference Incremental 𝑂(𝑚𝑛) Franciosa et al. (ESA 1996) Decremental 𝑂 𝑚𝑛 log 𝑛 (expected) B and Choudhary (MFCS 2015) Problem Total Update time Reference Incremental 𝑂(𝑚𝑛) Franciosa et al. (1997) Emphasize on the slide Notice the following: Firstly the only known results are partially dynamic Problem Total Update time Reference Incremental 𝑂( 𝑛 2 ) B and Khan (ICALP 2014)

13 Fully dynamic algorithms
Undirected Graphs: Problem Time per Update Reference Fully Dynamic* 𝑶( 𝑚𝑛 log 2.5 𝑛 ) B, Chaudhury, Choudhary, Khan (SODA 2016) Simple enough to be taught at Undergrad course on algorithms. Recent, unpublished, joint work with Shiv Gupta and Ayush Tulsyan at IITK 𝑶( 𝑚𝑛 log 𝑛 ) * Supports both edge and vertex updates.

14 Familiarizing with the dynamic DFS tree problem
Part III Familiarizing with the dynamic DFS tree problem

15 Insertion of an edge u y x Reroot this subtree at y

16 Deletion of an edge x y v Reroot this subtree at v

17 A novel decomposition of a tree
Part IV A novel decomposition of a tree

18 Heavy path decomposition of tree

19 Heavy path decomposition of tree

20 Heavy path decomposition of tree

21 Heavy path decomposition of tree

22 Heavy path decomposition of tree

23 Shallow Tree 𝑝 1 𝑝 2 𝑝 3 𝑝 4 𝑝 6 𝑝 5 A tree of arbitrary height
Heavy path decomposition Shallow Tree 𝑝 1 𝑝 2 𝑝 3 𝑝 4 𝑝 6 𝑝 5

24 Algorithm for Rerooting a DFS tree
Part V Algorithm for Rerooting a DFS tree

25 𝑝 T

26 𝑝

27 Exploit Flexibility of DFS 𝑝

28 How to ensure fewer edges in a reduced adjacency list ?
Time to respect the Restriction of DFS Idea: 𝑣 Compute a reduced adjacency list for each vertex 𝑣 in a lazy manner 𝑝

29 More insight into DFS traversal
Part VI More insight into DFS traversal

30 u Observation 1 Redundant v w x Connected components

31 Observation 2 Redundant v Redundant u w x Connected components

32 Resuming the algorithm for Rerooting a DFS tree
Part VII Resuming the algorithm for Rerooting a DFS tree

33 For each 𝑢 on 𝒑, For each ancestor path of 𝒑 Add only one edge to Adj(𝑢) No. of edges added to Adj(𝑢): O(log 𝑛) Observation 2 𝑣 𝑝

34 But before that, can you figure out the entire algorithm now ?
For each descendant 𝑥 of 𝒑, edge incident on 𝒑 Add (𝑥,𝑤) to Adj(𝑤) No. of edges added by 𝑥 to its ancestors ? (𝑥,𝑤)  nearest to 𝑣. Seems many  Observation 1 Data Structure for each vertex 𝑥 : But before that, can you figure out the entire algorithm now ? Edges to ancestors in sorted order 𝑣 𝑤 𝑝 𝑥

35 Begin with the heavy path decomposition of the original DFS tree.
Traverse the longer portion of the path Populate reduced adj. list of traversed path Do DFS starting from most recently visited vertex You might enter another path Do DFS traversal from the most recently visited vertex Do DFS traversal from the most …  𝑝 1 (say 𝑝 2 ) 𝑝 7 Begin with the heavy path decomposition of the original DFS tree. 𝑝 6 (say 𝑝 7 ) 𝑝 1 𝑝 3 𝑝 2 New root 𝑝 5 𝑝 4

36 Algorithm can be seen as a walk on the shallow tree
𝑝 7 𝑝 6 𝑝 1 𝑝 2 𝑝 3 𝑝 4 𝑝 5

37 For each descendant 𝑥 of 𝒑,
edge incident on 𝒑 Add (𝑥,𝑤) to Adj(𝑤) No. of edges added by 𝑥 to its ancestors ? (𝑥,𝑤)  nearest to 𝑣. Seems many  O( log 2 𝑛) Observation 1 𝑣 𝑤 𝑝 𝑥

38 Theorem: A DFS tree 𝑇 of a given graph 𝐺=(𝑉,𝐸) can be preprocessed in O(𝑚) time to build a data structure of O(𝑚) size s.t. for any vertex 𝑣∈𝑉, a DFS tree rooted at 𝑣 can be reported in O(𝑛 log 2 𝑛) time. Thefault tolerant DFS tree problem and fully dynamic DFS tree problem can be solved by “just epsilon” modification to the above algorithm for rerooting . The entire paper is available at Arxiv: Surender Baswana, Shiv Kumar Gupta, Ayush Tulsyan: Fault Tolerant and Fully Dynamic DFS in Undirected Graphs: Simple Yet Efficient. CoRR abs/ (2018)


Download ppt "Dynamic Graph Algorithms"

Similar presentations


Ads by Google