Computing paths in graph structures is a fundamental operation in a wide range of applications, from transportation networks to data analysis. The beer path problem, which captures the option of visiting points of interest, such as gas stations or convenience stops, prior to reaching the final destination, has been recently introduced and extensively studied in static graphs. However, existing approaches do not account for temporal information, which is often crucial in real-world scenarios. For instance, transit services may follow fixed schedules, and shops may only be accessible during certain hours. In this work, we introduce the notion of beer paths in temporal graphs, where edges are time-dependent and certain vertices (beer vertices) are active only at specific time instances. We formally define the problems of computing earliest-arrival, latest-departure, fastest, and shortest temporal beer paths and propose efficient algorithms for these problems under both edge stream and adjacency list representations. The time complexity of each of our algorithms is aligned with that of corresponding temporal pathfinding algorithms, thus preserving efficiency. Additionally, we present preprocessing techniques that enable efficient query answering under dynamic conditions, for example new openings or closings of shops. We achieve this through appropriate precomputation of selected paths or by transforming a temporal graph into an equivalent static graph.
翻译:在图结构中计算路径是众多应用中的基础操作,涵盖从交通网络到数据分析等广泛领域。啤酒路径问题捕捉了在到达最终目的地之前访问兴趣点(如加油站或便利站)的选项,最近被引入并在静态图中得到广泛研究。然而,现有方法未考虑时间信息,而时间信息在现实场景中通常至关重要。例如,运输服务可能依据固定时间表运行,商店可能仅在特定时段开放。本文首次提出时间图中啤酒路径的概念,其中边具有时间依赖性,且某些顶点(啤酒顶点)仅在特定时间实例激活。我们正式定义了最早到达、最晚出发、最快及最短时间啤酒路径的计算问题,并针对边流和邻接表两种表示提出了高效算法。每个算法的时间复杂度与对应的时间图寻路算法一致,从而保持了效率。此外,我们提出了预处理技术,使其能够在动态条件下(例如商店的新开业或关闭)实现高效查询回答。我们通过预计算选定路径或将时间图转换为等效静态图来实现这一目标。