English

Engineering Semi-streaming DFS algorithms

Data Structures and Algorithms 2024-06-10 v2

Abstract

Depth first search is a fundamental graph problem having a wide range of applications. For a graph G=(V,E)G=(V,E) having nn vertices and mm edges, the DFS tree can be computed in O(m+n)O(m+n) using O(m)O(m) space where m=O(n2)m=O(n^2). In the streaming environment, most graph problems are studied in the semi-streaming model where several passes (preferably one) are allowed over the input, allowing O(nk)O(nk) local space for some k=o(n)k=o(n). Trivially, using O(m)O(m) space, DFS can be computed in one pass, and using O(n)O(n) space, it can be computed in O(n)O(n) passes. Khan and Mehta [STACS19] presented several algorithms allowing trade-offs between space and passes, where O(nk)O(nk) space results in O(n/k)O(n/k) passes. They also empirically analyzed their algorithm to require only a few passes in practice for even O(n)O(n) space. Chang et al. [STACS20] presented an alternate proof for the same and also presented O(n)O(\sqrt{n}) pass algorithm requiring O(n polylogn)O(n~poly\log n) space with a finer trade-off between space and passes. However, their algorithm uses complex black box algorithms, making it impractical. We perform an experimental analysis of the practical semi-streaming DFS algorithms. Our analysis ranges from real graphs to random graphs (uniform and power-law). We also present several heuristics to improve the state-of-the-art algorithms and study their impact. Our heuristics improve state of the art by 4090%40-90\%, achieving optimal one pass in almost 4050%40-50\% cases (improved from zero). In random graphs, they improve from 3090%30-90\%, again requiring optimal one pass for even very small values of kk. Overall, our heuristics improved the relatively complex state-of-the-art algorithm significantly, requiring merely two passes in the worst case for random graphs. Additionally, our heuristics made the relatively simpler algorithm practically usable even for very small space bounds, which was impractical earlier.

Keywords

Cite

@article{arxiv.2406.03922,
  title  = {Engineering Semi-streaming DFS algorithms},
  author = {Kancharla Nikhilesh Bhagavan and Macharla Sri Vardhan and Madamanchi Ashok Chowdary and Shahbaz Khan},
  journal= {arXiv preprint arXiv:2406.03922},
  year   = {2024}
}