Dynamic Graph Algorithms

Slides:



Advertisements
Similar presentations
The Primal-Dual Method: Steiner Forest TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A AA A A A AA A A.
Advertisements

Surender Baswana Department of CSE, IIT Kanpur. Surender Baswana Department of CSE, IIT Kanpur.
© 2004 Goodrich, Tamassia Campus Tour1. © 2004 Goodrich, Tamassia Campus Tour2 Graph Assignment Goals Learn and implement the adjacency matrix structure.
all-pairs shortest paths in undirected graphs
Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
Dynamic Graph Algorithms - I
1 Discrete Structures & Algorithms Graphs and Trees: III EECE 320.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 CHAPTER 4 - PART 2 GRAPHS 1.
Dynamic All Pairs Shortest Paths Based on the following resources: Camil Demetrescu and Giuseppe F. Italiano (2004) A New Approach to Dynamic All Pairs.
More Graph Algorithms Minimum Spanning Trees, Shortest Path Algorithms.
Perfect Matching for Biconnected Cubic Graphs in O(nlog 2 n) Time Krzysztof Diks & Piotr Stańczyk.
1 Directed Graphs: Victoria Road Problem. 2 Update: Edge is deleted; Edge is inserted Edge weight is changed F A Directed graph problems.
Graph Algorithms: Minimum Spanning Tree We are given a weighted, undirected graph G = (V, E), with weight function w:
1 Dynamic graph connectivity Holm, Lichtenberg, Thorup (98) (based on Henzinger & King (95))
Dynamic Shortest Paths Camil Demetrescu University of Rome “La Sapienza” Giuseppe F. Italiano University of Rome “Tor Vergata”
1 On Dynamic Shortest Paths Problems Liam Roditty Uri Zwick Tel Aviv University ESA 2004.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 11 Instructor: Paul Beame.
Skip Lists1 Skip Lists William Pugh: ” Skip Lists: A Probabilistic Alternative to Balanced Trees ”, 1990  S0S0 S1S1 S2S2 S3S3 
1 An almost linear fully dynamic reachability algorithm Liam Roditty and Uri Zwick Tel Aviv University.
Rubao Ji Advisor: Dr. Robert W. Robinson Committee: Dr. E. Rodney Canfield Dr. Daniel M. Everett   Dynamic connectivity algorithms for Feynman.
Improved Randomized Algorithms for Path Problems in Graphs PhD Thesis Surender Baswana Department of Computer Science & Engineering, I.I.T. Delhi Research.
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
Algorithms: Design and Analysis Summer School 2013 at VIASM: Random Structures and Algorithms Lecture 3: Greedy algorithms Phan Th ị Hà D ươ ng 1.
10/2/2015 3:00 PMCampus Tour1. 10/2/2015 3:00 PMCampus Tour2 Outline and Reading Overview of the assignment Review Adjacency matrix structure (§12.2.3)
Tight Bounds for Graph Problems in Insertion Streams Xiaoming Sun and David P. Woodruff Chinese Academy of Sciences and IBM Research-Almaden.
Spring 2015 Lecture 11: Minimum Spanning Trees
Graph Algorithms. Definitions and Representation An undirected graph G is a pair (V,E), where V is a finite set of points called vertices and E is a finite.
Near Optimal Streaming algorithms for Graph Spanners Surender Baswana IIT Kanpur.
Introduction to Graph Theory
Facility Location in Dynamic Geometric Data Streams Christiane Lammersen Christian Sohler.
Graphs Upon completion you will be able to:
Exponential random graphs and dynamic graph algorithms David Eppstein Comp. Sci. Dept., UC Irvine.
A randomized linear time algorithm for graph spanners Surender Baswana Postdoctoral Researcher Max Planck Institute for Computer Science Saarbruecken,
CSE 589 Applied Algorithms Spring 1999 Prim’s Algorithm for MST Load Balance Spanning Tree Hamiltonian Path.
Certifying Algorithms [MNS11]R.M. McConnell, K. Mehlhorn, S. Näher, P. Schweitzer. Certifying algorithms. Computer Science Review, 5(2), , 2011.
Randomized Incremental Algorithm for Delaunay Triangulation (DT) CS Gates 219 October 19, 3:00 – 4:20 Richard Zhang (for Leo G.) Disclaimer: All.
Algorithms for Big Data: Streaming and Sublinear Time Algorithms
Randomized Min-Cut Algorithm
Introduction to Randomized Algorithms and the Probabilistic Method
Algorithm Analysis Fall 2017 CS 4306/03
Chapter 9 : Graphs Part II (Minimum Spanning Trees)
Chapter 5. Greedy Algorithms
Improved Randomized Algorithms for Path Problems in Graphs
Minimum Spanning Tree 8/7/2018 4:26 AM
CS 3343: Analysis of Algorithms
Lecture 18: Uniformity Testing Monotonicity Testing
Community detection in graphs
Skip Lists.
MST in Log-Star Rounds of Congested Clique
Campus Tour 11/16/2018 3:14 PM Campus Tour Campus Tour
Randomized Algorithms CS648
Graphs & Graph Algorithms 2
Randomized Algorithms CS648
Graphs Chapter 11 Objectives Upon completion you will be able to:
Improved dynamic reachability algorithms for directed graphs
Campus Tour 2/23/ :26 AM Campus Tour Campus Tour
Dynamic Graph Algorithms
Haitao Wang Utah State University SoCG 2017, Brisbane, Australia
CSE 373: Data Structures and Algorithms
CSE 373 Data Structures and Algorithms
Introduction to Algorithms: Greedy Algorithms (and Graphs)
Minimum Spanning Trees (MSTs)
CSE 373: Data Structures and Algorithms
CSE 373: Data Structures and Algorithms
Lecture 10 Graph Algorithms
Dynamic graph connectivity
Heaps Section 6.4, Pg. 309 (Section 9.1).
Presentation transcript:

