Space-efficient graph algorithms

Slides:



Advertisements
Similar presentations
Lecture 15. Graph Algorithms
Advertisements

Algorithms (and Datastructures) Lecture 3 MAS 714 part 2 Hartmut Klauck.
Dynamic Graph Algorithms - I
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
1 Minimum Spanning Tree Prim-Jarnik algorithm Kruskal algorithm.
Trading off space for passes in graph streaming problems Camil Demetrescu Irene Finocchi Andrea Ribichini University of Rome “La Sapienza” Dagstuhl Seminar.
STCON in Directed Unique-Path Graphs Sampath Kannan Sanjeev Khanna Sudeepa Roy University of Pennsylvania 1.
S. J. Shyu Chap. 1 Introduction 1 The Design and Analysis of Algorithms Chapter 1 Introduction S. J. Shyu.
Chapter 9 Graph algorithms. Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
Chapter 9: Greedy Algorithms The Design and Analysis of Algorithms.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Course Review COMP171 Spring Hashing / Slide 2 Elementary Data Structures * Linked lists n Types: singular, doubly, circular n Operations: insert,
Chapter 9 Graph algorithms Lec 21 Dec 1, Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
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.
The Encoding Complexity of Two Dimensional Range Minimum Data Structures MADALGO, October 2, 2013 (Work presented at ESA 2013) 1234  n
The Encoding Complexity of Two Dimensional Range Minimum Data Structures European Symposium on Algorithms, Inria, Sophia Antipolis, France, September 3,
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
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.
Lecture 11 Algorithm Analysis Arne Kutzner Hanyang University / Seoul Korea.
A deterministic near-linear time algorithm for finding minimum cuts in planar graphs Thank you, Steve, for presenting it for us!!! Parinya Chalermsook.
Data Structures and Algorithms in Parallel Computing Lecture 2.
Speeding Up Enumeration Algorithms with Amortized Analysis Takeaki Uno (National Institute of Informatics, JAPAN)
Review for Final Exam Non-cumulative, covers material since exam 2 Data structures covered: –Treaps –Hashing –Disjoint sets –Graphs For each of these data.
Data Structures and Algorithms in Parallel Computing Lecture 3.
1 Fat heaps (K & Tarjan 96). 2 Goal Want to achieve the performance of Fibonnaci heaps but on the worst case. Why ? Theoretical curiosity and some applications.
Certifying Algorithms [MNS11]R.M. McConnell, K. Mehlhorn, S. Näher, P. Schweitzer. Certifying algorithms. Computer Science Review, 5(2), , 2011.
Graphs A New Data Structure
Graphs 10/24/2017 6:47 AM Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia, and.
Advanced Sorting 7 2  9 4   2   4   7
Graphs Representation, BFS, DFS
School of Computing Clemson University Fall, 2012
Succinct Data Structures
Lecture 11 Graph Algorithms
Graph Algorithms BFS, DFS, Dijkstra’s.
Major Design Strategies
Spanning Trees.
CSE 2331/5331 Topic 9: Basic Graph Alg.
Minimum Spanning Tree 8/7/2018 4:26 AM
Parallel Algorithm Design using Spectral Graph Theory
Lecture 22 Complexity and Reductions
CS120 Graphs.
Graph Algorithm.
Lecture 10 Algorithm Analysis
Minimum Spanning Tree.
Graphs Chapter 13.
Graphs Chapter 15 explain graph-based algorithms Graph definitions
Algorithms and Data Structures Lecture XII
Graph Representation (23.1/22.1)
Lectures on Graph Algorithms: searching, testing and sorting
Graph Operations And Representation
Minimum Spanning Tree Algorithms
CSE 373 Data Structures Lecture 16
ITEC 2620M Introduction to Data Structures
Dynamic Graph Algorithms
Text Book: Introduction to algorithms By C L R S
Chapter 16 1 – Graphs Graph Categories Strong Components
CSC 380: Design and Analysis of Algorithms
CSE 417: Algorithms and Computational Complexity
Algorithms CSCI 235, Spring 2019 Lecture 35 Graphs IV
Important Problem Types and Fundamental Data Structures
Chapter 14 Graphs © 2011 Pearson Addison-Wesley. All rights reserved.
Major Design Strategies
Lecture 10 Graph Algorithms
Chapter 9 Graph algorithms
Major Design Strategies
Complexity Theory: Foundations
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 .
Presentation transcript:

Space-efficient graph algorithms Srinivasa Rao Satti Seoul National University

Outline Read-only memory model (ROM) Graph algorithms in ROM BFS & DFS Other problems In-place models Implicit, Rotate & Restore models Results on BFS & DFS Conclusions

Read-only memory model Model(s) [Munro-Paterson, TCS-1980 & Frederickson, JCSS-1987] The input is stored on read-only memory. A small amount of additional workspace is given, to store intermediate results. Output is written onto a write-only memory. Interested in studying the trade-offs between the amount of additional workspace and the running time of the algorithm.

Read-only memory model

Motivation and Applications Massive-parallel computing Input data are shared with many processors. Easy to design algorithms with read-only arrays, (to avoid concurrent writes). Flash Memory Reading is fast but writing is slow; no in-place updates; writing also reduces the lifetime of the memory. Embedded software e.g., digital camera, scanner, wireless sensor array Input data are stored outside with random access. Theoretical curiosity

Selection Problem Input: An array A of n elements (integers) Queries: select(i) returns the ith smallest element in A Models: A is stored in read-only memory; S bits of additional workspace is allowed. Multipass streaming model: input can only be accessed sequentially (several passes over the input are allowed). Space-restricted random-access model: random access to the input is allowed.

