Depth First Search in the Semi-streaming Model
Abstract
Depth first search (DFS) tree is a fundamental data structure for solving various graph problems. The classical DFS algorithm requires time for a graph having vertices and edges. In the streaming model, an algorithm is allowed several passes (preferably single) over the input graph having a restriction on the size of local space used. Trivially, a DFS tree can be computed using a single pass using space. In the semi-streaming model allowing space, it can be computed in passes, where each pass adds one vertex to the DFS tree. However, it remains an open problem to compute a DFS tree using passes using space even in any relaxed streaming environment. We present the first semi-streaming algorithms that compute a DFS tree of an undirected graph in passes using space. We first describe an extremely simple algorithm that requires at most passes using space, where is any positive integer. We then improve this algorithm by using more involved techniques to reduce the number of passes to under similar space constraints, where is the height of the computed DFS tree. In particular, this algorithm improves the bounds for the case where the computed DFS tree is shallow (having height). Moreover, this algorithm is presented as a framework that allows the flexibility of using any algorithm to maintain a DFS tree of a stored sparser subgraph as a black box, which may be of independent interest. Both these algorithms essentially demonstrate the existence of a trade-off between the space and number of passes required for computing a DFS tree. Furthermore, we evaluate these algorithms experimentally which reveals their exceptional performance in practice. For both random and real graphs, they require merely a few passes even when allowed just space.
Cite
@article{arxiv.1901.03689,
title = {Depth First Search in the Semi-streaming Model},
author = {Shahbaz Khan and Shashank K. Mehta},
journal= {arXiv preprint arXiv:1901.03689},
year = {2019}
}
Comments
25 pages, 6 Figures, STACS 2019