Randomized Algorithms CS648

Slides:



Advertisements
Similar presentations
Surender Baswana Department of CSE, IIT Kanpur. Surender Baswana Department of CSE, IIT Kanpur.
Advertisements

all-pairs shortest paths in undirected graphs
Approximate Distance Oracles and Spanners with sublinear surplus Mikkel Thorup AT&T Research Uri Zwick Tel Aviv University.
Size-estimation framework with applications to transitive closure and reachability Presented by Maxim Kalaev Edith Cohen AT&T Bell Labs 1996.
Dynamic Graph Algorithms - I
Lecture 24 Coping with NPC and Unsolvable problems. When a problem is unsolvable, that's generally very bad news: it means there is no general algorithm.
Approximation, Chance and Networks Lecture Notes BISS 2005, Bertinoro March Alessandro Panconesi University La Sapienza of Rome.
IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture10.
 Graph Graph  Types of Graphs Types of Graphs  Data Structures to Store Graphs Data Structures to Store Graphs  Graph Definitions Graph Definitions.
CSL758 Instructors: Naveen Garg Kavitha Telikepalli Scribe: Manish Singh Vaibhav Rastogi February 7 & 11, 2008.
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
1 Spanning Trees Lecture 20 CS2110 – Spring
Recent Development on Elimination Ordering Group 1.
Randomized Algorithms and Randomized Rounding Lecture 21: April 13 G n 2 leaves
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
1 Approximate Distance Oracles Mikkel Thorup AT&T Research Uri Zwick Tel Aviv University.
Shortest Path Problems Directed weighted graph. Path length is sum of weights of edges on path. The vertex at which the path begins is the source vertex.
Computability and Complexity 24-1 Computability and Complexity Andrei Bulatov Approximation.
Job Scheduling Lecture 19: March 19. Job Scheduling: Unrelated Multiple Machines There are n jobs, each job has: a processing time p(i,j) (the time to.
Study Group Randomized Algorithms Jun 7, 2003 Jun 14, 2003.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
Randomness in Computation and Communication Part 1: Randomized algorithms Lap Chi Lau CSE CUHK.
Approximate Distance Oracles for Geometric Spanner Networks Joachim Gudmundsson TUE, Netherlands Christos Levcopoulos Lund U., Sweden Giri Narasimhan Florida.
Introduction Outline The Problem Domain Network Design Spanning Trees Steiner Trees Triangulation Technique Spanners Spanners Application Simple Greedy.
A General Approach to Online Network Optimization Problems Seffi Naor Computer Science Dept. Technion Haifa, Israel Joint work: Noga Alon, Yossi Azar,
The Shortest Path Problem
TECH Computer Science Graph Optimization Problems and Greedy Algorithms Greedy Algorithms  // Make the best choice now! Optimization Problems  Minimizing.
Randomized Algorithms Morteza ZadiMoghaddam Amin Sayedi.
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.
Distance sensitivity oracles in weighted directed graphs Raphael Yuster University of Haifa Joint work with Oren Weimann Weizmann inst.
Prims’ spanning tree algorithm Given: connected graph (V, E) (sets of vertices and edges) V1= {an arbitrary node of V}; E1= {}; //inv: (V1, E1) is a tree,
Approximate Distance Oracles Mikkel Thorup and Uri Zwick Presented By Shiri Chechik.
Minimum spanning trees (MST) Def: A spanning tree of a graph G is an acyclic subset of edges of G connecting all vertices in G. A sub-forest of G is an.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
SPANNING TREES Lecture 20 CS2110 – Fall Spanning Trees  Definitions  Minimum spanning trees  3 greedy algorithms (incl. Kruskal’s & Prim’s)
CSE 421 Algorithms Richard Anderson Winter 2009 Lecture 5.
A randomized linear time algorithm for graph spanners Surender Baswana Postdoctoral Researcher Max Planck Institute for Computer Science Saarbruecken,
Great Theoretical Ideas in Computer Science for Some.
Network Partition –Finding modules of the network. Graph Clustering –Partition graphs according to the connectivity. –Nodes within a cluster is highly.
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. Fast.
Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block.
Improved Randomized Algorithms for Path Problems in Graphs
Minimum Spanning Tree 8/7/2018 4:26 AM
Shortest Path Problems
CS 3343: Analysis of Algorithms
Computability and Complexity
Comp 245 Data Structures Graphs.
Randomized Algorithms CS648
Enumerating Distances Using Spanners of Bounded Degree
Randomized Algorithms CS648
Greedy Algorithms / Dijkstra’s Algorithm Yin Tat Lee
Graphs Chapter 11 Objectives Upon completion you will be able to:
Introduction Wireless Ad-Hoc Network
Shortest Path Problems
Analysis of Algorithms
Approximate Distance Oracles
Algorithms (2IL15) – Lecture 7
Haitao Wang Utah State University SoCG 2017, Brisbane, Australia
Lecture 14 Shortest Path (cont’d) Minimum Spanning Tree
Dynamic Graph Algorithms
Compact routing schemes with improved stretch
Graphs G = (V, E) V are the vertices; E are the edges.
Randomized Algorithms CS648
CSE 417: Algorithms and Computational Complexity
The Greedy Approach Young CS 530 Adv. Algo. Greedy.
Lecture 13 Shortest Path (cont’d) Minimum Spanning Tree
Prims’ spanning tree algorithm
Analysis of Algorithms
Presentation transcript:

Randomized Algorithms CS648 Lecture 18 Approximate Distance Oracles Algorithm for Min-cut : part 1

Approximate Distance oracles

All-Pairs Shortest Paths Notations and Terminologies : A graph 𝑮=(𝑽,𝑬) on 𝒏=|𝑽| vertices 𝒎=|𝑬| edges 𝝎:𝑬→ 𝑹 + A path from 𝒖 to 𝒗: a sequence (𝒖=)𝒙 𝟎 , 𝒙 𝟏 ,…, 𝒙 𝒌 (=𝒗) where ( 𝒙 𝒊 , 𝒙 𝒊+𝟏 ) ∈𝑬 Length of a path 𝑷 : sum of the weights on the edges of path 𝑷. Shortest path from 𝒖 to 𝒗 : the path of smallest length from 𝒖 to 𝒗. Distance from 𝒖 to 𝒗 : the length of the shortest path from 𝒖 to 𝒗. 𝜹(𝒖,𝒗) : Distance from 𝒖 to 𝒗

All-Pairs Shortest Paths Problem Definition: Given a graph 𝑮=(𝑽,𝑬), build a compact data structure so that for any 𝒖,𝒗∈𝑽, 𝜹(𝒖,𝒗) can be reported in 𝑶(𝟏) time Shortest path from 𝒖 to 𝒗 can be reported in optimal time. Results known: 𝑶( 𝒏 𝟐 ) size data structure (Distance matrix and Witness matrix) 𝑶(𝒎𝒏+ 𝒏 𝟐 𝐥𝐨𝐠 𝒏) preprocessing time (Dijkstra’s algorithm from each vertex) Current-state-of-the-art RAM size: 8 GBs Can’t handle graphs with even 𝟏𝟎 𝟓 vertices (with RAM size) 

All-Pairs Approximate Shortest Paths Problem Definition: Given a graph 𝑮=(𝑽,𝑬), build a compact data structure so that for any 𝒖,𝒗∈𝑽, it reports 𝜹 (𝒖,𝒗) in 𝑶(𝟏) time satisfying 𝜹 𝒖,𝒗 ≤ 𝜹 (𝒖,𝒗)≤𝒕 𝜹(𝒖,𝒗) 𝒕: stretch. Aim: To achieve Sub-quadratic space. Sub-cubic preprocessing time. With 𝑶(𝟏) query time. Many elegant results have been invented for undirected graphs 

Approximate Distance Oracles A truly magical result Approximate Distance Oracles 𝒕:Stretch Space Query time Preprocessing time 𝑶( 𝒏 𝟏+ 𝟏 𝟐 ) 𝑶(𝟏) 𝑶( 𝒎𝒏 𝟏 𝟐 ) 𝟑 𝑶( 𝒏 𝟏+ 𝟏 𝟑 ) 𝑶(𝟏) 𝑶( 𝒎𝒏 𝟏 𝟑 ) 𝟓 𝑶( 𝒏 𝟏+ 𝟏 𝒌 ) 𝑶(𝒌) 𝑶( 𝒌 𝒎𝒏 𝟏 𝒌 ) 𝟐𝒌−𝟏 Mikkel Thorup and Uri Zwick: Approximate Distance Oracles for graphs, Journal of ACM (4), 2005

Inspiration from our daily life

Air/Road Network 𝑳𝒖𝒄𝒌𝒏𝒐𝒘 𝑫𝒆𝒍𝒉𝒊 𝑲𝒂𝒏𝒑𝒖𝒓 𝑩𝒂𝒏𝒈𝒂𝒍𝒐𝒓𝒆

The Idea Given a graph 𝑮=(𝑽,𝑬), Compute a small set 𝑳 of Landmark vertices. From each vertex 𝒖∈𝑽\𝑳, store distance to vertices present in its locality. From each vertex 𝒗∈𝑳, store distance to all vertices in the graph. Questions: What is the formal notion of locality ? How to retrieve distance from 𝒖 to a far away vertex ? What is the guarantee of stretch ? How to compute the desired set 𝑳 efficiently ?

Formal notion of locality 𝒖

Formal notion of locality 𝑩𝒂𝒍𝒍(𝒖,𝑽,𝑳)= {𝒙∈𝑽| 𝜹 𝒖,𝒙 <𝜹 𝒖,𝑳(𝒖) } 𝑳(𝒖) 𝒖 𝑩𝒂𝒍𝒍(𝒖,𝑽,𝑳)

Reporting distance from 𝒖 𝜹 𝒖,𝑳(𝒖) ≤𝜹 𝒖,𝒗 𝒗 𝒗 𝑳(𝒖) 𝒖 𝑩𝒂𝒍𝒍(𝒖,𝑽,𝑳)

stretch ≤𝟑 What is the stretch ? 𝜹 𝒖,𝑳(𝒖) ≤𝜹 𝒖,𝒗 ?? ≤𝜹 𝒖,𝒗 +𝜹 𝒖,𝑳(𝒖) ≤𝟐𝜹 𝒖,𝒗 𝒗 𝑳(𝒖) 𝒖 𝑩𝒂𝒍𝒍(𝒖,𝑽,𝑳)

3-approximate distance oracle Preprocessing-algorithm(𝑮) { Compute set 𝑳 suitably; For each 𝒗∈𝑳 store distance to all vertices; For each 𝒗∈𝑽\𝑳 compute 𝑩𝒂𝒍𝒍(𝒖,𝑽,𝑳); Build a hash table storing distances from 𝒖 to 𝑩𝒂𝒍𝒍(𝒖,𝑽,𝑳); } Query(𝒖, 𝒗) { If 𝒗∈𝑩𝒂𝒍𝒍(𝒖,𝑽,𝑳) return 𝜹 𝒖,𝒗 ; else return 𝜹 𝒖,𝑳(𝒖) +𝜹 𝑳(𝒖),𝒗 ; Global distance info. Local distance info.

The real challenge left How to compute set 𝑳 such that 𝑳 is small. 𝑩𝒂𝒍𝒍(𝒖,𝑽,𝑳) is small for each 𝒖∈𝑽\𝑳. Fact1: It is difficult, if not impossible, to compute such a set deterministically. Fact2: The structure of graph (the edges and weights) can be arbitrary and more complex than planar road/air networkk.

The real challenge left 𝑳(𝒖) 𝒖 𝑩𝒂𝒍𝒍(𝒖,𝑽,𝑳)

Conquering the challenge Let 𝒑>𝟎 be a fraction to be fixed later on. Computing 𝑳 : { 𝑳∅; For each 𝒗∈𝑽 Add 𝒗 to 𝑳 independently with probability 𝒑; return 𝑳; } Expected size of 𝑳 : 𝑶 𝒏𝒑 𝑿: random variable for |𝑩𝒂𝒍𝒍(𝒖,𝑽,𝑳)|

Expected size of 𝑩𝒂𝒍𝒍(𝒖,𝑽,𝑳) 𝑿 𝒊 = 𝟏 if 𝒗 𝒊 is present in 𝑩𝒂𝒍𝒍(𝒖,𝑽,𝑳) 𝟎 otherwise 𝑿= 𝟎≤𝒊<𝒏 𝑿 𝒊 𝐄[𝑿]= 𝟎≤𝒊<𝒏 𝐄[ 𝑿 𝒊 ] = 𝟎≤𝒊<𝒏 𝐏( 𝑿 𝒊 =𝟏) = 𝟎≤𝒊<𝒏 𝐏( 𝒗 𝒊 is present in 𝑩𝒂𝒍𝒍(𝒖,𝑽,𝑳)) = 𝟎≤𝒊<𝒏 𝟏−𝒑 𝒊+𝟏 < 𝟏−𝒑 𝒑 = 𝑶 𝟏 𝒑 𝒗 𝟏 𝒗 𝟐 … 𝒗 𝒊 … 𝒗 𝒏−𝟏 𝒖 Increasing order of distance from 𝒖 None of 𝒗 𝟎 , …, 𝒗 𝒊 is present in 𝑳

Expected space of 3-approximate distance oracle Space for Global distance information: = 𝑶 𝒏|𝑳| = 𝑶 𝒏 ∙𝒏𝒑 = 𝑶 𝒏 𝟐 𝒑 Space for Local distance information: = 𝑶 𝑽\𝑳 𝟏 𝒑 = 𝑶 𝒏 𝒑 To minimize the total space: (Balance the two terms) 𝒑= 𝟏 √𝒏 Expected space: 𝑶( 𝒏 𝟏+ 𝟏 𝟐 ) Each vertex in 𝑽\𝑳 keeps a Ball)

Theorem: An undirected weighted graph can be processed to build a data structure of expected size 𝑶( 𝒏 𝟏+ 𝟏 𝟐 ) that can report 3-approximate distance between any pair of vertices in 𝑶 𝟏 time. Homework: Convert to a Las Vegas algorithm with high probability bound on space. Show that expected preprocessing time is 𝑶 𝒎 𝒏 + 𝒏 𝟐

5-approximate distance oracle Meant for only those (hopefully nonzero no. of) students whose aim is more than just a good grade in this course.

3-approximate distance oracle 𝑳 𝑽

5-approximate distance oracle 𝑳 𝟐 𝑳 𝟏 𝑽

5-approximate distance oracle 𝑳 𝟐 (𝒖) 𝑳 𝟏 (𝒖) 𝒖 𝑩𝒂𝒍𝒍(𝒖,𝑽, 𝑳 𝟏 ) 𝑩𝒂𝒍𝒍(𝒖, 𝑳 𝟏 , 𝑳 𝟐 )

problem 2 Min-cut

Min-Cut 𝑮=(𝑽,𝑬) : undirected connected graph Definition (cut): A subset 𝑪⊆𝑬 whose removal disconnects the graph. Definition (min-cut): A cut of smallest size. Problem Definition: Design algorithm to compute min-cut of a given graph.

Min-Cut Deterministic Algorithms: 𝑶 𝒎𝒏 𝐩𝐨𝐥𝐲𝐥𝐨𝐠 𝒏 time - Designed in 1997, - Quite complex to analyze and implement Randomized Algorithms: 𝑶( 𝒏 𝟐 𝐩𝐨𝐥𝐲𝐥𝐨𝐠 𝒏) time Monte Carlo [1993] 𝑶(𝒎 𝐩𝐨𝐥𝐲𝐥𝐨𝐠 𝒏) time Monte Carlo [1996] - Both are much simpler and easier to implement.

some basic facts

Min-Cut Question: How many cuts ? Answer: 𝟐 𝒏 −𝟐 𝟐 Question : what is relation between degree(𝒖) and size of min-cut ? Answer: size of min-cut ≤ degree(𝒖) Question : If size of min-cut is 𝒌, what can be minimum value of 𝒎 ? Answer: 𝒏𝒌 𝟐

Contract(𝑮,𝒆) 𝒖 𝒗 𝒘 𝒚 𝒙 𝒂 𝒃 𝒉 𝒍 Contract(𝑮,(𝒙,𝒚)) 𝒖 𝒗 𝒘 𝒂 𝒃 𝒉 𝒍 𝒙𝒚

Contract(𝑮,𝒆) Contract(𝑮,𝒆) { Let 𝒆=(𝒙,𝒚); Merge the two vertices 𝒙 and 𝒚 into one vertex; Preserve multi-edges; Remove the edge 𝒙,𝒚 ; Let 𝑮′ be the modified graph; return 𝑮′; } Time complexity of Contract(𝑮,𝒆): 𝑶(𝒏)

Contract(𝑮,𝒆) Let 𝒌 be the size of min-cut of 𝑮. Let 𝑪 be any min-cut of 𝑮. Let 𝑮′ be the graph after Contract(𝑮,𝒆). Observation: Every cut of 𝑮′ is also a cut of 𝑮. Question: Under what circumstance 𝑪 is a cut of 𝑮′ ? Answer: if 𝒆∉𝑪. Question: If 𝒆 is selected randomly uniformly, what is the probability that 𝑪 is preserved in 𝑮′ ? Answer: 𝒌 𝒎 ≤ 𝒌 𝒏𝒌/𝟐 ≤ 𝟐 𝒏

Contract(𝑮,𝒆) Let 𝒌 be the size of min-cut of 𝑮. Let 𝑪 be any min-cut of 𝑮. Lemma: If edge 𝒆 to be contracted is selected randomly uniformly, 𝑪 is preserved with probability at least 1− 𝟐 𝒏 . Let 𝒆 ∈ 𝒓 𝑮; 𝑮′  Contract(𝑮,𝒆). Let 𝒆′ ∈ 𝒓 𝑮′; 𝑮′′  Contract(𝑮′,𝒆). Question: What is probability that 𝑪 is preserved in 𝑮′′ ? Answer: 1− 𝟐 𝒏 . 1− 𝟐 𝒏−𝟏

Algorithm for min-cut Min-cut(𝑮): { Repeat ?? times { Let 𝒆 ∈ 𝒓 𝑮; 𝑮  Contract(𝑮,𝒆). } return the edges of multi-graph 𝑮; Running time: 𝑶( 𝒏 𝟐 ) 𝒏−𝟐

Algorithm for min-cut Question: What is probability that 𝑪 is preserved during the algorithm ? Answer: 1− 𝟐 𝒏 . 1− 𝟐 𝒏−𝟏 . 1− 𝟐 𝒏−𝟐 … 3 5 . 2 4 . 1 3 = 𝒏−𝟐 𝒏 . 𝒏−𝟑 𝒏−𝟏 . 𝒏−𝟒 𝒏−𝟐 … 3 5 . 2 4 . 1 3 = 𝟐 𝒏 . 𝟏 𝒏−𝟏 > 𝟏 𝒏 𝟐

Algorithm for min-cut Min-cut-high-probability(𝑮): { Repeat Min-cut(𝑮) algorithm 𝒄 𝒏 𝟐 log 𝒏 times and report the smallest cut computed; } Running time: 𝑶( 𝒏 𝟒 𝐥𝐨𝐠 𝒏) Error Probability : 𝟏− 𝟏 𝒏 𝟐 𝒄 𝒏 𝟐 𝐥𝐨𝐠 𝒏 < 𝟏 𝒏 𝒄