Dynamic Graph Algorithms II 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

Fully dynamic connectivity Update time Query time Reference O( 𝒎 ) O(𝟏) Frederickson, SICOMP 83 O( 𝒏 ) O(𝟏) Eppstein et al. J. ACM 91 expected amortized randomized O( log 𝟑 𝒏) O(log 𝒏) Henzinger and King, J.ACM 99 Prerequisites ? Elementary knowledge of probability

Deterministic Algorithm Input Output The output as well as the running time are functions only of the input. Algorithm

Deterministic Algorithm Randomized Random bits Input Output The output or the running time are functions of the input and random bits chosen . Algorithm

Organization of the Talk 𝟏. Random sampling 𝟐. Experiencing the difficulty of the problem 𝟑. A simple but inefficient algorithm 𝟒. Designing the efficient algorithm

Part I Random Sampling A gentle introduction

Elementary Probability Tossing a coin 𝟏 𝟐 𝒌 𝐏[ No HEAD appears in 𝒌 tosses] = ?

Problem: Given an array A[1…𝑛] storing 0/1s. Report any index storing 𝟏. Theorem: For every deterministic algorithm, there exists an input for which 𝛀(𝑛) entries will be scanned to find the first 𝟏. At least ½ of the entries in A are 𝟏. A 𝟎 𝟎 𝟏 𝟎 𝟎

Random Sampling Problem: Given an array A[1…𝑛] storing 0/1s. Report any index storing 𝟏. At least ½ of the entries in A are 𝟏. 1 𝑘 A 𝟎 𝟏 Randomized Algorithm count  𝟎; Repeat count  count +𝟏; 𝒊 a random number from [𝟏..𝒏]; Until ((A[𝒊] ≠𝟏) and (count < 𝒄 log 𝒏)) 𝒌 𝟏 𝟐 𝒄log 𝒏 𝟏 𝒏 𝒄 Probability of failure :

Experiencing the difficulty of the problem Part II Experiencing the difficulty of the problem

