We study the problem of efficiently answering strong connectivity queries under two vertex failures. Given a directed graph $G$ with $n$ vertices, we provide a data structure with $O(nh)$ space and $O(h)$ query time, where $h$ is the height of a decomposition tree of $G$ into strongly connected subgraphs. This immediately implies data structures with $O(n \log{n})$ space and $O(\log{n})$ query time for graphs of constant treewidth, and $O(n^{3/2})$ space and $O(\sqrt{n})$ query time for planar graphs. For general directed graphs, we give a refined version of our data structure that achieves $O(n\sqrt{m})$ space and $O(\sqrt{m})$ query time, where $m$ is the number of edges of the graph. We also provide some simple BFS-based heuristics that seem to work remarkably well in practice. In the experimental part, we first evaluate various methods to construct a decomposition tree with small height $h$ in practice. Then we provide efficient implementations of our data structures, and evaluate their empirical performance by conducting an extensive experimental study on graphs taken from real-world applications.
翻译:我们研究在两次顶点故障下高效回答强连通查询的问题。给定一个包含 $n$ 个顶点的有向图 $G$,我们提出一种空间复杂度为 $O(nh)$、查询时间复杂度为 $O(h)$ 的数据结构,其中 $h$ 是将 $G$ 分解为强连通子图的分解树的高度。这直接意味着:对于恒定树宽图,可获得空间 $O(n \log{n})$ 和查询时间 $O(\log{n})$ 的数据结构;对于平面图,可获得空间 $O(n^{3/2})$ 和查询时间 $O(\sqrt{n})$ 的数据结构。对于一般有向图,我们给出该数据结构的改进版本,实现了空间 $O(n\sqrt{m})$ 和查询时间 $O(\sqrt{m})$,其中 $m$ 是图的边数。我们还提供一些基于BFS的简单启发式方法,这些方法在实践中表现异常出色。在实验部分,我们首先评估了多种构建较小高度 $h$ 的分解树的方法。随后,我们提供了数据结构的有效实现,并通过在取自实际应用的图上进行广泛的实验研究,评估了它们的经验性能。