Selection in ROM Lower bounds by Chan [TAlg, 2010] Reference Workspace (bits) Runtime Munro-Raman Θ(log n) Raman-Ramnath Θ(log2 n) O(n log2 n) Frederickson Θ(log3 n) O(n log n/ loglog n) Θ(n) O(n log* n) Elmasry et al. O(n) Lower bounds by Chan [TAlg, 2010] Sorting is also well-studied in this model. A few other problems such as priority queues, computing a triangulation, Voronoi diagram, convex hull etc. have also been studied.

Graph problems studied in ROM s-t connectivity (STCON / USTCON) BFS & DFS (strongly) connected components Shortest path Topological sorting (on DAGs) st-numbering Chain decomposition Minimum spanning tree Recognising outer-planar graphs

Earlier results Savich [JCSS, 1970] STCON using O(log2 n) bits Nisan-Szemeredi-Wigderson [FOCS, 1992] USTCON using O(log1.5 n) bits Barnes et al. [SICOMP, 1998] Sublinear space, poly-time algo. for STCON Edmonds et al. [SICOMP, 1999] Poly-time implies almost linear space Reingold [JACM, 2008] USTCON using O(log n) bits, poly-time SL = L (L – log space; SL – symmetric log space)

BFS trade-offs Reference Workspace (bits) Runtime Elmasry et al. O(n) O(m+n) Banerjee et al. 2n+o(n) Hagerup-Kammer n log 3 +o(n) Essentially, space-efficient implementations of the standard BFS algorithm, using succinct dictionaries with additional functionalities – “choice dictionaries” (“ordering” is not maintained)

DFS trade-offs Reference Workspace (bits) Runtime Asano et al. n+o(n) polynomial ,, 2n+o(n) O(mn) O(n) O(m log n) Elmasry et al. O(m loglog n) O(n loglog n) O(m+n) Banerjee et al. Chakraborty et al. O(n log (m/n)) Some of these results require the input representation to support some additional functionality, in addition to that provided by the standard adjacency list representation. (need to store cross pointers between edges)

Results on other problems Topological sorting O(m+n) time using O(m+n) bits This result uses a succinct bit vector encoding that supports rank, findany and flip operations (a choice dictionary). Min. spanning tree, weights – O(n) O(m log n) time using O(n) bits Implements Prim’s algorithm, in batches of O(n/ log n) vertices at a time.

Results on other problems Biconnectivity, strongly connected components, (finding cut vertices, edges) O(m loglog n log n) with O(n) bits st-numbering O(m loglog n log2 n) with O(n) bits Chain decomposition O(m loglog n log3 n) with O(n) bits These results use a `succinct tree representation based on tree covering approach’ to partition the DFS tree, and use a divide-and-conquer strategy.

Graph problems in ROM For (almost) all the graph problems that are studied in the ROM model, compared to the `classical algorithms’, there is an improvement in space by a logarithmic factor, sometimes with a slowdown in running time by a poly-logarithmic factor. For some problems, these are close to the best possible trade-offs that can be achieved (due to the existing lower bounds).

Input representation For classical algorithms, the initial input representation is not very crucial – since we can convert between representations, or construct additional (linear-space) structures, and store them. Since this is not possible in the ROM model, the input representation is crucial. E.g.: the cross pointers assumed by some of the DFS algorithms in ROM model. Also in & out adjacency lists for directed graphs. But this would double the size of the input.

Relaxed ROM models An alternative would be to relax the restriction that the input is “strictly” read- only, i.e., allow the input to be modified in a limited way. Relaxed Model: The input is stored on semi-read-only memory. A small amount of additional workspace is given, to store intermediate results. Output is written onto a write-only memory.

Relaxed ROM models A The adjacency list representation of a graph consists of: An array A of pointers to linked lists A set of linked lists storing the set of adjacent vertices of each vertex In the relaxed models, we assume that one of these two components is read-only, while the other can be modified in a limited way. In-place models -- all the models retain the structure of the graph at all times.

In-place models Implicit model: Restore model: Rotate model: We assume that the first component (array A) is read-only, while any two (adjacent) elements within the same linked list in the second component can be swapped. Restore model: An extension of the implicit model, where the second component can be modified arbitrarily, but the input should be “restored” at the end. Rotate model: We assume the second component (with circular lists) is read-only, while pointers in the first component can be moved forward.

DFS in Implicit model With O(log n) bits, we can perform Lex-DFS in O(m3/n2) time DFS in O(m2/n) time Main idea: encode a single bit by swapping two adjacent vertices in a list In contrast, in the ROM model, we don’t know of a DFS algorithm with less than n bits, we don’t hope to have a poly-time log-space algorithm for lex-DFS -- a P-complete problem.

DFS in Rotate model DFS: Lex-DFS in O(m+n) time using n log 3 + O(log n) bits DFS in O(m+n) time using n + O(log n) bits DFS in O(m2/n + m d) time using O(log n) bits, where d is the depth of the tree

BFS Implicit model: Rotate model: O(m + n d2) time with O(log n) bits Better bounds for the cases when the min- degree is large Rotate model: O(m + n d2) time with n+O(log n) bits O(md + n d2) time with O(log n) bits In contrast, in the ROM model, slightly sublinear-space algorithm takes a `large’ polynomial time [Barnes et al., SICOMP-1998] (d is the depth of the BFS tree)

Conclusions Several basic graph algorithms require almost linear number of bits in the ROM model (to achieve poly-time). Efficient BFS and DFS algorithms with O(log n) bits possible in slight relaxations of the ROM model (in-place models). It’s a relatively new area with a wide range of problems to explore. Complexity theoretic consequences? Catalytic-space model ?

Thank You