Fully dynamic connectivity

Fully dynamic connectivity Update time Query time Reference O( 𝒎 ) O(𝟏) Frederickson, SICOMP 83 O( 𝒏 ) O(𝟏) Eppstein et al. J. ACM 91 expected amortized randomized O( log 𝟑 𝒏) O(log 𝒏) Henzinger and King, J.ACM 99 1 2 1 2 3 2 log 𝒏 O( 𝒎 log 𝟐 𝒏) O( 𝒌 𝒎 log 𝟐 𝒏) 𝒌 levels

Fully dynamic connectivity with O( 𝒎 lo g 𝟐 𝒏) update time

Fully dynamic connectivity with O( 𝒎 lo g 𝟐 𝒏) update time The 2-level algorithm 2 1

Fully dynamic connectivity with O( 𝒎 lo g 𝟐 𝒏) update time Idea: Maintain a spanning forest

Fully dynamic connectivity with O( 𝒎 lo g 𝟐 𝒏) update time Decremental What is the real challenge ?

A simple but inefficient algorithm Part III A simple but inefficient algorithm

A simple decremental algorithm Question: Can we find a replacement edge in 𝑶 (| 𝝁(𝑻) |) time ? Operations Time Enumerating all non-tree edges incident on a tree 𝑻 O(𝝁(𝑻)log 𝒏) Checking if two vertices belong to the same tree O(log 𝒏) 𝝁(𝑻) : non tree edges 𝑻

A simple decremental algorithm Question: Can we find a replacement edge in 𝑶 (| 𝝁(𝑻) |) time ? Euler Tour tree 𝝁(𝑻) : non tree edges 𝑻 Homework: Picking a non-tree edge randomly uniformly in O(log 𝒏) time ?

The efficient algorithm Part IV The efficient algorithm

Fully dynamic connectivity with O( 𝒎 lo g 𝟐 𝒏) update time Decremental A combination of two simple tools A simple 𝑶 (| 𝝁(𝑻) |) time algorithm Random sampling Exercise

1 |cut( 𝑻 𝟏 , 𝑻 𝟐 )| |𝝁( 𝑻 𝟏 )| ≥ 𝟏 𝒌 < 𝟏 𝑘 sparse dense Data structure for 𝑻 𝟏 ≥ 𝟏 𝒌 < 𝟏 𝑘 sparse dense 1 Pick non tree edge incident on 𝑻 𝟏 𝑘 log 𝑛 uniformly randomly 𝑻 𝟏 𝑻 𝟐 𝑻 cut( 𝑻 𝟏 , 𝑻 𝟐 )

Trivial algorithm at Level 𝟐 What if the cut is sparse ? |𝝁( 𝑻 𝟏 )| < 𝟏 𝒌 sparse Trivial algorithm at Level 𝟐 What if the cut is sparse ? Level 𝟐 Level 𝟏 𝑻 𝟏 𝑻 𝟐 Random sampling at level 𝟏

Handling the deletion of a tree edge 2-Level approach A partition of 𝑬 into two levels : ( 𝑬 𝟏 , 𝑬 𝟐 ) In the beginning, 𝑭 𝟏 : spanning forest of 𝑬 𝟏 𝑭 𝟐 : spanning forest of 𝑬, 𝑬 𝟏 =𝑬 and 𝑬 𝟐 = Ø 𝑭 𝟏 ⊆ 𝑭 𝟐

Algorithm for Deletion of tree edge (𝒖,𝒗) yes (𝒖,𝒗) ϵ 𝑭 𝟐 \ 𝑭 𝟏 ? scan 𝝁 𝟐 Level 𝟐 No 𝑻 𝟏 : smaller tree Sample(𝝁( 𝑻 𝟏 )) 𝒆 yes 𝒆 ∈ cut( 𝑻 𝟏 , 𝑻 𝟐 ) ? Join 𝑻 𝟏 and 𝑻 𝟐 at Level 1 No yes Level 𝟏 counter++ <𝒄𝒌 log 𝒏 ? No Compute cut( 𝑻 𝟏 , 𝑻 𝟐 ) No Probability ≤𝒏 −𝒄 Is cut( 𝑻 𝟏 , 𝑻 𝟐 ) sparse ? yes Move cut( 𝑻 𝟏 , 𝑻 𝟐 ) to Level 2 Add an edge from cut( 𝑻 𝟏 , 𝑻 𝟐 ) to 𝑭 𝟐

