5 research outputs found

    Improved Space-efficient Linear Time Algorithms for Some Classical Graph Problems

    Full text link
    This short note provides space-efficient linear time algorithms for computing bridges, topological sorting, and strongly connected components improving on several recent results of Elmasry et al. [STACS'15], Banerjee et al. [COCOON'16] and Chakraborty et al. [ISAAC'16]. En route, we also provide another DFS implementation with weaker input graph representation assumption without compromising on the time and space bounds of the earlier results of Banerjee et al. [COCOON'16] and Kammer et al. [MFCS'16].Comment: This short article appeared in CTW 201

    Nearly Optimal Space Efficient Algorithm for Depth First Search

    Full text link
    We design a space-efficient algorithm for performing depth-first search traversal(DFS) of a graph in O(m+nlogβ‘βˆ—n)O(m+n\log^* n) time using O(n)O(n) bits of space. While a normal DFS algorithm results in a DFS-tree (in case the graph is connected), our space bounds do not permit us even to store such a tree. However, our algorithm correctly outputs all edges of the DFS-tree. The previous best algorithm (which used O(n)O(n) working space) took O(mlog⁑n)O(m \log n) time (Asano, Izumi, Kiyomi, Konagaya, Ono, Otachi, Schweitzer, Tarui, Uehara (ISAAC 2014) and Elmasry, Hagerup, Krammer (STACS 2015)). The main open question left behind in this area was to design faster algorithm for DFS using O(n)O(n) bits of space. Our algorithm answers this open question as it has a nearly optimal running time (as the DFS takes O(m+n)O(m+n) time even if there is no space restriction)

    Biconnectivity, stst-numbering and other applications of DFS using O(n)O(n) bits

    Full text link
    We consider space efficient implementations of some classical applications of DFS including the problem of testing biconnectivity and 22-edge connectivity, finding cut vertices and cut edges, computing chain decomposition and stst-numbering of a given undirected graph GG on nn vertices and mm edges. Classical algorithms for them typically use DFS and some Ξ©(lg⁑n)\Omega (\lg n) bits\footnote{We use lg⁑\lg to denote logarithm to the base 22.} of information at each vertex. Building on a recent O(n)O(n)-bits implementation of DFS due to Elmasry et al. (STACS 2015) we provide O(n)O(n)-bit implementations for all these applications of DFS. Our algorithms take O(mlg⁑cnlg⁑lg⁑n)O(m \lg^c n \lg\lg n) time for some small constant cc (where c≀2c \leq 2). Central to our implementation is a succinct representation of the DFS tree and a space efficient partitioning of the DFS tree into connected subtrees, which maybe of independent interest for designing other space efficient graph algorithms.Comment: 18 pages, 4 figures, Preliminary version of this article appeared in the proceedings of 27th ISAAC 2016, Journal version is accepted to JCSS and will soon appea

    Improved Space efficient linear time algorithms for BFS, DFS and applications

    Full text link
    Recent work by Elmasry et al. (STACS 2015) and Asano et al. (ISAAC 2014), reconsidered classical fundamental graph algorithms focusing on improving the space complexity. We continue this line of work focusing on space. Our first result is a simple data structure that can maintain any subset SS of a universe of nn elements using n+o(n)n+o(n) bits and support in constant time, apart from the standard insert, delete and membership queries, the operation {\it findany} that finds and returns any element of the set (or outputs that the set is empty). Using this we give a BFS implementation that takes O(m+n)O(m+n) time using at most 2n+o(n)2n+o(n) bits. Later, we further improve the space requirement of BFS to at most 1.585n+o(n)1.585n + o(n) bits. We demonstrate the use of our data structure by developing another data structure using it that can represent a sequence of nn non-negative integers x1,x2,…xnx_1, x_2, \ldots x_n using at most βˆ‘i=1nxi+2n+o(βˆ‘i=1nxi+n)\sum_{i=1}^n x_i + 2n + o(\sum_{i=1}^n x_i+n) bits and, in constant time, determine whether the ii-th element is 00 or decrement it otherwise. We also discuss an algorithm for finding a minimum weight spanning tree of a weighted undirected graph using at most n+o(n)n+o(n) bits. We also provide an implementation for DFS that takes O(m+n)O(m+n) time and O(nlg⁑(m/n))O(n \lg(m/n)) bits. Using this DFS algorithm and other careful implementations, we can test biconnectivity, 2-edge connectivity, and determine cut vertices, bridges etc among others, essentially within the same time and space bounds required for DFS. These improve the space required for earlier implementations from Ξ©(nlg⁑n)\Omega (n\lg n) bits.Comment: A preliminary version of this paper appears in the proceedings of COCOON 201

    Frameworks for Designing In-place Graph Algorithms

    Full text link
    Read-only memory model is a classical model of computation to study time-space tradeoffs of algorithms. One of the classical results on the ROM model is that any sorting algorithm that uses O(s) words of extra space requires Ξ©(n2/s)\Omega (n^2/s) comparisons for lg⁑n≀s≀n/lg⁑n \lg n \leq s \leq n/\lg n and the bound has also been recently matched by an algorithm. However, if we relax the model (from ROM), we do have sorting algorithms (say Heapsort) that can sort using O(nlg⁑n)O(n \lg n) comparisons using O(lg⁑n)O(\lg n) bits of extra space, even keeping a permutation of the given input sequence at any point of time during the algorithm. We address similar questions for graph algorithms. We show that a simple natural relaxation of ROM model allows us to implement fundamental graph search methods like BFS and DFS more space efficiently than in ROM. By simply allowing elements in the adjacency list of a vertex to be permuted, we show that, on an undirected or directed connected graph GG having nn vertices and mm edges, the vertices of GG can be output in a DFS or BFS order using O(lg⁑n)O(\lg n) bits of extra space and O(n3lg⁑n)O(n^3 \lg n) time. Thus we obtain similar bounds for reachability and shortest path distance (both for undirected and directed graphs). With a little more (but still polynomial) time, we can also output vertices in the lex-DFS order. As reachability in directed graphs and shortest path distance are NL-complete, and lex-DFS is P-complete, our results show that our model is more powerful than ROM if L β‰ \neq P. En route, we also introduce and develop algorithms for another relaxation of ROM where the adjacency lists of the vertices are circular lists and we can modify only the heads of the lists. All our algorithms are simple but quite subtle, and we believe that these models are practical enough to spur interest for other graph problems in these models
    corecore