Given a directed edge-weighted graph $G=(V, E)$ with beer vertices $B\subseteq V$, a beer path between two vertices $u$ and $v$ is a path between $u$ and $v$ that visits at least one beer vertex in $B$, and the beer distance between two vertices is the shortest length of beer paths. We consider \emph{indexing problems} on beer paths, that is, a graph is given a priori, and we construct some data structures (called indexes) for the graph. Then later, we are given two vertices, and we find the beer distance or beer path between them using the data structure. For such a scheme, efficient algorithms using indexes for the beer distance and beer path queries have been proposed for outerplanar graphs and interval graphs. For example, Bacic et al. (2021) present indexes with size $O(n)$ for outerplanar graphs and an algorithm using them that answers the beer distance between given two vertices in $O(\alpha(n))$ time, where $\alpha(\cdot)$ is the inverse Ackermann function; the performance is shown to be optimal. This paper proposes indexing data structures and algorithms for beer path queries on general graphs based on two types of graph decomposition: the tree decomposition and the triconnected component decomposition. We propose indexes with size $O(m+nr^2)$ based on the triconnected component decomposition, where $r$ is the size of the largest triconnected component. For a given query $u,v\in V$, our algorithm using the indexes can output the beer distance in query time $O(\alpha(m))$. In particular, our indexing data structures and algorithms achieve the optimal performance (the space and the query time) for series-parallel graphs, which is a wider class of outerplanar graphs.
翻译:给定一个有向边权图 $G=(V, E)$ 和啤酒顶点集合 $B\subseteq V$,两个顶点 $u$ 和 $v$ 之间的啤酒路径是指至少经过 $B$ 中一个啤酒顶点的 $u$ 到 $v$ 路径,而两个顶点之间的啤酒距离则是啤酒路径的最短长度。本文考虑啤酒路径上的索引问题,即给定先验图,我们为该图构建一些数据结构(称为索引)。随后,在给定两个顶点时,利用该数据结构找出它们之间的啤酒距离或啤酒路径。对于此类方案,已有针对外平面图和区间图的高效索引算法,用于啤酒距离和啤酒路径查询。例如,Bacic 等人(2021)为外平面图提出了大小为 $O(n)$ 的索引,并利用这些索引设计了算法,可在 $O(\alpha(n))$ 时间内回答给定两个顶点之间的啤酒距离,其中 $\alpha(\cdot)$ 是反阿克曼函数;该性能被证明是最优的。本文基于两种图分解方法——树分解与三连通分量分解——为一般图上的啤酒路径查询提出了索引数据结构与算法。我们基于三连通分量分解提出了大小为 $O(m+nr^2)$ 的索引,其中 $r$ 是最大三连通分量的大小。对于给定查询 $u,v\in V$,使用这些索引的算法可在查询时间 $O(\alpha(m))$ 内输出啤酒距离。特别地,对于系列平行图(一类比外平面图更广泛的图),我们的索引数据结构与算法实现了最优性能(空间复杂度与查询时间)。