Analysis ≤ |𝝁( 𝑻 𝟏 )| 𝒌 charge 𝒅𝒆𝒈⁡(𝒗) 𝒌 edges to each 𝒗 ∈𝑻 𝟏 Upon splitting 𝑻 into 𝑻 𝟏 and 𝑻 𝟐 , how many edges are passed to level 2 ? ≤ |𝝁( 𝑻 𝟏 )| 𝒌 charge 𝒅𝒆𝒈⁡(𝒗) 𝒌 edges to each 𝒗 ∈𝑻 𝟏 | 𝝁 𝟐 | = O( 𝑚 𝑘 log 𝑛) Level 𝟐 Level 𝟏 𝒗 𝑻 𝟏 𝑻 𝟐

Analysis Theorem: Decrement connectivity can be maintained in expected amortized 𝐎( 𝒎 log 2 𝒏 ) time per edge deletion. Cases Time taken (𝒖,𝒗) ϵ 𝑭 𝟐 \ 𝑭 𝟏 O( 𝒎 𝒌 log 2 𝒏) (𝒖,𝒗) ϵ 𝑭 𝟏 O(𝒌 log 2 𝒏) + O(𝝁( 𝑇 1 ) log 𝒏) ×𝒏 −𝒄

Fully dynamic connectivity with O( 𝒎 lo g 𝟐 𝒏) update time Add every newly inserted edge to level 𝟐. Periodically rebuild the data structure after every 𝒎 insertions. Expected amortized time per update : O( 𝒎 log 𝒏) Theorem: Fully dynamic connectivity can be maintained in expected amortized 𝐎( 𝒎 log 𝒏 ) time per update.

Fully dynamic connectivity with O( 𝒎 lo g 𝟐 𝒏) update time The 2-level algorithm Trivial algorithm at Level 𝟐 𝟐 𝟏 Random sampling at level 𝟏 Reduce the sampling rate

Fully dynamic connectivity with O( 𝒎 lo g 𝟐 𝒏) update time The 3-level algorithm Trivial algorithm at Level 𝟑 𝟑 Trivial algorithm at Level 𝟐 Random sampling at level 𝟐 𝟐 𝟏 Random sampling at level 𝟏 Homework 𝒌 levels O( 𝒌 𝒎 log 𝟐 𝒏)

Minimum spanning tree Single source shortest paths tree An open problem Minimum spanning tree Single source shortest paths tree A tree that minimizes the “average” stretch for all pairs.

An open problem 𝑑𝑖𝑠 𝑡 𝑇 (𝑢,𝑣) = distance between 𝑢 and 𝑣 in tree 𝑇. 𝑆𝑡𝑟𝑒𝑡𝑐 ℎ 𝑇 (𝑢,𝑣) = A𝑣𝑒𝑟𝑎𝑔𝑒𝑆𝑡𝑟𝑒𝑡𝑐ℎ(𝑇) = There exists an O(𝑚 polylog 𝑛) time algorithm to compute a spanning tree with average stretch (polylog 𝑛). https://link.springer.com/referenceworkentry/10.1007%2F978-0-387-30162-4_215 Can we maintain such a tree efficiently dynamically ? 𝑑𝑖𝑠 𝑡 𝑇 𝑢,𝑣 𝑑𝑖𝑠 𝑡 𝐺 𝑢,𝑣 1 |𝐸| 𝑢,𝑣 ∈𝐸 𝑆𝑡𝑟𝑒𝑡𝑐 ℎ 𝑇 (𝑢,𝑣)