arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1606.04718cs.DS
收藏

BFS、DFS的改进的空间有效线性时间算法及其应用

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

Niranka Banerjee, Sankardeep Chakraborty, Venkatesh Raman, Srinivasa Rao Satti

摘要:

Elmasry等人(STACS 2015)和Asano等人(ISAAC 2014)最近的工作重新考虑了经典的基本图算法,重点是提高空间复杂度。我们继续专注于太空的工作。我们的第一个结果是一个简单的数据结构,它可以使用$n+o(n)$位来维护$n$元素域的任何子集$S$,并且除了标准的插入、删除和成员查询之外,还可以在恒定时间内支持查找并返回集合中的任何元素(或输出集合为空)的操作{ \it findany}。利用这一点,我们给出了一个BFS的实现,需要$O(m+n)$的时间,使用最多$2n+o(n)$位。之后,我们进一步将BFS的空间要求提高到最多$1.585n + o(n)$位。我们演示了我们的数据结构的使用,通过开发另一种数据结构,使用它可以表示一个序列的$n$非负整数$x_1, x_2, \ldots x_n$使用最多$\sum_{i=1}^n x_i + 2n + o(\sum_{i=1}^n x_i+n)$位,并在恒定的时间,确定是否$i$ -th元素是$0$或递减,否则。我们还讨论了一个算法,找到一个最小重量生成树的加权无向图使用最多$n+o(n)$位。我们还提供了一个DFS的实现,它需要$O(m+n)$时间和$O(n \lg(m/n))$位。使用这个DFS算法和其他仔细的实现,我们可以测试双连通性,2-边连通性,并确定割点,桥等,基本上在DFS所需的相同时间和空间范围内。这些改进了早期实现从$Ω(n\lg n)$位开始所需的空间。

英文摘要:

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 $S$ of a universe of $n$ elements using $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)$ time using at most $2n+o(n)$ bits. Later, we further improve the space requirement of BFS to at most $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 $n$ non-negative integers $x_1, x_2, \ldots x_n$ using at most $\sum_{i=1}^n x_i + 2n + o(\sum_{i=1}^n x_i+n)$ bits and, in constant time, determine whether the $i$-th element is $0$ 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)$ bits. We also provide an implementation for DFS that takes $O(m+n)$ time and $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 $Ω(n\lg n)$ bits.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