English

Shortest Beer Path Queries based on Graph Decomposition

Data Structures and Algorithms 2023-07-12 v2

Abstract

Given a directed edge-weighted graph G=(V,E)G=(V, E) with beer vertices BVB\subseteq V, a beer path between two vertices uu and vv is a path between uu and vv that visits at least one beer vertex in BB, 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)O(n) for outerplanar graphs and an algorithm using them that answers the beer distance between given two vertices in O(α(n))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+nr2)O(m+nr^2) based on the triconnected component decomposition, where rr is the size of the largest triconnected component. For a given query u,vVu,v\in V, our algorithm using the indexes can output the beer distance in query time O(α(m))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.

Keywords

Cite

@article{arxiv.2307.02787,
  title  = {Shortest Beer Path Queries based on Graph Decomposition},
  author = {Tesshu Hanaka and Hirotaka Ono and Kunihiko Sadakane and Kosuke Sugiyama},
  journal= {arXiv preprint arXiv:2307.02787},
  year   = {2023}
}

Comments

25 pages, 9 figures

R2 v1 2026-06-28T11:23:23.783Z