Download presentation
Presentation is loading. Please wait.
1
Space-efficient graph algorithms
Srinivasa Rao Satti Seoul National University
2
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
3
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.
4
Read-only memory model
5
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
6
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.
7
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.
8
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
9
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)
10
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)
11
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)
12
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.
13
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.
14
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).
15
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.
16
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.
17
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.
18
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.
19
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.
20
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
21
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)
22
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 ?
23
Thank You
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.