Skip to main content
QUICK REVIEW

[Paper Review] Nearly Optimal Space Efficient Algorithm for Depth First Search

Jayesh Choudhari, Manoj Gupta|arXiv (Cornell University)|Oct 16, 2018
Computational Geometry and Mesh Generation10 references4 citations
TL;DR

This paper presents a randomized, space-efficient depth-first search (DFS) algorithm that runs in $O(m + n/log^{*}n)$ time using only $O(n)$ bits of memory, achieving near-optimal performance under strict space constraints. By leveraging hierarchical data structures and succinct dictionaries with $O(1)$ expected operations, the algorithm efficiently tracks vertex states and edge traversal without storing the DFS tree, resolving a long-standing open question on faster $O(n)$-bit DFS algorithms.

ABSTRACT

We design a space-efficient algorithm for performing depth-first search traversal(DFS) of a graph in $O(m+n\log^* n)$ time using $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)$ working space) took $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)$ bits of space. Our algorithm answers this open question as it has a nearly optimal running time (as the DFS takes $O(m+n)$ time even if there is no space restriction).

Motivation & Objective

  • To design a DFS algorithm that runs in near-linear time while using only $O(n)$ bits of space, addressing the gap between theoretical optimality and practical space efficiency.
  • To resolve the open question of whether DFS can be performed in $o(m\log n)$ time using $O(n)$ bits, which had remained unresolved since Asano et al. (2014).
  • To enable efficient DFS traversal in memory-constrained environments such as IoT devices and big data systems where space is severely limited.
  • To develop a practical, randomized algorithm with high probability correctness ($1 - 1/n^c$) that maintains $O(1)$ expected time per operation on dynamic data structures.

Proposed method

  • The algorithm uses a hierarchical partitioning of vertices based on degree, grouping vertices into levels $\mathcal{S}_i$ and $\mathcal{T}_i$ to manage high-degree and low-degree vertices separately.
  • It maintains dynamic dictionaries $\mathcal{H}_i$ for heavy vertices, using succinct data structures that support $O(1)$ expected time insertions and deletions with high probability.
  • A color-based state tracking system (white, gray, black) is used to simulate DFS traversal, with restoration procedures to maintain data structure consistency after updates.
  • The algorithm employs a recursive structure where each level $\mathcal{S}_i$ is restored via Restore-Full or Restore-Empty procedures only when necessary, bounded by $O((\log^{(i)}n)^2)$ restorations per level.
  • The use of iterated logarithmic functions $\log^{(i)}n$ allows the algorithm to balance space and time, with the total space across all structures bounded by $O(n)$ bits.
  • The algorithm leverages the register input model, where input is read-only and workspace is limited to $O(n)$ bits, ensuring space efficiency without modifying the input graph.

Experimental results

Research questions

  • RQ1Can DFS be performed in $o(m\log n)$ time using only $O(n)$ bits of space, thus achieving near-optimal time complexity under strict space constraints?
  • RQ2How can dynamic data structures be designed to support $O(1)$ expected time operations under $O(n)$-bit memory, while maintaining correctness for DFS traversal?
  • RQ3What is the minimal space overhead required to simulate DFS traversal without storing the DFS tree, especially in the context of graph streaming and memory-constrained systems?
  • RQ4Can the use of hierarchical vertex grouping and iterative logarithmic levels reduce the total number of operations and restore time in space-constrained DFS algorithms?

Key findings

  • The algorithm achieves a running time of $O(m + n\log^{*}n)$ with high probability $(1 - 1/n^c)$, which is nearly optimal as the theoretical lower bound for DFS is $O(m+n)$.
  • The total space usage is bounded by $O(n)$ bits, with all auxiliary data structures (including dictionaries and level sets) contributing sub-linearly to the total space.
  • The number of times any structure $\mathcal{S}_i$ is restored is bounded by $O((\log^{(i)}n)^2)$, ensuring that the total restoration cost remains within the overall time bound.
  • The use of succinct dictionaries with $O(1)$ expected time per operation enables efficient tracking of vertex states and group memberships, crucial for maintaining performance under space constraints.
  • The cumulative space of all hierarchical structures $\mathcal{T}_i$ and $\mathcal{H}_i$ is asymptotically negligible, summing to $O(n)$ bits, confirming the space efficiency of the design.
  • The algorithm improves upon prior $O(m\log n)$ time $O(n)$-bit DFS algorithms, including those by Asano et al. and Hagerup, by reducing the time complexity to nearly linear in $m+n$.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.