Dynamic Graph Algorithms

Slides:



Advertisements
Similar presentations
Graph Algorithms Algorithm Design and Analysis Victor AdamchikCS Spring 2014 Lecture 11Feb 07, 2014Carnegie Mellon University.
Advertisements

Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
Dynamic Graph Algorithms - I
Tirgul 7 Review of graphs Graph algorithms: –DFS –Properties of DFS –Topological sort.
Perfect Matching for Biconnected Cubic Graphs in O(nlog 2 n) Time Krzysztof Diks & Piotr Stańczyk.
Data Structures & Algorithms Graph Search Richard Newman based on book by R. Sedgewick and slides by S. Sahni.
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
Connected Components, Directed Graphs, Topological Sort COMP171.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 9 Instructor: Paul Beame.
An almost linear fully dynamic reachability algorithm.
Connected Components, Directed Graphs, Topological Sort Lecture 25 COMP171 Fall 2006.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 10 Instructor: Paul Beame.
Connected Components, Directed graphs, Topological sort COMP171 Fall 2005.
Liam Roditty Reachability in Directed Graphs. Connectivity in undirected graphs Given two vertices decide whether they are in the same component. Reachability.
Important Problem Types and Fundamental Data Structures
Depth-First Search Idea: Keep going forward as long as there are unseen nodes to be visited. Backtrack when stuck. v G G G G is completely traversed.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
Nattee Niparnan. Graph  A pair G = (V,E)  V = set of vertices (node)  E = set of edges (pairs of vertices)  V = (1,2,3,4,5,6,7)  E = ((1,2),(2,3),(3,5),(1,4),(4,
1 ELEC692 Fall 2004 Lecture 1b ELEC692 Lecture 1a Introduction to graph theory and algorithm.
Tree A connected graph that contains no simple circuits is called a tree. Because a tree cannot have a simple circuit, a tree cannot contain multiple.
CSCI 115 Chapter 7 Trees. CSCI 115 §7.1 Trees §7.1 – Trees TREE –Let T be a relation on a set A. T is a tree if there exists a vertex v 0 in A s.t. there.
CS 146: Data Structures and Algorithms July 16 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak
Chapter 10: Trees A tree is a connected simple undirected graph with no simple circuits. Properties: There is a unique simple path between any 2 of its.
1 AVL Trees II Implementation. 2 AVL Tree ADT A binary search tree in which the balance factor of each node is 0, 1, of -1. Basic Operations Construction,
Data Structures and Algorithm Analysis Graph Algorithms Lecturer: Jing Liu Homepage:
CSC317 1 At the same time: Breadth-first search tree: If node v is discovered after u then edge uv is added to the tree. We say that u is a predecessor.
Graph Search Applications, Minimum Spanning Tree
Introduction to Algorithms
Graphs A New Data Structure
CMPS 3130/6130 Computational Geometry Spring 2017
Chapter 22 Elementary Graph Algorithms
Tracing An Algorithm for Strongly Connected Components that uses Depth First Search Graph obtained from Text, page a-al: Geetika Tewari.
Main algorithm with recursion: We’ll have a function DFS that initializes, and then calls DFS-Visit, which is a recursive function and does the depth first.
Data Structures 13th Week
Discrete Mathematicsq
Conventions Red edges: traversed tree edges White edges: back edges
12. Graphs and Trees 2 Summary
Depth-First Search.
CS202 - Fundamental Structures of Computer Science II
Graph Algorithms Using Depth First Search
Graph Search Applications
Planarity Testing.
Graphs Graph transversals.
Lecture 10 Algorithm Analysis
Graph & BFS.
Graphs & Graph Algorithms 2
Graph Theory.
Graphs Chapter 13.
Elementary graph algorithms Chapter 22
Can you get there from here?
Lectures on Graph Algorithms: searching, testing and sorting
Chapter 11 Graphs.
Connected Components, Directed Graphs, Topological Sort
Graphs.
A Introduction to Computing II Lecture 13: Trees
Reachability in Directed Graphs
CSE 373: Data Structures and Algorithms
Dynamic Graph Algorithms
Chapter 16 1 – Graphs Graph Categories Strong Components
CSE 417: Algorithms and Computational Complexity
Bridges and Articulation Points
Elementary graph algorithms Chapter 22
Important Problem Types and Fundamental Data Structures
Chapter 14 Graphs © 2011 Pearson Addison-Wesley. All rights reserved.
Elementary Graph Algorithms
For Friday Read chapter 9, sections 2-3 No homework
INTRODUCTION A graph G=(V,E) consists of a finite non empty set of vertices V , and a finite set of edges E which connect pairs of vertices .
Graph Traversals Some applications require visiting every vertex in the graph exactly once. The application may require that vertices be visited in some.
GRAPH TRAVERSAL.
Presentation transcript:

Dynamic Graph Algorithms III Surender Baswana Visiting Professor till 31st May 2020 Heinz Nixdorf Institute & Department of Computer Science (Algorithms and Complexity Group) sbaswana@campus.uni-paderborn.de sbaswana@gmail.com

Dynamic DFS tree problem

Revisiting DFS traversal Part I Revisiting DFS traversal

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

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

How will an edge appear in DFS traversal ?

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

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

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

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

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.

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)

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.

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

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

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

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

Heavy path decomposition of tree

Heavy path decomposition of tree

Heavy path decomposition of tree

Heavy path decomposition of tree

Heavy path decomposition of tree

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

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

𝑝 T

𝑝

Exploit Flexibility of DFS 𝑝

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 𝑝

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

u Observation 1 Redundant v w x Connected components

Observation 2 Redundant v Redundant u w x Connected components

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

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

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 𝑣 𝑤 𝑝 𝑥

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

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

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 𝑣 𝑤 𝑝 𝑥

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/1810.01726 (2018)