• Home
  • Search
  • Space Efficient Linear Time Algorithms for BFS, DFS and Applications
  • Cite Icon29
  • https://doi.org/10.1007/s00224-017-9841-2Copy DOI Icon

Space Efficient Linear Time Algorithms for BFS, DFS and Applications

Show More
  • Abstract
  • Literature Map
  • References
  • Citations
  • Similar Papers
Abstract

Research on space efficient graph algorithms, particularly for st-connectivity, has a long history including the celebrated polynomial time, O(lg n) bits1 algorithm in undirected graphs by Reingold J. JACM. 55(4) (2008), and polynomial time, \(n/2^{\Theta (\sqrt {\lg n})}\) bits algorithm in directed graphs by Barnes et al. SICOMP. 27(5), 1273–1282 (1998). Recent works by Asano et al. ISAAC (2014) and Elmasry et al. STACS (2015), reconsidered classical fundamental graph algorithms focusing on improving the space complexity. Elmasry et al. gave, among others, an implementation of breadth first search (BFS) in a graph G with n vertices and m edges, taking the optimal O(m + n) time using O(n) bits improving the naive O(n lg n) bits implementation. Similarly, Asano et al. provided space efficient implementations for performing depth first search (DFS) in a graph G. We continue this line of work focusing on improving the space requirement for implementing a few classical graph algorithms. Our first result is a simple data structure that can maintain any subset S of a universe of u elements using just u + o(u) bits and supports in constant time, apart from the standard insert, delete and membership queries, the operation findany that finds and returns any element of the set (or outputs that the set is empty). It can also enumerate all elements present currently in the set in no particular order in O(k + 1) time where k is the number of elements currently belonging to the set. While this data structure supports a weaker set of operations than that of Elmasry et al. STACS (2015), it is simple, more space efficient and is sufficient to support a BFS implementation optimally in O(m + n) time using at most 2n + o(n) bits. Later, we further improve the space requirement of BFS to at most n lg 3 + o(n) bits albeit with a slight increase in running time to O(m lg nf(n)) time where f(n) is any extremely slow growing function of n, and the o term in the space is a function of f(n). We also discuss a similar time-space tradeoff result for finding a minimum weight spanning tree of a weighted (bounded by polynomial in n) undirected graph using n + O(n/f(n)) bits and O(m lg nf(n)) time, for any function f(n) such that 1 ≤ f(n) ≤ n. For DFS in a graph G, we provide an implementation taking O(m + n) time and O(n lg m/n) bits. This partially answers at least for sparse graphs, a question asked by Asano et al. ISAAC (2014) whether DFS can be performed in O (m + n) time and using O(n) bits, and also simultaneously improves the DFS result of Elmasry et al. STACS (2015). Using our DFS algorithm and other careful implementations, we show how one can also test for biconnectivity, 2-edge connectivity, and find cut vertices and bridges of a given undirected graph within the same time and space bounds; earlier classical linear time algorithms for these problems used Ω(n lg n) bits of space.

Similar Papers
  • Research Article
  • Citations2

Optimizing the Implementation of the BFS and DFS algorithms using the web crawler method on the kumparan site

  • Jul 04, 2024
  • Journal of Soft Computing Exploration
  • Amirul Mustaqim +5
  • Book Chapter
  • Citations9

On External-Memory Planar Depth-First Search

  • May 01, 2006
  • Lars Arge +3
  • Book Chapter
  • Citations5

On External-Memory Planar Depth First Search

  • Jan 01, 2001
  • Lars Arge +3
  • Research Article
  • Citations6

An external-memory depth-first search algorithm for general grid graphs

  • Dec 30, 2006
  • Theoretical Computer Science
  • Jun-Ho Her +1
  • Research Article
  • Citations2

A graph algorithm for the time constrained shortest path

  • May 20, 2022
  • Connection Science
  • Pan Liu +1
  • PDF
  • Conference Article

Graphs where Search Methods are Indistinguishable

  • Sep 13, 2021
  • Matjaž Krnc +1
  • Book Chapter
  • Citations2

A Memetic Immunological Algorithm for Resource Allocation Problem

  • Jan 01, 2011
  • Jole Costanza +2
  • Conference Article
  • Citations21

Optimal Reversible Logic Circuit Synthesis Based on a Hybrid DFS-BFS Technique

  • Dec 01, 2010
  • D K Kole +3
  • Conference Article
  • Citations4

Path Exploration Based on Monte Carlo Tree Search for Symbolic Execution

  • Dec 01, 2017
  • Chao-Chun Yeh +3
  • Research Article
  • Citations22

Mining maximal hyperclique pattern: A hybrid search strategy

  • Aug 17, 2006
  • Information Sciences
  • Yaochun Huang +4
  • Conference Article
  • Citations2

Determining the Intrinsic Structure of Public Software Development History

  • Jun 29, 2020
  • Antoine Pietri +2
  • PDF
  • Research Article
  • Citations3

Research on Dynamic Programming Strategy of Bayesian Network Structure Learning

  • May 20, 2022
  • Scientific Programming
  • Ruohai Di +4
  • Conference Article
  • Citations134

Depth first search and location based localized routing and QoS routing in wireless networks

  • Aug 21, 2000
  • I Stojmenovic +2
  • Research Article
  • Citations8

I/O-Optimal Algorithms for Outerplanar Graphs

  • Jan 01, 2004
  • Journal of Graph Algorithms and Applications
  • Anil Maheshwari +1
  • Book Chapter
  • Citations6

An Automatic Marking System for Interactive Exercises on Blind Search Algorithms

  • Jan 01, 2013
  • Foteini Grivokostopoulou +1
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.