The purpose of this report is to explain how the textbook breadth-first search algorithm (BFS) can be modified in order to also create a compact representation of all shortest paths connecting a single source node to all the nodes reachable from it. From this representation, all these paths can also be efficiently enumerated. We then apply this algorithm to solve a similar problem in edge labelled graphs, where paths also have an additional restriction that their edge labels form a word belonging to a regular language. Namely, we solve the problem of evaluating regular path queries (RPQs) under the all-shortest paths semantics.
翻译:本报告的目的是解释如何修改教科书宽度第一搜索算法(BFS), 以便同时创建所有连接单一源节点和所有可达节点的所有最短路径的缩略语表。 从这个表示法中, 所有这些路径都可以有效地加以分类。 然后我们运用这个算法来解决边缘标签图中的类似问题, 边框图的路径还附加了限制, 边框标签会形成属于常规语言的单词。 也就是说, 我们解决了在所有最短路径语义下评估常规路径查询( RPQs ) 的问题 。